Repository: cloudstack Updated Branches: refs/heads/master 74fe010db -> c9b22af6c
kvm: Add more log lines around storage pool operations Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c9b22af6 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c9b22af6 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c9b22af6 Branch: refs/heads/master Commit: c9b22af6c7c9c7560cbe1724e5feb58b35ff2a8c Parents: 74fe010 Author: Wido den Hollander <[email protected]> Authored: Thu Apr 17 17:42:17 2014 +0200 Committer: Wido den Hollander <[email protected]> Committed: Thu Apr 17 17:42:17 2014 +0200 ---------------------------------------------------------------------- .../kvm/storage/LibvirtStorageAdaptor.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c9b22af6/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java index fb35d45..3c0dd94 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java @@ -338,12 +338,14 @@ public class LibvirtStorageAdaptor implements StorageAdaptor { @Override public KVMStoragePool getStoragePool(String uuid) { + s_logger.debug("Trying to fetch storage pool " + uuid + " from libvirt"); StoragePool storage = null; try { Connect conn = LibvirtConnection.getConnection(); storage = conn.storagePoolLookupByUUIDString(uuid); if (storage.getInfo().state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { + s_logger.debug("Storage pool " + uuid + " was not found in libvirt. Attempting to create it"); storage.create(0); } LibvirtStoragePoolDef spd = getStoragePoolDef(conn, storage); @@ -437,6 +439,8 @@ public class LibvirtStorageAdaptor implements StorageAdaptor { @Override public KVMStoragePool createStoragePool(String name, String host, int port, String path, String userInfo, StoragePoolType type) { + s_logger.info("Attempting to create storage pool " + name + " (" + type.toString() + ") in libvirt"); + StoragePool sp = null; Connect conn = null; try { @@ -561,6 +565,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor { @Override public boolean deleteStoragePool(String uuid) { + s_logger.info("Attempting to remove storage pool " + uuid + " from libvirt"); Connect conn = null; try { conn = LibvirtConnection.getConnection(); @@ -574,6 +579,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor { try { sp = conn.storagePoolLookupByUUIDString(uuid); } catch (LibvirtException e) { + s_logger.debug("Storage pool " + uuid + " doesn't exist in libvirt. Assuming it is already removed"); return true; } @@ -620,6 +626,9 @@ public class LibvirtStorageAdaptor implements StorageAdaptor { public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, PhysicalDiskFormat format, Storage.ProvisioningType provisioningType, long size) { + s_logger.info("Attempting to create volume " + name + " (" + pool.getType().toString() + ") in pool " + + pool.getUuid() + " with size " + size); + switch (pool.getType()){ case RBD: return createPhysicalDiskOnRBD(name, pool, format, provisioningType, size); @@ -718,6 +727,9 @@ public class LibvirtStorageAdaptor implements StorageAdaptor { * To have RBD function properly we want RBD images of format 2 * libvirt currently defaults to format 1 * + * This has been fixed in libvirt 1.2.2, but that's not upstream + * in all distributions + * * For that reason we use the native RBD bindings to create the * RBD image until libvirt creates RBD format 2 by default */ @@ -800,6 +812,8 @@ public class LibvirtStorageAdaptor implements StorageAdaptor { @Override public boolean deletePhysicalDisk(String uuid, KVMStoragePool pool) { + s_logger.info("Attempting to remove volume " + uuid + " from pool " + pool.getUuid()); + /** * RBD volume can have snapshots and while they exist libvirt * can't remove the RBD volume @@ -870,6 +884,9 @@ public class LibvirtStorageAdaptor implements StorageAdaptor { public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, String name, PhysicalDiskFormat format, Storage.ProvisioningType provisioningType, long size, KVMStoragePool destPool, int timeout) { + s_logger.info("Creating volume " + name + " from template " + template.getName() + " in pool " + destPool.getUuid() + + " (" + destPool.getType().toString() + ") with size " + size); + KVMPhysicalDisk disk = null; if (destPool.getType() == StoragePoolType.RBD) {
