The --block-device-mapping option in server create doesn't behave as documented

Bug #1502116 reported by Benoît Knecht
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
New
Undecided
Unassigned

Bug Description

server create --help says:

  --block-device-mapping <dev-name=mapping>
                        Map block devices; map is
                        <id>:<type>:<size(GB)>:<delete_on_terminate> (optional
                        extension)

However,

server create --block-device-mapping vdb=e0db26d8-2bf1-4a47-a287-99a09f4f8b71:::0 [...]

returns the following error:

No volume with a name or ID of 'e0db26d8-2bf1-4a47-a287-99a09f4f8b71:::0' exists.

Looking at the code in openstackclient/compute/v2/server.py (line 418):

        block_device_mapping = {}
        if volume:
            # When booting from volume, for now assume no other mappings
            # This device value is likely KVM-specific
            block_device_mapping = {'vda': volume}
        else:
            for dev_map in parsed_args.block_device_mapping:
                dev_key, dev_vol = dev_map.split('=', 1)
                block_volume = None
                if dev_vol:
                    block_volume = utils.find_resource(
                        volume_client.volumes,
                        dev_vol,
                    ).id
                block_device_mapping.update({dev_key: block_volume})

it is clear that it isn't parsing the mapping as described in the documentation, but rather simply looking it up as if it was a volume name or ID.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.