cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [09/50] [abbrv] git commit: updated refs/heads/vmsync to 6a1e1e8
Date Fri, 24 May 2013 01:14:33 GMT
CLOUDSTACK-2603. EC2RunInstances return xen or ovm as the response value for attribute "hypervisor"


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

Branch: refs/heads/vmsync
Commit: eb92135d55e454799a647490c501f13505325bcb
Parents: 904a2a8
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Tue May 21 15:13:18 2013 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Tue May 21 15:15:35 2013 +0530

----------------------------------------------------------------------
 .../cloud/bridge/service/core/ec2/EC2Engine.java   |   19 +++++++++++++-
 1 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/eb92135d/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java
----------------------------------------------------------------------
diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java
index 137111a..9ac2bc6 100644
--- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java
+++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java
@@ -1458,7 +1458,7 @@ public class EC2Engine extends ManagerBase {
                     vm.setIpAddress(resp.getIpAddress());
                     vm.setAccountName(resp.getAccountName());
                     vm.setDomainId(resp.getDomainId());
-                    vm.setHypervisor(resp.getHypervisor());
+                    vm.setHypervisor( mapToAmazonHypervisorType(resp.getHypervisor()) );
                     vm.setServiceOffering( svcOffering.getName());
                     vm.setKeyPairName(resp.getKeyPairName());
                     instances.addInstance(vm);
@@ -1860,7 +1860,7 @@ public class EC2Engine extends ManagerBase {
                 ec2Vm.setIpAddress(cloudVm.getIpAddress());
                 ec2Vm.setAccountName(cloudVm.getAccountName());
                 ec2Vm.setDomainId(cloudVm.getDomainId());
-                ec2Vm.setHypervisor(cloudVm.getHypervisor());
+                ec2Vm.setHypervisor( mapToAmazonHypervisorType(cloudVm.getHypervisor()) );
                 ec2Vm.setRootDeviceType(cloudVm.getRootDeviceType());
                 ec2Vm.setRootDeviceId(cloudVm.getRootDeviceId());
                 ec2Vm.setServiceOffering(serviceOfferingIdToInstanceType(cloudVm.getServiceOfferingId().toString()));
@@ -2499,6 +2499,21 @@ public class EC2Engine extends ManagerBase {
     }
 
     /**
+     * Map CloudStack hypervisor to CloudStack hypervisor
+     *
+     * @param CloudStack hypervisor
+     * @return Amazon hypervisor
+     */
+    private String mapToAmazonHypervisorType( String hypervisor) {
+        if (hypervisor.equalsIgnoreCase("Xenserver"))
+            return("xen");
+        else if(hypervisor.equalsIgnoreCase("Ovm"))
+            return("ovm");
+        else
+            return ("");
+    }
+
+    /**
      * Stop an instance
      * Wait until one specific VM has stopped
      * 


Mime
View raw message