mirror of https://github.com/apache/cloudstack.git
When instance.name.flag is set to true, append user-supplied name with legacy prefix to VM name appears in vCenter.
This commit is contained in:
parent
4f0640dac4
commit
5143fe404b
|
|
@ -1829,8 +1829,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||
String vmNameOnVcenter = null;
|
||||
if (vmSpec.getHostName() != null) {
|
||||
vmInternalCSName = vmSpec.getName();
|
||||
if (_instanceNameFlag == true)
|
||||
vmNameOnVcenter = vmSpec.getHostName();
|
||||
if (_instanceNameFlag == true) {
|
||||
String[] tokens = vmInternalCSName.split("-");
|
||||
vmNameOnVcenter = String.format("%s-%s-%s", tokens[0], tokens[1], vmSpec.getHostName());
|
||||
}
|
||||
else
|
||||
vmNameOnVcenter = vmSpec.getName();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue