mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
create volume command needs to send to vmwareresource
This commit is contained in:
parent
90de46c4fe
commit
36146e7f65
@ -42,6 +42,9 @@ import com.cloud.agent.api.storage.CopyVolumeCommand;
|
|||||||
import com.cloud.agent.api.storage.CreateVolumeOVACommand;
|
import com.cloud.agent.api.storage.CreateVolumeOVACommand;
|
||||||
import com.cloud.agent.api.storage.PrepareOVAPackingCommand;
|
import com.cloud.agent.api.storage.PrepareOVAPackingCommand;
|
||||||
import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
|
import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
|
||||||
|
import com.cloud.agent.api.to.DataObjectType;
|
||||||
|
import com.cloud.agent.api.to.DataStoreTO;
|
||||||
|
import com.cloud.agent.api.to.DataTO;
|
||||||
import com.cloud.agent.api.to.NicTO;
|
import com.cloud.agent.api.to.NicTO;
|
||||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||||
import com.cloud.cluster.ClusterManager;
|
import com.cloud.cluster.ClusterManager;
|
||||||
@ -64,6 +67,7 @@ import com.cloud.network.dao.NetworkDao;
|
|||||||
import com.cloud.network.dao.NetworkVO;
|
import com.cloud.network.dao.NetworkVO;
|
||||||
import com.cloud.secstorage.CommandExecLogDao;
|
import com.cloud.secstorage.CommandExecLogDao;
|
||||||
import com.cloud.secstorage.CommandExecLogVO;
|
import com.cloud.secstorage.CommandExecLogVO;
|
||||||
|
import com.cloud.storage.DataStoreRole;
|
||||||
import com.cloud.storage.GuestOSVO;
|
import com.cloud.storage.GuestOSVO;
|
||||||
import com.cloud.storage.dao.GuestOSDao;
|
import com.cloud.storage.dao.GuestOSDao;
|
||||||
import com.cloud.storage.secondary.SecondaryStorageVmManager;
|
import com.cloud.storage.secondary.SecondaryStorageVmManager;
|
||||||
@ -289,7 +293,23 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru {
|
|||||||
cmd instanceof PrepareOVAPackingCommand ||
|
cmd instanceof PrepareOVAPackingCommand ||
|
||||||
cmd instanceof CreateVolumeFromSnapshotCommand ||
|
cmd instanceof CreateVolumeFromSnapshotCommand ||
|
||||||
cmd instanceof CopyCommand) {
|
cmd instanceof CopyCommand) {
|
||||||
needDelegation = true;
|
if (cmd instanceof CopyCommand) {
|
||||||
|
CopyCommand cpyCommand = (CopyCommand)cmd;
|
||||||
|
DataTO srcData = cpyCommand.getSrcTO();
|
||||||
|
DataStoreTO srcStoreTO = srcData.getDataStore();
|
||||||
|
DataTO destData = cpyCommand.getDestTO();
|
||||||
|
DataStoreTO destStoreTO = destData.getDataStore();
|
||||||
|
|
||||||
|
if (destData.getObjectType() == DataObjectType.VOLUME && destStoreTO.getRole() == DataStoreRole.Primary &&
|
||||||
|
srcData.getObjectType() == DataObjectType.TEMPLATE && srcStoreTO.getRole() == DataStoreRole.Primary) {
|
||||||
|
needDelegation = false;
|
||||||
|
} else {
|
||||||
|
needDelegation = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
needDelegation = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/* Fang: remove this before checking in */
|
/* Fang: remove this before checking in */
|
||||||
// needDelegation = false;
|
// needDelegation = false;
|
||||||
|
|||||||
@ -321,7 +321,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
|
|||||||
GetStorageStatsCommand command = new GetStorageStatsCommand(pool.getUuid(), pool.getPoolType(), pool.getPath());
|
GetStorageStatsCommand command = new GetStorageStatsCommand(pool.getUuid(), pool.getPoolType(), pool.getPath());
|
||||||
long poolId = pool.getId();
|
long poolId = pool.getId();
|
||||||
try {
|
try {
|
||||||
Answer answer = _storageManager.sendToPool(pool.getId(), command);
|
Answer answer = _storageManager.sendToPool(pool, command);
|
||||||
if (answer != null && answer.getResult()) {
|
if (answer != null && answer.getResult()) {
|
||||||
storagePoolStats.put(pool.getId(), (StorageStats)answer);
|
storagePoolStats.put(pool.getId(), (StorageStats)answer);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user