create_server: Couldn't specify the volume type when booting an image from volume

Bug #2057479 reported by Nayeong Kim
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstacksdk
New
Undecided
Unassigned

Bug Description

I'm using a higher-level cloud layer for creating a server, and I want to specify the volume type with boot_from_volume option.

My desired `block_device_mapping_v2` is :
[{
    'source_type': 'image',
    'uuid': image_id,
    'boot_index': '0',
    'volume_size': 'volume_size,
    'destination_type': 'volume',
    'delete_on_termination': delete_on_termination,
    'volume_type':'my_volume_type'
}]

But ComputeCloudMixin.create_server does not take `volume_type` and it calls ComputeCloudMixin._get_boot_from_volume_kwargs which makes `block_device_mapping_v2` like:
[{
    'source_type': 'image',
    'uuid': image_id,
    'boot_index': '0',
    'volume_size': 'volume_size,
    'destination_type': 'volume',
    'delete_on_termination': delete_on_termination,
}]

-> No `volume_type` specified and the default one being used.

---------
conn = openstack.connect(cloud=CLOUD)

conn.create_server(
    image=image_id,
    boot_from_volume=True,
    volume_size=100,
    terminate_volume=True,
    name=hostname,
    nics=nics,
    flavor=flavor_id,
    availability_zone=availability_zone,
    userdata=userdata,
    meta=metadata
)
---------

To specify the volume type I can't use the high-level layer and should do like this :
---------
conn = openstack.connect(cloud=CLOUD)

conn.compute.create_server(
    block_device_mapping_v2=block_device,
    name=hostname,
    networks=[{'uuid': network_id, 'fixed_ip': available_ip}],
    flavorRef=flavor_id,
    availability_zone=availability_zone,
    user_data=encode_server_userdata(userdata),
    metadata=metadata
)
----------

It would be great if I can specify the `volume_type` for cloud layer's create_server().

Nayeong Kim (imtherealk)
description: updated
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.