add block_device_mapping to create_server params for nova clients

Change-Id: Ic931fab33b461b00a2155407bf307c692c7f18e6
Closes-Bug: #1327942
This commit is contained in:
Andrey Pavlov
2014-06-09 11:02:53 +04:00
committed by Andrey Pavlov
parent 2c75b7cb83
commit 2a2fc41eaa
3 changed files with 9 additions and 3 deletions

View File

@@ -57,6 +57,7 @@ class ServersClientJSON(rest_client.RestClient):
max_count: Count of maximum number of instances to launch.
disk_config: Determines if user or admin controls disk configuration.
return_reservation_id: Enable/Disable the return of reservation id
block_device_mapping: Block device mapping for the server.
"""
post_body = {
'name': name,
@@ -69,7 +70,7 @@ class ServersClientJSON(rest_client.RestClient):
'availability_zone', 'accessIPv4', 'accessIPv6',
'min_count', 'max_count', ('metadata', 'meta'),
('OS-DCF:diskConfig', 'disk_config'),
'return_reservation_id']:
'return_reservation_id', 'block_device_mapping']:
if isinstance(option, tuple):
post_param = option[0]
key = option[1]

View File

@@ -55,6 +55,7 @@ class ServersV3ClientJSON(rest_client.RestClient):
max_count: Count of maximum number of instances to launch.
disk_config: Determines if user or admin controls disk configuration.
return_reservation_id: Enable/Disable the return of reservation id
block_device_mapping: Block device mapping for the server.
"""
post_body = {
'name': name,
@@ -75,7 +76,9 @@ class ServersV3ClientJSON(rest_client.RestClient):
('metadata', 'meta'),
('os-disk-config:disk_config', 'disk_config'),
('os-multiple-create:return_reservation_id',
'return_reservation_id')]:
'return_reservation_id'),
('os-block-device-mapping:block_device_mapping',
'block_device_mapping')]:
if isinstance(option, tuple):
post_param = option[0]
key = option[1]

View File

@@ -318,6 +318,7 @@ class ServersClientXML(rest_client.RestClient):
min_count: Count of minimum number of instances to launch.
max_count: Count of maximum number of instances to launch.
disk_config: Determines if user or admin controls disk configuration.
block_device_mapping: Block device mapping for the server.
"""
server = xml_utils.Element("server",
xmlns=xml_utils.XMLNS_11,
@@ -327,7 +328,8 @@ class ServersClientXML(rest_client.RestClient):
for attr in ["adminPass", "accessIPv4", "accessIPv6", "key_name",
"user_data", "availability_zone", "min_count",
"max_count", "return_reservation_id"]:
"max_count", "return_reservation_id",
"block_device_mapping"]:
if attr in kwargs:
server.add_attr(attr, kwargs[attr])