Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

How to define block_device_mappings when using boto.ec2.autoscale.launchconfig.LaunchConfiguration() #1343

Closed
gaoermai opened this Issue · 1 comment

2 participants

@gaoermai

'm trying using boto to create a launch configuration for auto scaling, but I don't know how to define block_device_mappings.

The code snapshots like this:

dev_sdf = boto.ec2.blockdevicemapping.EBSBlockDeviceType(snapshot_id = self.sna_data.id)
bdm = boto.ec2.blockdevicemapping.BlockDeviceMapping()
bdm['/dev/sdf'] = dev_sdf

lc = launchconfig.LaunchConfiguration(connection = self.as_conn,
                                      name = lc_name,
                                      image_id = self.ami.id,
                                      instance_type = self.instance_type,
                                      key_name = AWS_KEY_NAME,
                                      security_groups = self.security_groups,
                                      spot_price = self.price,
                                      block_device_mappings = [bdm])
self.as_conn.create_launch_configuration(lc)

But I got:

boto.exception.BotoServerError: BotoServerError: 400 Bad Request
<ErrorResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/">
  <Error>
    <Type>Sender</Type>
    <Code>ValidationError</Code>
    <Message>1 validation error detected: Value null at 'blockDeviceMappings.1.member.deviceName' failed to satisfy constraint: Member must not be null</Message>
  </Error>
  <RequestId>7289473c-7bc1-11e2-a07c-93de372a2cc0</RequestId>
</ErrorResponse>

How should I define block_device_mappings?

@toastdriven

Fixed in SHA: 974a23a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.