diff options
author | xinhuili <lxinhui@vmware.com> | 2017-03-26 18:36:41 -0700 |
---|---|---|
committer | xinhuili <lxinhui@vmware.com> | 2017-03-26 18:36:41 -0700 |
commit | 645219b86b1a92a62ee1ffd4cd1e5dff0473fbb3 (patch) | |
tree | c8d9eec9416f73c0f52cf0e9713e0dc48605fc48 /vio | |
parent | 22ce175d1479837c3ece813df4c1f1f2a4395a50 (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>
Diffstat (limited to 'vio')
-rw-r--r-- | vio/vio/pub/vim/vimapi/nova/OperateServers.py | 11 |
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', |