mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7150. [VMware] Global config 'vm.instancename' is not honored.
If global config 'vm.instancename' is set to true, VM name in vCenter should be '<instance_name>-<vm_hostname>'.
This commit is contained in:
parent
4596ae9aac
commit
b3e4c6d6dc
|
|
@ -1832,7 +1832,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||
vmInternalCSName = vmSpec.getName();
|
||||
if (_instanceNameFlag == true) {
|
||||
String[] tokens = vmInternalCSName.split("-");
|
||||
vmNameOnVcenter = String.format("%s-%s-%s", tokens[0], tokens[1], vmSpec.getHostName());
|
||||
assert (tokens.length >= 3); // vmInternalCSName has format i-x-y-<instance.name>
|
||||
vmNameOnVcenter = String.format("%s-%s-%s-%s", tokens[0], tokens[1], tokens[2], vmSpec.getHostName());
|
||||
}
|
||||
else
|
||||
vmNameOnVcenter = vmSpec.getName();
|
||||
|
|
|
|||
Loading…
Reference in New Issue