Skip to content

Commit

Permalink
add block_device_mapping to create_server params for nova clients
Browse files Browse the repository at this point in the history
Change-Id: Ic931fab33b461b00a2155407bf307c692c7f18e6
Closes-Bug: #1327942
  • Loading branch information
Andrey-mp authored and Andrey Pavlov committed Jun 13, 2014
1 parent 2c75b7c commit 2a2fc41
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tempest/services/compute/json/servers_client.py
Expand Up @@ -57,6 +57,7 @@ def create_server(self, name, image_ref, flavor_ref, **kwargs):
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,
Expand All @@ -69,7 +70,7 @@ def create_server(self, name, image_ref, flavor_ref, **kwargs):
'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]
Expand Down
5 changes: 4 additions & 1 deletion tempest/services/compute/v3/json/servers_client.py
Expand Up @@ -55,6 +55,7 @@ def create_server(self, name, image_ref, flavor_ref, **kwargs):
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,
Expand All @@ -75,7 +76,9 @@ def create_server(self, name, image_ref, flavor_ref, **kwargs):
('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]
Expand Down
4 changes: 3 additions & 1 deletion tempest/services/compute/xml/servers_client.py
Expand Up @@ -318,6 +318,7 @@ def create_server(self, name, image_ref, flavor_ref, **kwargs):
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,
Expand All @@ -327,7 +328,8 @@ def create_server(self, name, image_ref, flavor_ref, **kwargs):

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])

Expand Down

0 comments on commit 2a2fc41

Please sign in to comment.