use of com.cloud.agent.resource.kvm.xml.LibvirtStoragePoolDef in project cosmic by MissionCriticalCloud.
the class LibvirtStorageAdaptor method createLVMStoragePool.
private StoragePool createLVMStoragePool(final Connect conn, final String uuid, final String path) {
final LibvirtStoragePoolDef libvirtStoragePoolDef = new LibvirtStoragePoolDef();
libvirtStoragePoolDef.setPoolName(uuid);
libvirtStoragePoolDef.setUuid(uuid);
libvirtStoragePoolDef.setTargetPath("/dev/" + path);
libvirtStoragePoolDef.setSource(path);
libvirtStoragePoolDef.setPoolType(PoolType.LOGICAL);
try {
this.logger.debug(libvirtStoragePoolDef.toString());
return conn.storagePoolCreateXML(libvirtStoragePoolDef.toString(), 0);
} catch (final LibvirtException e) {
this.logger.error("Unable to add LVM storage pool: ", e);
return null;
}
}
Aggregations