mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Send AttachVolume command even if VM is not in running state under vmware case
This commit is contained in:
parent
dd9b1634f7
commit
23f274cfd2
@ -543,6 +543,13 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, VirtualM
|
||||
boolean sendCommand = (vm.getState() == State.Running);
|
||||
AttachVolumeAnswer answer = null;
|
||||
Long hostId = vm.getHostId();
|
||||
if(hostId == null) {
|
||||
hostId = vm.getLastHostId();
|
||||
HostVO host = _hostDao.findById(hostId);
|
||||
if(host != null && host.getHypervisorType() == HypervisorType.VmWare)
|
||||
sendCommand = true;
|
||||
}
|
||||
|
||||
if (sendCommand) {
|
||||
StoragePoolVO volumePool = _storagePoolDao.findById(volume.getPoolId());
|
||||
AttachVolumeCommand cmd = new AttachVolumeCommand(true, vm.getInstanceName(), volume.getPoolType(), volume.getFolder(), volume.getPath(), volume.getName(), deviceId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user