mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 02:53:18 +01:00
Fix seeding template issue after PR merging
This commit is contained in:
parent
f825a94dc4
commit
f53f11b010
@ -651,25 +651,22 @@ public class VmwareStorageProcessor implements StorageProcessor {
|
|||||||
VirtualMachineMO templateMo = VmwareHelper.pickOneVmOnRunningHost(dcMo.findVmByNameAndLabel(templateUuidName), true);
|
VirtualMachineMO templateMo = VmwareHelper.pickOneVmOnRunningHost(dcMo.findVmByNameAndLabel(templateUuidName), true);
|
||||||
Pair<VirtualMachineMO, Long> vmInfo = null;
|
Pair<VirtualMachineMO, Long> vmInfo = null;
|
||||||
|
|
||||||
|
final ManagedObjectReference morDs;
|
||||||
|
if (managed) {
|
||||||
|
morDs = prepareManagedDatastore(context, hyperHost, null, managedStoragePoolName, storageHost, storagePort,
|
||||||
|
chapInitiatorUsername, chapInitiatorSecret, chapTargetUsername, chapTargetSecret);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, storageUuid);
|
||||||
|
}
|
||||||
|
assert (morDs != null);
|
||||||
|
dsMo = new DatastoreMO(context, morDs);
|
||||||
|
|
||||||
if (templateMo == null) {
|
if (templateMo == null) {
|
||||||
if (s_logger.isInfoEnabled()) {
|
if (s_logger.isInfoEnabled()) {
|
||||||
s_logger.info("Template " + templateInfo.second() + " is not setup yet. Set up template from secondary storage with uuid name: " + templateUuidName);
|
s_logger.info("Template " + templateInfo.second() + " is not setup yet. Set up template from secondary storage with uuid name: " + templateUuidName);
|
||||||
}
|
}
|
||||||
|
|
||||||
final ManagedObjectReference morDs;
|
|
||||||
|
|
||||||
if (managed) {
|
|
||||||
morDs = prepareManagedDatastore(context, hyperHost, null, managedStoragePoolName, storageHost, storagePort,
|
|
||||||
chapInitiatorUsername, chapInitiatorSecret, chapTargetUsername, chapTargetSecret);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, storageUuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
assert (morDs != null);
|
|
||||||
|
|
||||||
dsMo = new DatastoreMO(context, morDs);
|
|
||||||
|
|
||||||
if (managed) {
|
if (managed) {
|
||||||
vmInfo = copyTemplateFromSecondaryToPrimary(hyperHost, dsMo, secondaryStorageUrl, templateInfo.first(), templateInfo.second(),
|
vmInfo = copyTemplateFromSecondaryToPrimary(hyperHost, dsMo, secondaryStorageUrl, templateInfo.first(), templateInfo.second(),
|
||||||
managedStoragePoolRootVolumeName, false, _nfsVersion, configurationId);
|
managedStoragePoolRootVolumeName, false, _nfsVersion, configurationId);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user