cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject git commit: updated refs/heads/master to 5143fe4
Date Mon, 14 Jul 2014 21:54:43 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 4f0640dac -> 5143fe404


When instance.name.flag is set to true, append user-supplied name with legacy prefix to VM
name appears in vCenter.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5143fe40
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5143fe40
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5143fe40

Branch: refs/heads/master
Commit: 5143fe404bc82dfe42b832c661b4e98a0d9ebfa8
Parents: 4f0640d
Author: Kelven Yang <kelveny@gmail.com>
Authored: Mon Jul 14 14:45:21 2014 -0700
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Mon Jul 14 14:53:51 2014 -0700

----------------------------------------------------------------------
 .../com/cloud/hypervisor/vmware/resource/VmwareResource.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5143fe40/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 15eeb13..f1f307b 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -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 {


Mime
View raw message