Search in sources :

Example 46 with KvmStoragePool

use of com.cloud.agent.resource.kvm.storage.KvmStoragePool in project cosmic by MissionCriticalCloud.

the class LibvirtModifyStoragePoolCommandWrapper method execute.

@Override
public Answer execute(final ModifyStoragePoolCommand command, final LibvirtComputingResource libvirtComputingResource) {
    final KvmStoragePoolManager storagePoolMgr = libvirtComputingResource.getStoragePoolMgr();
    final KvmStoragePool storagepool = storagePoolMgr.createStoragePool(command.getPool().getUuid(), command.getPool().getHost(), command.getPool().getPort(), command.getPool().getPath(), command.getPool().getUserInfo(), command.getPool().getType());
    if (storagepool == null) {
        return new Answer(command, false, " Failed to create storage pool");
    }
    final Map<String, TemplateProp> tInfo = new HashMap<>();
    final ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(command, storagepool.getCapacity(), storagepool.getAvailable(), tInfo);
    return answer;
}
Also used : TemplateProp(com.cloud.legacymodel.storage.TemplateProp) Answer(com.cloud.legacymodel.communication.answer.Answer) ModifyStoragePoolAnswer(com.cloud.legacymodel.communication.answer.ModifyStoragePoolAnswer) KvmStoragePool(com.cloud.agent.resource.kvm.storage.KvmStoragePool) HashMap(java.util.HashMap) ModifyStoragePoolAnswer(com.cloud.legacymodel.communication.answer.ModifyStoragePoolAnswer) KvmStoragePoolManager(com.cloud.agent.resource.kvm.storage.KvmStoragePoolManager)

Aggregations

KvmStoragePool (com.cloud.agent.resource.kvm.storage.KvmStoragePool)46 KvmStoragePoolManager (com.cloud.agent.resource.kvm.storage.KvmStoragePoolManager)41 KvmPhysicalDisk (com.cloud.agent.resource.kvm.storage.KvmPhysicalDisk)34 Answer (com.cloud.legacymodel.communication.answer.Answer)31 LibvirtRequestWrapper (com.cloud.agent.resource.kvm.wrapper.LibvirtRequestWrapper)28 Test (org.junit.Test)28 AttachAnswer (com.cloud.legacymodel.communication.answer.AttachAnswer)27 CheckRouterAnswer (com.cloud.legacymodel.communication.answer.CheckRouterAnswer)27 NfsStoragePool (com.cloud.agent.resource.kvm.ha.KvmHaBase.NfsStoragePool)20 StoragePool (com.cloud.legacymodel.storage.StoragePool)20 StorageFilerTO (com.cloud.legacymodel.to.StorageFilerTO)17 CloudRuntimeException (com.cloud.legacymodel.exceptions.CloudRuntimeException)15 LibvirtUtilitiesHelper (com.cloud.agent.resource.kvm.wrapper.LibvirtUtilitiesHelper)12 Processor (com.cloud.common.storageprocessor.Processor)6 TemplateLocation (com.cloud.common.storageprocessor.TemplateLocation)6 InternalErrorException (com.cloud.legacymodel.exceptions.InternalErrorException)6 StorageLayer (com.cloud.utils.storage.StorageLayer)6 ConfigurationException (javax.naming.ConfigurationException)6 LibvirtException (org.libvirt.LibvirtException)6 TemplateFormatInfo (com.cloud.legacymodel.storage.TemplateFormatInfo)5