From 645219b86b1a92a62ee1ffd4cd1e5dff0473fbb3 Mon Sep 17 00:00:00 2001 From: xinhuili Date: Sun, 26 Mar 2017 18:36:41 -0700 Subject: This pacth fix volume problem This patch is to fix volume problem. Change-Id: I3739cadd23bd7d7f97a038abaa259269abce30bf Issue-ids: MULTIVIM-36 Signed-off-by: xinhuili --- vio/vio/pub/vim/vimapi/nova/OperateServers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'vio') 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', -- cgit 1.2.3-korg