diff --git a/core/src/com/cloud/agent/api/AttachVolumeCommand.java b/core/src/com/cloud/agent/api/AttachVolumeCommand.java index ca07733a91e..0ac47dd7e2e 100644 --- a/core/src/com/cloud/agent/api/AttachVolumeCommand.java +++ b/core/src/com/cloud/agent/api/AttachVolumeCommand.java @@ -25,6 +25,7 @@ public class AttachVolumeCommand extends Command { boolean attach; String vmName; StoragePoolType pooltype; + String poolUuid; String volumeFolder; String volumePath; String volumeName; @@ -83,5 +84,12 @@ public class AttachVolumeCommand extends Command { public void setDeviceId(Long deviceId) { this.deviceId = deviceId; } - + + public String getPoolUuid() { + return poolUuid; + } + + public void setPoolUuid(String poolUuid) { + this.poolUuid = poolUuid; + } } diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 83d3c85d3a4..20770994d9a 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -387,7 +387,9 @@ public class UserVmManagerImpl implements UserVmManager { AttachVolumeAnswer answer = null; Long hostId = vm.getHostId(); if (sendCommand) { + StoragePoolVO volumePool = _storagePoolDao.findById(volume.getPoolId()); AttachVolumeCommand cmd = new AttachVolumeCommand(true, vm.getInstanceName(), volume.getPoolType(), volume.getFolder(), volume.getPath(), volume.getName(), deviceId); + cmd.setPoolUuid(volumePool.getUuid()); try { answer = (AttachVolumeAnswer)_agentMgr.send(hostId, cmd); @@ -481,6 +483,8 @@ public class UserVmManagerImpl implements UserVmManager { if (sendCommand) { AttachVolumeCommand cmd = new AttachVolumeCommand(false, vm.getInstanceName(), volume.getPoolType(), volume.getFolder(), volume.getPath(), volume.getName(), deviceId!=0 ? deviceId : volume.getDeviceId()); + StoragePoolVO volumePool = _storagePoolDao.findById(volume.getPoolId()); + cmd.setPoolUuid(volumePool.getUuid()); try { answer = _agentMgr.send(vm.getHostId(), cmd);