Skip to content

Commit 83fd30d

Browse files
committed
Add source VM name prefix on more conversion logs
1 parent e194ba9 commit 83fd30d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtConvertInstanceCommandWrapper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public Answer execute(ConvertInstanceCommand cmd, LibvirtComputingResource serve
9898
ovfTemplateDirOnConversionLocation = UUID.randomUUID().toString();
9999
temporaryStoragePool.createFolder(ovfTemplateDirOnConversionLocation);
100100
sourceOVFDirPath = String.format("%s/%s/", temporaryConvertPath, ovfTemplateDirOnConversionLocation);
101-
ovfExported = exportOVAFromVMOnVcenter(exportInstanceOVAUrl, sourceOVFDirPath, noOfThreads, timeout);
101+
ovfExported = exportOVAFromVMOnVcenter(exportInstanceOVAUrl, sourceOVFDirPath, noOfThreads, sourceInstanceName, timeout);
102102
if (!ovfExported) {
103103
String err = String.format("Export OVA for the VM %s failed", sourceInstanceName);
104104
logger.error(err);
@@ -137,11 +137,11 @@ public Answer execute(ConvertInstanceCommand cmd, LibvirtComputingResource serve
137137
} finally {
138138
if (ovfExported && StringUtils.isNotBlank(ovfTemplateDirOnConversionLocation)) {
139139
String sourceOVFDir = String.format("%s/%s", temporaryConvertPath, ovfTemplateDirOnConversionLocation);
140-
logger.debug("Cleaning up exported OVA at dir " + sourceOVFDir);
140+
logger.debug("({}) Cleaning up exported OVA at dir: {}", sourceInstanceName, sourceOVFDir);
141141
FileUtil.deletePath(sourceOVFDir);
142142
}
143143
if (cleanupSecondaryStorage && conversionTemporaryLocation instanceof NfsTO) {
144-
logger.debug("Cleaning up secondary storage temporary location");
144+
logger.debug("({}) Cleaning up secondary storage temporary location", sourceInstanceName);
145145
storagePoolMgr.deleteStoragePool(temporaryStoragePool.getType(), temporaryStoragePool.getUuid());
146146
}
147147
}
@@ -201,7 +201,7 @@ protected void sanitizeDisksPath(List<LibvirtVMDef.DiskDef> disks) {
201201
private boolean exportOVAFromVMOnVcenter(String vmExportUrl,
202202
String targetOvfDir,
203203
int noOfThreads,
204-
long timeout) {
204+
String sourceInstanceName, long timeout) {
205205
Script script = new Script("ovftool", timeout, logger);
206206
script.add("--noSSLVerify");
207207
if (noOfThreads > 1) {
@@ -210,7 +210,7 @@ private boolean exportOVAFromVMOnVcenter(String vmExportUrl,
210210
script.add(vmExportUrl);
211211
script.add(targetOvfDir);
212212

213-
String logPrefix = "export ovf";
213+
String logPrefix = String.format("(%s) export ovf", sourceInstanceName);
214214
OutputInterpreter.LineByLineOutputLogger outputLogger = new OutputInterpreter.LineByLineOutputLogger(logger, logPrefix);
215215
script.execute(outputLogger);
216216
int exitValue = script.getExitValue();

0 commit comments

Comments
 (0)