'Create an Amazon Machine Image based off of an EBS-backed instance.
@inherits: :class:`NodeDriver.create_image`
:param      node: Instance of ``Node``
:type       node: :class: `Node`
:param      name: The name for the new image
:type       name: ``str``
:param      block_device_mapping: A dictionary of the disk layout
An example of this dict is included
below.
:type       block_device_mapping: ``list`` of ``dict``
:param      reboot: Whether or not to shutdown the instance before
creation. Amazon calls this NoReboot and
sets it to false by default to ensure a
clean image.
:type       reboot: ``bool``
:param      description: An optional description for the new image
:type       description: ``str``
An example block device mapping dictionary is included:
mapping = [{\'VirtualName\': None,
\'Ebs\': {\'VolumeSize\': 10,
\'VolumeType\': \'standard\',
\'DeleteOnTermination\': \'true\'},
\'DeviceName\': \'/dev/sda1\'}]
:return:    Instance of class ``NodeImage``
:rtype:     :class:`NodeImage`'

def create_image(self, node, name, description=None, reboot=False, block_device_mapping=None):

    params = {'Action': 'CreateImage', 'InstanceId': node.id, 'Name': name, 'NoReboot': (not reboot)}
    if (description is not None):
        params['Description'] = description
    if (block_device_mapping is not None):
        params.update(self._get_block_device_mapping_params(block_device_mapping))
    image = self._to_image(self.connection.request(self.path, params=params).object)
    return image
