Search in sources :

Example 11 with PrimaryStorageDownloadAnswer

use of com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer in project cloudstack by apache.

the class VmwareResource method execute.

@Override
public PrimaryStorageDownloadAnswer execute(PrimaryStorageDownloadCommand cmd) {
    if (s_logger.isInfoEnabled()) {
        s_logger.info("Executing resource PrimaryStorageDownloadCommand: " + _gson.toJson(cmd));
    }
    try {
        VmwareContext context = getServiceContext();
        VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
        return (PrimaryStorageDownloadAnswer) mgr.getStorageManager().execute(this, cmd);
    } catch (Throwable e) {
        if (e instanceof RemoteException) {
            s_logger.warn("Encounter remote exception to vCenter, invalidate VMware session context");
            invalidateServiceContext();
        }
        String msg = "PrimaryStorageDownloadCommand failed due to " + VmwareHelper.getExceptionMessage(e);
        s_logger.error(msg, e);
        return new PrimaryStorageDownloadAnswer(msg);
    }
}
Also used : VmwareContext(com.cloud.hypervisor.vmware.util.VmwareContext) PrimaryStorageDownloadAnswer(com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer) VmwareManager(com.cloud.hypervisor.vmware.manager.VmwareManager) RemoteException(java.rmi.RemoteException)

Aggregations

PrimaryStorageDownloadAnswer (com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer)11 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)6 ConfigurationException (javax.naming.ConfigurationException)4 URISyntaxException (java.net.URISyntaxException)3 VmwareContext (com.cloud.hypervisor.vmware.util.VmwareContext)2 MockStoragePoolVO (com.cloud.simulator.MockStoragePoolVO)2 MockVolumeVO (com.cloud.simulator.MockVolumeVO)2 IOException (java.io.IOException)2 URI (java.net.URI)2 RemoteException (java.rmi.RemoteException)2 XmlRpcException (org.apache.xmlrpc.XmlRpcException)2 RadosException (com.ceph.rados.exceptions.RadosException)1 RbdException (com.ceph.rbd.RbdException)1 DataStoreTO (com.cloud.agent.api.to.DataStoreTO)1 DataTO (com.cloud.agent.api.to.DataTO)1 NfsTO (com.cloud.agent.api.to.NfsTO)1 KVMPhysicalDisk (com.cloud.agent.storage.KVMPhysicalDisk)1 KVMStoragePool (com.cloud.agent.storage.KVMStoragePool)1 InternalErrorException (com.cloud.exception.InternalErrorException)1 KVMPhysicalDisk (com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk)1