Allow attaching existing volumes when creating node on OpenStack
@@ -1462,6 +1462,10 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver):
server_params['security_groups'].append({'name': name})
if 'ex_blockdevicemappings' in kwargs:
+ if kwargs['ex_blockdevicemappings'][0].get('volume_id'):
+ server_params['block_device_mapping'] = \
+ kwargs['ex_blockdevicemappings']
+ else:
server_params['block_device_mapping_v2'] = \
kwargs['ex_blockdevicemappings']
