'Will create an AMI from the instance in the running or stopped
state.
:type instance_id: string
:param instance_id: the ID of the instance to image.
:type name: string
:param name: The name of the new image
:type description: string
:param description: An optional human-readable string describing
the contents and purpose of the AMI.
:type no_reboot: bool
:param no_reboot: An optional flag indicating that the
bundling process should not attempt to shutdown the
instance before bundling.  If this flag is True, the
responsibility of maintaining file system integrity is
left to the owner of the instance.
:type block_device_mapping: :class:`boto.ec2.blockdevicemapping.BlockDeviceMapping`
:param block_device_mapping: A BlockDeviceMapping data structure
describing the EBS volumes associated with the Image.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: string
:return: The new image id'

def create_image(self, instance_id, name, description=None, no_reboot=False, block_device_mapping=None, dry_run=False):

    params = {'InstanceId': instance_id, 'Name': name}
    if description:
        params['Description'] = description
    if no_reboot:
        params['NoReboot'] = 'true'
    if block_device_mapping:
        block_device_mapping.ec2_build_list_params(params)
    if dry_run:
        params['DryRun'] = 'true'
    img = self.get_object('CreateImage', params, Image, verb='POST')
    return img.id
