cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From likit...@apache.org
Subject git commit: updated refs/heads/master to 786285a
Date Thu, 24 Jul 2014 07:51:05 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 6d1d44554 -> 786285ab5


CLOUDSTACK-7174. [VMware] Recreating System VMs fails if global config 'vm.instancename' is
set to true.
Append VM's name in vCenter with the hostname only for User VMs.


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

Branch: refs/heads/master
Commit: 786285ab54bf93a4d1cc4d0e688f91a41a1d84bb
Parents: 6d1d445
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Thu Jul 24 13:02:57 2014 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Thu Jul 24 13:05:45 2014 +0530

----------------------------------------------------------------------
 .../vmware/resource/VmwareResource.java         | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/786285ab/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 0c4ab20..6a803af 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
@@ -1826,21 +1826,13 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
 
     // Pair<internal CS name, vCenter display name>
     private Pair<String, String> composeVmNames(VirtualMachineTO vmSpec) {
-        String vmInternalCSName = null;
-        String vmNameOnVcenter = null;
-        if (vmSpec.getHostName() != null) {
-            vmInternalCSName = vmSpec.getName();
-            if (_instanceNameFlag == true) {
-                String[] tokens = vmInternalCSName.split("-");
-                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();
-        } else {
-            vmNameOnVcenter = vmInternalCSName = vmSpec.getName();
+        String vmInternalCSName = vmSpec.getName();
+        String vmNameOnVcenter = vmSpec.getName();
+        if (vmSpec.getType() == VirtualMachine.Type.User && _instanceNameFlag &&
vmSpec.getHostName() != null) {
+            String[] tokens = vmInternalCSName.split("-");
+            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());
         }
-
         return new Pair<String, String>(vmInternalCSName, vmNameOnVcenter);
     }
 


Mime
View raw message