summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxinhuili <lxinhui@vmware.com>2017-03-26 18:36:41 -0700
committerxinhuili <lxinhui@vmware.com>2017-03-26 18:36:41 -0700
commit645219b86b1a92a62ee1ffd4cd1e5dff0473fbb3 (patch)
treec8d9eec9416f73c0f52cf0e9713e0dc48605fc48
parent22ce175d1479837c3ece813df4c1f1f2a4395a50 (diff)
This pacth fix volume problem
This patch is to fix volume problem. Change-Id: I3739cadd23bd7d7f97a038abaa259269abce30bf Issue-ids: MULTIVIM-36 Signed-off-by: xinhuili <lxinhui@vmware.com>
-rw-r--r--vio/vio/pub/vim/vimapi/nova/OperateServers.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/vio/vio/pub/vim/vimapi/nova/OperateServers.py b/vio/vio/pub/vim/vimapi/nova/OperateServers.py
index f42c0dd..f18ea83 100644
--- a/vio/vio/pub/vim/vimapi/nova/OperateServers.py
+++ b/vio/vio/pub/vim/vimapi/nova/OperateServers.py
@@ -75,9 +75,20 @@ class OperateServers(OperateNova):
if volumes:
if not req.get('block_device_mapping_v2'):
req['block_device_mapping_v2'] = []
+ if 'imageRef' in req:
+ req['block_device_mapping_v2'].append(
+ {
+ 'boot_index': 0,
+ 'uuid': req['imageRef'],
+ 'source_type': 'image',
+ 'destination_type': 'local',
+ 'delete_on_termination': True
+ }
+ )
for vol in volumes:
req['block_device_mapping_v2'].append(
{
+ 'boot_index': -1,
'uuid': vol["volumeId"],
'source_type': 'volume',
'destination_type': 'volume',