You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by li...@apache.org on 2014/07/22 08:40:40 UTC

git commit: updated refs/heads/master to b3e4c6d

Repository: cloudstack
Updated Branches:
  refs/heads/master 4596ae9aa -> b3e4c6d6d


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>'.


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

Branch: refs/heads/master
Commit: b3e4c6d6dc9bf57aa880ab100a76027b2a12053d
Parents: 4596ae9
Author: Likitha Shetty <li...@citrix.com>
Authored: Tue Jul 22 09:48:20 2014 +0530
Committer: Likitha Shetty <li...@citrix.com>
Committed: Tue Jul 22 11:59:53 2014 +0530

----------------------------------------------------------------------
 .../src/com/cloud/hypervisor/vmware/resource/VmwareResource.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3e4c6d6/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 7b73b19..0c4ab20 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
@@ -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();