Skip to content

Commit

Permalink
Linstor/StorageAdaptor: Improve debug/error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
rp- committed Oct 19, 2023
1 parent 70e0577 commit 0a07dbb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ private void makeResourceAvailable(DevelopersApi api, String rscName, boolean di
public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, QemuImg.PhysicalDiskFormat format,
Storage.ProvisioningType provisioningType, long size, byte[] passphrase)
{
s_logger.debug("Linstor.createPhysicalDisk: " + name + ";" + format);
final String rscName = getLinstorRscName(name);
LinstorStoragePool lpool = (LinstorStoragePool) pool;
final DevelopersApi api = getLinstorAPI(pool);
Expand Down Expand Up @@ -255,6 +256,7 @@ public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, Qemu
throw new CloudRuntimeException("Linstor: viewResources didn't return resources or volumes.");
}
} catch (ApiException apiEx) {
s_logger.error("Linstor.createPhysicalDisk: ApiException: " + apiEx.getBestMessage());
throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);
}
}
Expand Down Expand Up @@ -425,7 +427,7 @@ public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, KVMSt
@Override
public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, KVMStoragePool destPools, int timeout, byte[] srcPassphrase, byte[] destPassphrase, Storage.ProvisioningType provisioningType)
{
s_logger.debug("Linstor: copyPhysicalDisk");
s_logger.debug("Linstor.copyPhysicalDisk: " + disk.getPath() + " -> " + name);
final QemuImg.PhysicalDiskFormat sourceFormat = disk.getFormat();
final String sourcePath = disk.getPath();

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

s_logger.debug("Linstor.copyPhysicalDisk: dstPath: " + dstDisk.getPath());
final QemuImgFile destFile = new QemuImgFile(dstDisk.getPath());
destFile.setFormat(dstDisk.getFormat());
destFile.setSize(disk.getVirtualSize());
Expand Down

0 comments on commit 0a07dbb

Please sign in to comment.