mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Implement CreateVolume/AttachVolue for vmware
This commit is contained in:
parent
2337a9d99f
commit
86d59bdddd
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user