Search in sources :

Example 1 with IntroduceObjectAnswer

use of com.cloud.storage.command.IntroduceObjectAnswer in project cosmic by MissionCriticalCloud.

the class XenServerStorageProcessor method introduceObject.

@Override
public Answer introduceObject(final IntroduceObjectCmd cmd) {
    try {
        final Connection conn = hypervisorResource.getConnection();
        final DataStoreTO store = cmd.getDataTO().getDataStore();
        final SR poolSr = hypervisorResource.getStorageRepository(conn, store.getUuid());
        poolSr.scan(conn);
        return new IntroduceObjectAnswer(cmd.getDataTO());
    } catch (final Exception e) {
        s_logger.debug("Failed to introduce object", e);
        return new Answer(cmd, false, e.toString());
    }
}
Also used : CreateObjectAnswer(com.cloud.storage.command.CreateObjectAnswer) IntroduceObjectAnswer(com.cloud.storage.command.IntroduceObjectAnswer) Answer(com.cloud.agent.api.Answer) SnapshotAndCopyAnswer(com.cloud.storage.command.SnapshotAndCopyAnswer) AttachPrimaryDataStoreAnswer(com.cloud.storage.command.AttachPrimaryDataStoreAnswer) DettachAnswer(com.cloud.storage.command.DettachAnswer) CopyCmdAnswer(com.cloud.storage.command.CopyCmdAnswer) AttachAnswer(com.cloud.storage.command.AttachAnswer) PrimaryDataStoreTO(com.cloud.storage.to.PrimaryDataStoreTO) DataStoreTO(com.cloud.agent.api.to.DataStoreTO) Connection(com.xensource.xenapi.Connection) IntroduceObjectAnswer(com.cloud.storage.command.IntroduceObjectAnswer) XenAPIException(com.xensource.xenapi.Types.XenAPIException) InternalErrorException(com.cloud.exception.InternalErrorException) XmlRpcException(org.apache.xmlrpc.XmlRpcException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) SR(com.xensource.xenapi.SR)

Example 2 with IntroduceObjectAnswer

use of com.cloud.storage.command.IntroduceObjectAnswer in project cosmic by MissionCriticalCloud.

the class XenServerStorageProcessor method forgetObject.

@Override
public Answer forgetObject(final ForgetObjectCmd cmd) {
    try {
        final Connection conn = hypervisorResource.getConnection();
        final DataTO data = cmd.getDataTO();
        final VDI vdi = VDI.getByUuid(conn, data.getPath());
        vdi.forget(conn);
        return new IntroduceObjectAnswer(cmd.getDataTO());
    } catch (final Exception e) {
        s_logger.debug("Failed to introduce object", e);
        return new Answer(cmd, false, e.toString());
    }
}
Also used : CreateObjectAnswer(com.cloud.storage.command.CreateObjectAnswer) IntroduceObjectAnswer(com.cloud.storage.command.IntroduceObjectAnswer) Answer(com.cloud.agent.api.Answer) SnapshotAndCopyAnswer(com.cloud.storage.command.SnapshotAndCopyAnswer) AttachPrimaryDataStoreAnswer(com.cloud.storage.command.AttachPrimaryDataStoreAnswer) DettachAnswer(com.cloud.storage.command.DettachAnswer) CopyCmdAnswer(com.cloud.storage.command.CopyCmdAnswer) AttachAnswer(com.cloud.storage.command.AttachAnswer) DataTO(com.cloud.agent.api.to.DataTO) Connection(com.xensource.xenapi.Connection) VDI(com.xensource.xenapi.VDI) IntroduceObjectAnswer(com.cloud.storage.command.IntroduceObjectAnswer) XenAPIException(com.xensource.xenapi.Types.XenAPIException) InternalErrorException(com.cloud.exception.InternalErrorException) XmlRpcException(org.apache.xmlrpc.XmlRpcException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException)

Aggregations

Answer (com.cloud.agent.api.Answer)2 InternalErrorException (com.cloud.exception.InternalErrorException)2 AttachAnswer (com.cloud.storage.command.AttachAnswer)2 AttachPrimaryDataStoreAnswer (com.cloud.storage.command.AttachPrimaryDataStoreAnswer)2 CopyCmdAnswer (com.cloud.storage.command.CopyCmdAnswer)2 CreateObjectAnswer (com.cloud.storage.command.CreateObjectAnswer)2 DettachAnswer (com.cloud.storage.command.DettachAnswer)2 IntroduceObjectAnswer (com.cloud.storage.command.IntroduceObjectAnswer)2 SnapshotAndCopyAnswer (com.cloud.storage.command.SnapshotAndCopyAnswer)2 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)2 Connection (com.xensource.xenapi.Connection)2 XenAPIException (com.xensource.xenapi.Types.XenAPIException)2 XmlRpcException (org.apache.xmlrpc.XmlRpcException)2 DataStoreTO (com.cloud.agent.api.to.DataStoreTO)1 DataTO (com.cloud.agent.api.to.DataTO)1 PrimaryDataStoreTO (com.cloud.storage.to.PrimaryDataStoreTO)1 SR (com.xensource.xenapi.SR)1 VDI (com.xensource.xenapi.VDI)1