public ModifyStoragePoolAnswer(ModifyStoragePoolCommand cmd, long capacityBytes, long availableBytes, Map<String, TemplateProp> tInfo) { super(cmd); result = true; poolInfo = new StoragePoolInfo(null, cmd.getPool().getHost(), cmd.getPool().getPath(), cmd.getLocalPath(), cmd.getPool().getType(), capacityBytes, availableBytes); templateInfo = tInfo; }
@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<String, TemplateProp>(); final ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(command, storagepool.getCapacity(), storagepool.getAvailable(), tInfo); return answer; } }
protected Answer execute(ModifyStoragePoolCommand cmd) { StorageFilerTO pool = cmd.getPool(); try { if (pool.getType() == StoragePoolType.NetworkFilesystem) { createNfsSr(pool); } else if (pool.getType() == StoragePoolType.OCFS2) { createOCFS2Sr(pool); } else { return new Answer(cmd, false, "The pool type: " + pool.getType().name() + " is not supported."); } setupHeartBeat(pool.getUuid()); OvmStoragePool.Details d = OvmStoragePool.getDetailsByUuid(_conn, pool.getUuid()); Map<String, TemplateProp> tInfo = new HashMap<String, TemplateProp>(); ModifyStoragePoolAnswer answer = new ModifyStoragePoolAnswer(cmd, d.totalSpace, d.freeSpace, tInfo); return answer; } catch (Exception e) { s_logger.debug("ModifyStoragePoolCommand failed", e); return new Answer(cmd, false, e.getMessage()); } }
StorageFilerTO pool = cmd.getPool(); LOGGER.debug("modifying pool " + pool); try {
@Override public Answer execute(final ModifyStoragePoolCommand command, final CitrixResourceBase citrixResourceBase) { final Connection conn = citrixResourceBase.getConnection(); final StorageFilerTO pool = command.getPool(); final boolean add = command.getAdd(); if (add) {