Skip to content

Commit ec5ab15

Browse files
committed
Linstor/StorageAdaptor: Improve debug/error logging
1 parent 4e11e95 commit ec5ab15

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ private void makeResourceAvailable(DevelopersApi api, String rscName, boolean di
215215
public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, QemuImg.PhysicalDiskFormat format,
216216
Storage.ProvisioningType provisioningType, long size, byte[] passphrase)
217217
{
218+
s_logger.debug(String.format("Linstor.createPhysicalDisk: %s;%s", name, format));
218219
final String rscName = getLinstorRscName(name);
219220
LinstorStoragePool lpool = (LinstorStoragePool) pool;
220221
final DevelopersApi api = getLinstorAPI(pool);
@@ -255,6 +256,7 @@ public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, Qemu
255256
throw new CloudRuntimeException("Linstor: viewResources didn't return resources or volumes.");
256257
}
257258
} catch (ApiException apiEx) {
259+
s_logger.error(String.format("Linstor.createPhysicalDisk: ApiException: %s", apiEx.getBestMessage()));
258260
throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);
259261
}
260262
}
@@ -425,7 +427,7 @@ public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, KVMSt
425427
@Override
426428
public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, KVMStoragePool destPools, int timeout, byte[] srcPassphrase, byte[] destPassphrase, Storage.ProvisioningType provisioningType)
427429
{
428-
s_logger.debug("Linstor: copyPhysicalDisk");
430+
s_logger.debug(String.format("Linstor.copyPhysicalDisk: %s -> %s", disk.getPath(), name));
429431
final QemuImg.PhysicalDiskFormat sourceFormat = disk.getFormat();
430432
final String sourcePath = disk.getPath();
431433

@@ -434,6 +436,7 @@ public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, KVMSt
434436
final KVMPhysicalDisk dstDisk = destPools.createPhysicalDisk(
435437
name, QemuImg.PhysicalDiskFormat.RAW, provisioningType, disk.getVirtualSize(), null);
436438

439+
s_logger.debug(String.format("Linstor.copyPhysicalDisk: dstPath: %s", dstDisk.getPath()));
437440
final QemuImgFile destFile = new QemuImgFile(dstDisk.getPath());
438441
destFile.setFormat(dstDisk.getFormat());
439442
destFile.setSize(disk.getVirtualSize());

0 commit comments

Comments
 (0)