CLOUDSTACK-5873: [Automation] Failed to attach volume to VM, if the vm is created with option startvm=false

(cherry picked from commit 0679af3434)

Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
This commit is contained in:
Mike Tutkowski 2014-01-22 11:08:34 -07:00 committed by Animesh Chaturvedi
parent c14941edf8
commit 7125ac7382
1 changed files with 7 additions and 0 deletions

View File

@ -1121,6 +1121,13 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
VolumeVO volume = _volsDao.findById(volumeId);
disk.setPath(volume.get_iScsiName());
if (disk.getData() instanceof VolumeObjectTO) {
VolumeObjectTO volTo = (VolumeObjectTO)disk.getData();
volTo.setPath(volume.get_iScsiName());
}
volume.setPath(volume.get_iScsiName());
_volsDao.update(volumeId, volume);