rp.getName(),
host.getName(),
datastore.getName()));
OvfCreateImportSpecResult ovfImportResult = null;
HttpNfcLease httpNfcLease = null;
/* create import spec */
ovfImportResult =
conn_.getServiceInstance().getOvfManager().createImportSpec
(ovfDescriptor, rp, datastore, importSpecParams);
/* import execution */
try {
httpNfcLease =
rp.importVApp(ovfImportResult.getImportSpec(), vmFolder, host);
} catch (Exception e) {
logger_.warning("importVapp failed.");
throw e;
}
String morefOfNewVm = null;
/* wait nfc lease */
HttpNfcLeaseState hls;
while (true) {
hls = httpNfcLease.getState();
if (hls == HttpNfcLeaseState.ready ||
hls == HttpNfcLeaseState.error) { break; }
}
if (hls == HttpNfcLeaseState.ready) {
morefOfNewVm = httpNfcLease.getInfo().getEntity().getVal();
logger_.info
(String.format
("Moref of the created vm: %s\n", morefOfNewVm));
httpNfcLease.httpNfcLeaseComplete();
/*
We do not upload disk files, because the specified ovf
must not contain disk information.
*/
} else {