You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by an...@apache.org on 2014/03/05 08:52:46 UTC

[01/20] git commit: updated refs/heads/4.3 to 3297fcc

Repository: cloudstack
Updated Branches:
  refs/heads/4.3 9d6ba8e40 -> 3297fccea


BUG-ID: CS-19152
[upgrade] Baremetal 4.2.0 -> 4.3. After upgrade, destroy baremetal instance fail

BUG-ID: CS-19150
[upgrade] Baremetal 4.2.0 -> 4.3. After upgrade, unable to start baremetal instance

BUG-ID: CS-19149
[upgrade] Baremetal 4.2.0 -> 4.3. After upgrade, baremetal host remain in Disconnected state. But instance associated with baremetal host is running.

BUG-ID: CS-19151
[upgrade] Baremetal 4.2.0 -> 4.3. After upgrade, unable to reboot baremetal instance

BUG-ID: CS-19156
[upgrade] Baremetal 4.2.0 -> 4.3. After upgrade, unable to stop baremetal instance

reviewed-by: edison
(cherry picked from commit 3787579d2910f4882c4b2763d610293fcbc03e61)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: 26002ae69cbf17e00dc406b86f0f4fa52519ac58
Parents: 9d6ba8e
Author: Frank.Zhang <fr...@citrix.com>
Authored: Thu Feb 20 14:23:41 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:36:17 2014 -0800

----------------------------------------------------------------------
 .../baremetal/manager/BareMetalDiscoverer.java  |  4 ++++
 .../networkservice/BareMetalResourceBase.java   | 10 ++++----
 .../networkservice/BaremetalPxeManagerImpl.java |  4 ++--
 .../deploy/DeploymentPlanningManagerImpl.java   | 24 ++++++++++++++++----
 4 files changed, 30 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26002ae6/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
index 23eecd1..1120688 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
@@ -170,6 +170,8 @@ public class BareMetalDiscoverer extends DiscovererBase implements Discoverer, R
 			params.put(ApiConstants.PRIVATE_IP, ipmiIp);
 			params.put(ApiConstants.USERNAME, username);
 			params.put(ApiConstants.PASSWORD, password);
+            params.put("vmDao", _vmDao);
+            params.put("configDao", _configDao);
 			
 			String resourceClassName = _configDao.getValue(Config.ExternalBaremetalResourceClassName.key());
 			BareMetalResourceBase resource = null;
@@ -284,6 +286,8 @@ public class BareMetalDiscoverer extends DiscovererBase implements Discoverer, R
 	    HashMap<String, Object> params = super.buildConfigParams(host);
         params.put("hostId", host.getId());
         params.put("ipaddress", host.getPrivateIpAddress());
+        params.put("vmDao", _vmDao);
+        params.put("configDao", _configDao);
         return params;
 	}
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26002ae6/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java
index 9dcfa13..4fe40a2 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java
@@ -34,7 +34,6 @@ import com.cloud.host.Host.Type;
 import com.cloud.hypervisor.Hypervisor;
 import com.cloud.resource.ServerResource;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.OutputInterpreter;
@@ -86,9 +85,10 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
 	protected Script2 _forcePowerOffCommand;
 	protected Script2 _bootOrRebootCommand;
 	protected String _vmName;
-	protected VMInstanceDao vmDao;
     protected int ipmiRetryTimes = 5;
 
+    protected ConfigurationDao configDao;
+    protected VMInstanceDao vmDao;
 
 	private void changeVmState(String vmName, VirtualMachine.State state) {
 		synchronized (_vms) {
@@ -126,6 +126,8 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
 		_password = (String) params.get(ApiConstants.PASSWORD);
 		_vmName = (String) params.get("vmName");
 		String echoScAgent = (String) params.get(BaremetalManager.EchoSecurityGroupAgent);
+        vmDao = (VMInstanceDao) params.get("vmDao");
+        configDao = (ConfigurationDao) params.get("configDao");
 
 		if (_pod == null) {
 			throw new ConfigurationException("Unable to get the pod");
@@ -156,7 +158,6 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
 		    _isEchoScAgent = Boolean.valueOf(echoScAgent);
 		}
 
-        ConfigurationDao configDao = ComponentContext.getComponent(ConfigurationDao.class);
         String ipmiIface = "default";
         try {
             ipmiIface = configDao.getValue(Config.BaremetalIpmiLanInterface.key());
@@ -330,7 +331,6 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
     protected Map<String, State> fullSync() {
         Map<String, State> states = new HashMap<String, State>();
         if (hostId != null) {
-            vmDao = ComponentContext.getComponent(VMInstanceDao.class);
             final List<? extends VMInstanceVO> vms = vmDao.listByHostId(hostId);
             for (VMInstanceVO vm : vms) {
                 states.put(vm.getInstanceName(), vm.getState());
@@ -349,7 +349,6 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
     protected Map<String, HostVmStateReportEntry> getHostVmStateReport() {
         Map<String, HostVmStateReportEntry> states = new HashMap<String, HostVmStateReportEntry>();
         if (hostId != null) {
-            vmDao = ComponentContext.getComponent(VMInstanceDao.class);
             final List<? extends VMInstanceVO> vms = vmDao.listByHostId(hostId);
             for (VMInstanceVO vm : vms) {
                 states.put(
@@ -412,7 +411,6 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
 		}
 
         if (hostId != null) {
-            vmDao = ComponentContext.getComponent(VMInstanceDao.class);
             final List<? extends VMInstanceVO> vms = vmDao.listByHostId(hostId);
             if (vms.isEmpty()) {
                 return new PingRoutingCommand(getType(), id, deltaSync(), getHostVmStateReport());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26002ae6/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
index 9618e6b..e82eece 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
@@ -184,9 +184,9 @@ public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxe
 
     @Override
     public boolean addUserData(NicProfile nic, VirtualMachineProfile profile) {
-        UserVmVO vm = (UserVmVO) profile.getVirtualMachine();
+        UserVmVO vm = _vmDao.findById(profile.getVirtualMachine().getId());
         _vmDao.loadDetails(vm);
-        
+
         String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()).getDisplayText();
         String zoneName = _dcDao.findById(vm.getDataCenterId()).getName();
         NicVO nvo = _nicDao.findById(nic.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26002ae6/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index 0a25805..d9e1ecc 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -299,6 +299,15 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
                             + ", pod: " + host.getPodId() + ", cluster: " + host.getClusterId());
                 }
 
+                Pod pod = _podDao.findById(host.getPodId());
+                Cluster cluster = _clusterDao.findById(host.getClusterId());
+
+                if (vm.getHypervisorType() == HypervisorType.BareMetal) {
+                    DeployDestination dest = new DeployDestination(dc, pod, cluster, host, new HashMap<Volume, StoragePool>());
+                    s_logger.debug("Returning Deployment Destination: " + dest);
+                    return dest;
+                }
+
                 // search for storage under the zone, pod, cluster of the host.
                 DataCenterDeployment lastPlan = new DataCenterDeployment(host.getDataCenterId(), host.getPodId(),
                         host.getClusterId(), hostIdSpecified, plan.getPoolId(), null, plan.getReservationContext());
@@ -315,8 +324,6 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
                     Pair<Host, Map<Volume, StoragePool>> potentialResources = findPotentialDeploymentResources(
                             suitableHosts, suitableVolumeStoragePools, avoids, getPlannerUsage(planner,vmProfile, plan ,avoids), readyAndReusedVolumes);
                     if (potentialResources != null) {
-                        Pod pod = _podDao.findById(host.getPodId());
-                        Cluster cluster = _clusterDao.findById(host.getClusterId());
                         Map<Volume, StoragePool> storageVolMap = potentialResources.second();
                         // remove the reused vol<->pool from destination, since
                         // we don't have to prepare this volume.
@@ -362,6 +369,17 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
                                 + ", pod: " + host.getPodId() + ", cluster: " + host.getClusterId());
                         // search for storage under the zone, pod, cluster of
                         // the last host.
+
+
+                        Pod pod = _podDao.findById(host.getPodId());
+                        Cluster cluster = _clusterDao.findById(host.getClusterId());
+
+                        if (vm.getHypervisorType() == HypervisorType.BareMetal) {
+                            DeployDestination dest = new DeployDestination(dc, pod, cluster, host, new HashMap<Volume, StoragePool>());
+                            s_logger.debug("Returning Deployment Destination: " + dest);
+                            return dest;
+                        }
+
                         DataCenterDeployment lastPlan = new DataCenterDeployment(host.getDataCenterId(),
                                 host.getPodId(), host.getClusterId(), host.getId(), plan.getPoolId(), null);
                         Pair<Map<Volume, List<StoragePool>>, List<Volume>> result = findSuitablePoolsForVolumes(
@@ -376,8 +394,6 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
                             Pair<Host, Map<Volume, StoragePool>> potentialResources = findPotentialDeploymentResources(
                                     suitableHosts, suitableVolumeStoragePools, avoids, getPlannerUsage(planner,vmProfile, plan ,avoids), readyAndReusedVolumes);
                             if (potentialResources != null) {
-                                Pod pod = _podDao.findById(host.getPodId());
-                                Cluster cluster = _clusterDao.findById(host.getClusterId());
                                 Map<Volume, StoragePool> storageVolMap = potentialResources.second();
                                 // remove the reused vol<->pool from
                                 // destination, since we don't have to prepare


[07/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6146. [VMware] [ESXi 5.5] Live storage migration of an already migrated volume fails
In vCenter 5.5, once a volume is migrated the VMDKs are renamed to match the name of the VM.
If a volume has been renamed upon migration update its volumePath to that of the new disk filename.
(cherry picked from commit c652ff45dffaafa1cb0de29103e90fe936382028)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: e63af74f8ef76be4b30fdd6fd74fdd4e023fc622
Parents: 5b2cdf4
Author: Likitha Shetty <li...@citrix.com>
Authored: Mon Feb 24 10:12:58 2014 +0530
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:39:18 2014 -0800

----------------------------------------------------------------------
 .../vmware/resource/VmwareResource.java           | 17 +++++++++++++----
 .../hypervisor/vmware/mo/VirtualMachineMO.java    | 18 ++++++++++++------
 2 files changed, 25 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e63af74f/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 d1fea92..d27d81f 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
@@ -4517,12 +4517,12 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                 throw new Exception(msg);
             }
 
-            VmwareStorageLayoutHelper.getVmwareDatastorePathFromVmdkFileName(
-                    new DatastoreMO(srcHyperHost.getContext(), morDs), vmName,
-                    volumePath + ".vmdk");
+            DatastoreMO targetDsMo = new DatastoreMO(srcHyperHost.getContext(), morDs);
+            String fullVolumePath = VmwareStorageLayoutHelper.getVmwareDatastorePathFromVmdkFileName(targetDsMo, vmName, volumePath + ".vmdk");
+            int diskId = getVirtualDiskInfo(vmMo, volumePath + ".vmdk");
             diskLocator = new VirtualMachineRelocateSpecDiskLocator();
             diskLocator.setDatastore(morDs);
-            diskLocator.setDiskId(getVirtualDiskInfo(vmMo, volumePath + ".vmdk"));
+            diskLocator.setDiskId(diskId);
 
             diskLocators.add(diskLocator);
             relocateSpec.getDisk().add(diskLocator);
@@ -4534,6 +4534,15 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                 s_logger.debug("Successfully migrated volume " + volumePath + " to target datastore " + tgtDsName);
             }
 
+            // Update and return volume path because that could have changed after migration
+            if (!targetDsMo.fileExists(fullVolumePath)) {
+                VirtualDisk[] disks = vmMo.getAllDiskDevice();
+                for (VirtualDisk disk : disks)
+                    if (disk.getKey() == diskId) {
+                        volumePath = vmMo.getVmdkFileBaseName(disk);
+                    }
+            }
+
             return new MigrateVolumeAnswer(cmd, true, null, volumePath);
         } catch (Exception e) {
             String msg = "Catch Exception " + e.getClass().getName() + " due to " + e.toString();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e63af74f/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
index e4e2712..69a7e50 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
@@ -1783,17 +1783,23 @@ public class VirtualMachineMO extends BaseMO {
         VirtualDevice[] devices = getAllDiskDevice();
         for(VirtualDevice device : devices) {
             if(device instanceof VirtualDisk) {
-                VirtualDeviceBackingInfo backingInfo = ((VirtualDisk)device).getBacking();
-                if(backingInfo instanceof VirtualDiskFlatVer2BackingInfo) {
-                    VirtualDiskFlatVer2BackingInfo diskBackingInfo = (VirtualDiskFlatVer2BackingInfo)backingInfo;
-                    DatastoreFile dsBackingFile = new DatastoreFile(diskBackingInfo.getFileName());
-                    vmdkFileBaseNames.add(dsBackingFile.getFileBaseName());
-                }
+                vmdkFileBaseNames.add(getVmdkFileBaseName((VirtualDisk)device));
             }
         }
         return vmdkFileBaseNames;
     }
 
+    public String getVmdkFileBaseName(VirtualDisk disk) throws Exception {
+        String vmdkFileBaseName = null;
+        VirtualDeviceBackingInfo backingInfo = disk.getBacking();
+        if(backingInfo instanceof VirtualDiskFlatVer2BackingInfo) {
+            VirtualDiskFlatVer2BackingInfo diskBackingInfo = (VirtualDiskFlatVer2BackingInfo)backingInfo;
+            DatastoreFile dsBackingFile = new DatastoreFile(diskBackingInfo.getFileName());
+            vmdkFileBaseName = dsBackingFile.getFileBaseName();
+        }
+        return vmdkFileBaseName;
+    }
+
 	// this method relies on un-offical VMware API
 	@Deprecated
 	public void moveAllVmDiskFiles(DatastoreMO destDsMo, String destDsDir, boolean followDiskChain) throws Exception {


[06/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6155
Baremetal agent RPM missing in spec file
(cherry picked from commit 20efa0c8a6b83c6590eab48fefac81b72b2082a9)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: 5b2cdf417903b0d0953cbbfc9c6e85752e1b0ef5
Parents: 96118e4
Author: Frank.Zhang <fr...@citrix.com>
Authored: Mon Feb 24 13:30:24 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:39:03 2014 -0800

----------------------------------------------------------------------
 packaging/centos63/cloud.spec | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b2cdf41/packaging/centos63/cloud.spec
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec
index 8029b61..b363a2e 100644
--- a/packaging/centos63/cloud.spec
+++ b/packaging/centos63/cloud.spec
@@ -136,6 +136,18 @@ Group: System Environment/Libraries
 %description agent
 The CloudStack agent for KVM hypervisors
 
+%package baremetal-agent
+Summary: CloudStack baremetal agent
+Requires: tftp-server
+Requires: xinetd
+Requires: syslinux
+Requires: chkconfig
+Requires: dhcp
+Requires: httpd
+Group:     System Environment/Libraries
+%description baremetal-agent
+The CloudStack baremetal agent
+
 %package usage
 Summary: CloudStack Usage calculation server
 Requires: java >= 1.6.0
@@ -244,6 +256,7 @@ install -D client/target/utilities/bin/cloud-set-guest-sshkey ${RPM_BUILD_ROOT}%
 install -D client/target/utilities/bin/cloud-setup-databases ${RPM_BUILD_ROOT}%{_bindir}/%{name}-setup-databases
 install -D client/target/utilities/bin/cloud-setup-encryption ${RPM_BUILD_ROOT}%{_bindir}/%{name}-setup-encryption
 install -D client/target/utilities/bin/cloud-setup-management ${RPM_BUILD_ROOT}%{_bindir}/%{name}-setup-management
+install -D client/target/utilities/bin/cloud-setup-baremetal ${RPM_BUILD_ROOT}%{_bindir}/%{name}-setup-baremetal
 install -D client/target/utilities/bin/cloud-sysvmadm ${RPM_BUILD_ROOT}%{_bindir}/%{name}-sysvmadm
 install -D client/target/utilities/bin/cloud-update-xenserver-licenses ${RPM_BUILD_ROOT}%{_bindir}/%{name}-update-xenserver-licenses
 
@@ -633,6 +646,9 @@ fi
 %{_defaultdocdir}/%{name}-awsapi-%{version}/LICENSE
 %{_defaultdocdir}/%{name}-awsapi-%{version}/NOTICE
 
+%files baremetal-agent
+%attr(0755,root,root) %{_bindir}/cloudstack-setup-baremetal
+
 
 %changelog
 * Fri Oct 03 2012 Hugo Trippaers <hu...@apache.org> 4.1.0


[18/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6183: unplug the nic when all the ips of  public vlan range is removed
(cherry picked from commit 7700a1b71622c1d45b2b54aa7444be5adc4fb8ab)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: 86643d6e3fd3261cabe105a452e33017a77a23e3
Parents: 9e1525c
Author: Jayapal <ja...@apache.org>
Authored: Thu Feb 27 18:39:37 2014 +0530
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:43:03 2014 -0800

----------------------------------------------------------------------
 .../kvm/resource/LibvirtComputingResource.java  | 31 ++++++++++++++++++++
 .../xen/resource/CitrixResourceBase.java        | 15 ++++++++--
 2 files changed, 44 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/86643d6e/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 6e0c6fa..36382e3 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -1789,6 +1789,23 @@ ServerResource {
     	return new Answer(cmd, true, result);
     }
 
+    private void vifHotUnPlug (Connect conn, String vmName, String macAddr) throws InternalErrorException, LibvirtException {
+
+        Domain vm = null;
+        vm = getDomain(conn, vmName);
+        List<InterfaceDef> pluggedNics = getInterfaces(conn, vmName);
+        for (InterfaceDef pluggedNic : pluggedNics) {
+            if (pluggedNic.getMacAddress().equalsIgnoreCase(macAddr)) {
+                vm.detachDevice(pluggedNic.toString());
+                // We don't know which "traffic type" is associated with
+                // each interface at this point, so inform all vif drivers
+                for (VifDriver vifDriver : getAllVifDrivers()) {
+                    vifDriver.unplug(pluggedNic);
+                }
+            }
+        }
+    }
+
     private void VifHotPlug(Connect conn, String vmName, String broadcastUri,
             String macAddr) throws InternalErrorException, LibvirtException {
         NicTO nicTO = new NicTO();
@@ -2103,6 +2120,12 @@ ServerResource {
             String result = null;
             int nicNum = 0;
             boolean newNic = false;
+            int numOfIps = 0;
+
+            if (ips != null) {
+                numOfIps = ips.length;
+            }
+
             for (IpAddressTO ip : ips) {
                 if (!broadcastUriAllocatedToVM.containsKey(ip.getBroadcastUri())) {
                     /* plug a vif into router */
@@ -2121,6 +2144,14 @@ ServerResource {
                 if (result == null) {
                     results[i++] = ip.getPublicIp() + " - success";
                 }
+
+                //there is only only ip in public subnet and it is deleted so unplug the vif
+                if (numOfIps == 1 && !ip.isAdd()) {
+                    // There are no ips on the vm so delete the vif
+                    networkUsage(routerIp, "deleteVif", "eth" + nicNum);
+                    vifHotUnPlug(conn, routerName, ip.getVifMacAddress());
+                }
+
             }
             return new IpAssocAnswer(cmd, results);
         } catch (LibvirtException e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/86643d6e/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 3c7b4ac..1f37167 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -2383,7 +2383,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
 
 
     protected void assignPublicIpAddress(Connection conn, String vmName, String privateIpAddress, String publicIpAddress, boolean add, boolean firstIP,
-            boolean sourceNat, String vlanId, String vlanGateway, String vlanNetmask, String vifMacAddress, Integer networkRate, TrafficType trafficType, String name) throws InternalErrorException {
+            boolean sourceNat, String vlanId, String vlanGateway, String vlanNetmask, String vifMacAddress, Integer networkRate, TrafficType trafficType, String name,
+            int numOfips) throws InternalErrorException {
 
         try {
             VM router = getVM(conn, vmName);
@@ -2474,6 +2475,11 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                 throw new InternalErrorException("Xen plugin \"ipassoc\" failed.");
             }
 
+            //there is only only ip in public subnet and it is deleted so unplug the vif
+            if (numOfips == 1 && !add) {
+                removeVif = true;
+            }
+
             if (removeVif) {
                 network = correctVif.getNetwork(conn);
 
@@ -2575,14 +2581,19 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         Connection conn = getConnection();
         String[] results = new String[cmd.getIpAddresses().length];
         int i = 0;
+        int numOfIps = 0;
         String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
         String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
         try {
             IpAddressTO[] ips = cmd.getIpAddresses();
+            if (ips != null) {
+                numOfIps = ips.length;
+            }
+
             for (IpAddressTO ip : ips) {
 
                 assignPublicIpAddress(conn, routerName, routerIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(), ip.isSourceNat(), ip.getBroadcastUri(),
-                        ip.getVlanGateway(), ip.getVlanNetmask(), ip.getVifMacAddress(), ip.getNetworkRate(), ip.getTrafficType(), ip.getNetworkName());
+                        ip.getVlanGateway(), ip.getVlanNetmask(), ip.getVifMacAddress(), ip.getNetworkRate(), ip.getTrafficType(), ip.getNetworkName(), numOfIps);
                 results[i++] = ip.getPublicIp() + " - success";
             }
         } catch (InternalErrorException e) {


[03/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6155
Baremetal agent RPM missing in spec file
(cherry picked from commit c1806bd873fe661756aeee94b25339c25f9724a5)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: a652737f8daa07ec913169c97202f812db8bbb75
Parents: 360b7e3
Author: Frank.Zhang <fr...@citrix.com>
Authored: Fri Feb 21 13:22:55 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:38:06 2014 -0800

----------------------------------------------------------------------
 setup/bindir/cloud-setup-baremetal.in | 232 +++++++++++++++++++++++++++++
 1 file changed, 232 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a652737f/setup/bindir/cloud-setup-baremetal.in
----------------------------------------------------------------------
diff --git a/setup/bindir/cloud-setup-baremetal.in b/setup/bindir/cloud-setup-baremetal.in
new file mode 100644
index 0000000..367e389
--- /dev/null
+++ b/setup/bindir/cloud-setup-baremetal.in
@@ -0,0 +1,232 @@
+#!/usr/bin/python
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import sys, os
+from subprocess import PIPE, Popen
+import logging
+import traceback
+from os.path import exists, join
+from signal import alarm, signal, SIGALRM, SIGKILL
+
+class CloudRuntimeException(Exception):
+    def __init__(self, errMsg):
+        self.errMsg = errMsg
+    def __str__(self):
+        return self.errMsg
+def formatExceptionInfo(maxTBlevel=5):
+    cla, exc, trbk = sys.exc_info()
+    excTb = traceback.format_tb(trbk, maxTBlevel)
+    msg = str(exc) + "\n"
+    for tb in excTb:
+        msg += tb
+    return msg
+
+class bash:
+    def __init__(self, args, timeout=600):
+        self.args = args
+        logging.debug("execute:%s"%args)
+        self.timeout = timeout
+        self.process = None
+        self.success = False
+        self.run()
+
+    def run(self):
+        class Alarm(Exception):
+            pass
+        def alarm_handler(signum, frame):
+            raise Alarm
+
+        try:
+            self.process = Popen(self.args, shell=True, stdout=PIPE, stderr=PIPE)
+            if self.timeout != -1:
+                signal(SIGALRM, alarm_handler)
+                alarm(self.timeout)
+
+            try:
+                self.stdout, self.stderr = self.process.communicate()
+                if self.timeout != -1:
+                    alarm(0)
+            except Alarm:
+                os.kill(self.process.pid, SIGKILL)
+                raise  CloudRuntimeException("Timeout during command execution")
+
+            self.success = self.process.returncode == 0
+        except:
+            raise  CloudRuntimeException(formatExceptionInfo())
+
+#        if not self.success: 
+#            raise  CloudRuntimeException(self.getStderr())
+
+    def isSuccess(self):
+        return self.success
+    
+    def getStdout(self):
+        return self.stdout.strip("\n")
+    
+    def getLines(self):
+        return self.stdout.split("\n")
+
+    def getStderr(self):
+        return self.stderr.strip("\n")
+
+
+def initLoging(logFile=None):
+    try:
+        if logFile is None:
+            logging.basicConfig(level=logging.DEBUG) 
+        else: 
+            logging.basicConfig(filename=logFile, level=logging.DEBUG) 
+    except:
+        logging.basicConfig(level=logging.DEBUG) 
+
+def writeProgressBar(msg, result=None):    
+    if msg is not None:
+        output = "%-80s"%msg
+    elif result is True:
+        output = "[ \033[92m%-2s\033[0m ]\n"%"OK"
+    elif result is False:
+        output = "[ \033[91m%-6s\033[0m ]\n"%"FAILED"
+    sys.stdout.write(output)
+    sys.stdout.flush()
+    
+def printError(msg):
+    sys.stderr.write(msg)
+    sys.stderr.write("\n")
+    sys.stderr.flush()
+
+def printMsg(msg):
+    sys.stdout.write(msg+"\n")
+    sys.stdout.flush()
+
+def checkRpm(pkgName):
+    chkPkg = bash("rpm -q %s"%pkgName)
+    writeProgressBar("Checking %s"%pkgName, None)
+    if not chkPkg.isSuccess():
+        writeProgressBar(None, False)
+        printError("%s is not found, please make sure it is installed. You may try 'yum install %s'\n"%(pkgName, pkgName))
+        return False
+    else:
+        writeProgressBar(None, True)
+        return True
+      
+def checkEnv():
+   writeProgressBar("Checking is root")
+   ret = bash("whoami")
+   if ret.getStdout() != "root":
+       writeProgressBar(None, False)
+       printError("This script must run as root")
+       return False
+   else:
+       writeProgressBar(None, True)
+       
+   pkgList = ['tftp-server', 'syslinux', 'xinetd', 'chkconfig', 'dhcp']
+   for pkg in pkgList:
+       if not checkRpm(pkg):
+           return False
+   return True
+
+def exitIfFail(ret):
+    if not ret: sys.exit(1) 
+    
+def bashWithResult(cmd):
+    writeProgressBar("Executing '%s'"%cmd)
+    ret = bash(cmd)
+    if not ret.isSuccess():
+        writeProgressBar(None, False)
+        writeProgressBar(ret.getStderr() + '\n')
+        return False
+    else:
+        writeProgressBar(None, True)
+        return True
+    
+def configurePxeStuff(): 
+    stuff = ['tftp', 'xinetd', 'dhcpd']
+    cmds = ['chkconfig --level 345 %s on' % i for i in stuff]
+    cmds.append('/etc/init.d/xinetd restart')
+    
+    for cmd in cmds:
+        if not bashWithResult(cmd): return False
+        
+    chkIptable = bash('chkconfig --list iptables')
+    if 'on' in chkIptable.getStdout():
+        printMsg("Detected iptables is running, need to open tftp port 69")
+        if not bashWithResult('iptables -I INPUT 1 -p udp --dport 69 -j ACCEPT'): return False
+        if not bashWithResult('/etc/init.d/iptables save'): return False
+        
+    return True  
+    
+def getTftpRootDir(tftpRootDirList):
+    tftpRoot = bash("cat /etc/xinetd.d/tftp | grep server_args")
+    if not tftpRoot.isSuccess():
+        printError("Cannot get tftp root directory from /etc/xinetd.d/tftp, here may be something wrong with your tftp-server, try reinstall it\n")
+        return False
+    tftpRootDir = tftpRoot.getStdout()
+    index = tftpRootDir.find("/")
+    if index == -1:
+        printError("Wrong server_arg in /etc/xinetd.d/tftp (%s)"%tftpRootDir)
+        return False
+    tftpRootDir = tftpRootDir[index:]
+    tftpRootDirList.append(tftpRootDir)
+    return True
+
+def preparePING(tftpRootDir):
+    pingFiles = ['boot.msg', 'initrd.gz', 'kernel', 'pxelinux.0']
+    pingDir = "/usr/share/PING"
+    
+    for f in pingFiles:
+        path = join(pingDir, f)
+        if not exists(path):
+            printError("Cannot find %s, please make sure PING-3.01 is installed"%path)
+            return False
+        if not bashWithResult("cp -f %s %s"%(path, tftpRootDir)): return False
+     
+    if not bashWithResult("mkdir -p %s/pxelinux.cfg"%tftpRootDir): return False
+    
+    return True
+
+def prepareSyslinux(tftpRootDir):
+    pkg = bash('rpm -ql syslinux | grep "/pxelinux.0$"')
+    if not pkg.isSuccess():
+        printError('cannot find pxelinux.0 on system. is syslinux installed?')
+        return False
+
+    pkg = pkg.getStdout()
+    cp = "cp -f %s %s" % (pkg, tftpRootDir)
+    if not bashWithResult(cp):
+        return False
+
+    return True
+
+            
+        
+if __name__ == "__main__":
+    initLoging("/tmp/cloud-setup-baremetal.log")
+    tftpRootDirList = []
+    
+    exitIfFail(checkEnv())
+    exitIfFail(configurePxeStuff())
+    exitIfFail(getTftpRootDir(tftpRootDirList))
+    
+    tftpRootDir = tftpRootDirList[0].strip()
+    #exitIfFail(preparePING(tftpRootDir))
+    exitIfFail(prepareSyslinux(tftpRootDir))
+    printMsg("")
+    printMsg("Setup BareMetal PXE server successfully")
+    printMsg("TFTP root directory is: %s\n"%tftpRootDir)
+    sys.exit(0)
+    


[11/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6174: Provide separate option for Windows Server 2012 R2 as
an OS type when registering template.
(cherry picked from commit 4c83f80c809674cb8ff9561d546a6ade25d983f8)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: d4a1adac213a36f5832ba3cd66eb5092254d2a6d
Parents: fc35c98
Author: Min Chen <mi...@citrix.com>
Authored: Wed Feb 26 11:24:01 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:40:49 2014 -0800

----------------------------------------------------------------------
 .../hypervisor/xen/resource/CitrixHelper.java   | 345 ++++++++++++++++++-
 .../xen/resource/Xenserver625Resource.java      |  15 +-
 setup/db/db/schema-421to430.sql                 |   4 +
 setup/db/templates.sql                          |   3 +
 .../vmware/util/VmwareGuestOsMapper.java        |   5 +-
 5 files changed, 358 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d4a1adac/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
index ed890ef..c7e3938 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
@@ -11,16 +11,16 @@
 // Unless required by applicable law or agreed to in writing,
 // software distributed under the License is distributed on an
 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the 
+// KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
 package com.cloud.hypervisor.xen.resource;
 
-import org.apache.log4j.Logger;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 
+import org.apache.log4j.Logger;
+
 /**
  * Reduce bloat inside CitrixResourceBase
  *
@@ -31,12 +31,14 @@ public class CitrixHelper {
     private static final HashMap<String, String> _xcp160GuestOsMap = new HashMap<String, String>(70);
     private static final HashMap<String, String> _xenServerGuestOsMap = new HashMap<String, String>(70);
     private static final HashMap<String, String> _xenServer56FP1GuestOsMap = new HashMap<String, String>(70);
+    private static final HashMap<String, String> _xenServer602GuestOsMap = new HashMap<String, String>(70);
     private static final HashMap<String, String> _xenServer56FP2GuestOsMap = new HashMap<String, String>(70);
     private static final HashMap<String, String> _xenServer600GuestOsMap = new HashMap<String, String>(70);
-    private static final HashMap<String, String> _xenServer602GuestOsMap = new HashMap<String, String>(70);
     private static final HashMap<String, String> _xenServer610GuestOsMap = new HashMap<String, String>(70);
     private static final HashMap<String, String> _xenServer620GuestOsMap = new HashMap<String, String>(70);
+    private static final HashMap<String, String> _xenServer625GuestOsMap = new HashMap<String, String>(70);
     private static final HashMap<String, MemoryValues> _xenServer620GuestOsMemoryMap = new HashMap<String, MemoryValues>(70);
+    private static final HashMap<String, MemoryValues> _xenServer625GuestOsMemoryMap = new HashMap<String, MemoryValues>(70);
     private static final HashMap<String, MemoryValues> _xenServer610GuestOsMemoryMap = new HashMap<String, MemoryValues>(70);
     private static final HashMap<String, MemoryValues> _xenServer602GuestOsMemoryMap = new HashMap<String, MemoryValues>(70);
     private static final HashMap<String, MemoryValues> _xenServer600GuestOsMemoryMap = new HashMap<String, MemoryValues>(70);
@@ -1532,6 +1534,168 @@ public class CitrixHelper {
         _xenServer620GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
     }
 
+    static {
+        _xenServer625GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.6 (32-bit)", "CentOS 5 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.6 (64-bit)", "CentOS 5 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.7 (32-bit)", "CentOS 5 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.7 (64-bit)", "CentOS 5 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.8 (32-bit)", "CentOS 5 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.8 (64-bit)", "CentOS 5 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.9 (32-bit)", "CentOS 5 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 5.9 (64-bit)", "CentOS 5 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 6.0 (32-bit)", "CentOS 6 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 6.0 (64-bit)", "CentOS 6 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 6.1 (32-bit)", "CentOS 6 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 6.1 (64-bit)", "CentOS 6 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 6.2 (32-bit)", "CentOS 6 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 6.2 (64-bit)", "CentOS 6 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 6.3 (32-bit)", "CentOS 6 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 6.3 (64-bit)", "CentOS 6 (64-bit)");
+        _xenServer625GuestOsMap.put("CentOS 6.4 (32-bit)", "CentOS 6 (32-bit)");
+        _xenServer625GuestOsMap.put("CentOS 6.4 (64-bit)", "CentOS 6 (64-bit)");
+        _xenServer625GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+        _xenServer625GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit)");
+        _xenServer625GuestOsMap.put("Debian GNU/Linux 7(32-bit)", "Debian Wheezy 7.0 (32-bit)");
+        _xenServer625GuestOsMap.put("Debian GNU/Linux 7(64-bit)", "Debian Wheezy 7.0 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.6 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.6 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.7 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.7 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.8 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.8 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.9 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 5.9 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 6.0 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 6.0 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 6.1 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 6.1 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 6.2 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 6.2 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 6.3 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 6.3 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 6.4 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+        _xenServer625GuestOsMap.put("Oracle Enterprise Linux 6.4 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.8 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.8 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.9 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 5.9 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 6.3 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 6.3 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 6.4 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+        _xenServer625GuestOsMap.put("Red Hat Enterprise Linux 6.4 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 (64-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2 (32-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 (64-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", "SUSE Linux Enterprise Server 10 SP3 (32-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "SUSE Linux Enterprise Server 10 SP3 (64-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", "SUSE Linux Enterprise Server 10 SP4 (32-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", "SUSE Linux Enterprise Server 10 SP4 (64-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11 (32-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 (64-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", "SUSE Linux Enterprise Server 11 SP1 (32-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", "SUSE Linux Enterprise Server 11 SP1 (64-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 11 SP2 (32-bit)", "SUSE Linux Enterprise Server 11 SP2 (32-bit)");
+        _xenServer625GuestOsMap.put("SUSE Linux Enterprise Server 11 SP2 (64-bit)", "SUSE Linux Enterprise Server 11 SP2 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)");
+        _xenServer625GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows 7 SP1 (32-bit)", "Windows 7 (32-bit)");
+        _xenServer625GuestOsMap.put("Windows 7 SP1 (64-bit)", "Windows 7 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows 8 (32-bit)", "Windows 8 (32-bit)");
+        _xenServer625GuestOsMap.put("Windows 8 (64-bit)", "Windows 8 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2003 SP2 (32-bit)", "Windows Server 2003 (32-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2003 SP2 (64-bit)", "Windows Server 2003 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2003 PAE (32-bit)", "Windows Server 2003 (32-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2003 Enterprise Edition(32-bit)", "Windows Server 2003 (32-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2003 Enterprise Edition(64-bit)", "Windows Server 2003 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2003 DataCenter Edition(32-bit)", "Windows Server 2003 (32-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2003 DataCenter Edition(64-bit)", "Windows Server 2003 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2003 Standard Edition(32-bit)", "Windows Server 2003 (32-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2003 Standard Edition(64-bit)", "Windows Server 2003 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2008 SP2 (32-bit)", "Windows Server 2008 (34-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2008 SP2 (64-bit)", "Windows Server 2008 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2008 R2 SP1 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2012 (64-bit)", "Windows Server 2012 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows Server 2012 R2 (64-bit)", "Windows Server 2012 (64-bit)");
+        _xenServer625GuestOsMap.put("Windows Vista SP2 (32-bit)", "Windows Vista (32-bit)");
+        _xenServer625GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)");
+        _xenServer625GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit)");
+        _xenServer625GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit)");
+        _xenServer625GuestOsMap.put("Ubuntu 10.10 (32-bit)", "Ubuntu Maverick Meerkat 10.10 (32-bit) (experimental)");
+        _xenServer625GuestOsMap.put("Ubuntu 10.10 (64-bit)", "Ubuntu Maverick Meerkat 10.10 (64-bit) (experimental)");
+        _xenServer625GuestOsMap.put("Ubuntu 12.04 (32-bit)", "Ubuntu Precise Pangolin 12.04 (32-bit)");
+        _xenServer625GuestOsMap.put("Ubuntu 12.04 (64-bit)", "Ubuntu Precise Pangolin 12.04 (64-bit)");
+        _xenServer625GuestOsMap.put("Ubuntu 11.04 (32-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Ubuntu 11.04 (64-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Other Linux (32-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Other Linux (64-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Other (32-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Other (64-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Other CentOS (32-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Other CentOS (64-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Other Ubuntu (32-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Other Ubuntu (64-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Other SUSE Linux(32-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Other SUSE Linux(64-bit)", "Other install media");
+        _xenServer625GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
+        _xenServer625GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
+    }
+
     public static class MemoryValues {
         long max;
         long min;
@@ -1823,6 +1987,147 @@ public class CitrixHelper {
         _xenServer620GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128*1024l));
     }
 
+    static {
+        _xenServer625GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.8 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.8 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.9 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 5.9 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 6.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 6.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 6.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("CentOS 6.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Debian GNU/Linux 7(32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Debian GNU/Linux 7(64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.8 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.8 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.9 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 5.9 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 6.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 6.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 6.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Oracle Enterprise Linux 6.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.8 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.8 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.9 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.9 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+
+        _xenServer625GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(2 * 1024l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows 7 SP1 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows 7 SP1 (64-bit)", new MemoryValues(2 * 1024l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(2 * 1024l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows Server 2003 SP2 (32-bit)", new MemoryValues(256l, 64 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows Server 2003 SP2 (64-bit)", new MemoryValues(256l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows Server 2008 SP2 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows Server 2008 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows Server 2008 R2 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows Server 2012 R2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows Vista SP2 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(256l, 4 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+        _xenServer625GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32 * 1024l));
+        //_xenServer620GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+        //_xenServer620GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l));   //?
+        _xenServer625GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32 * 1024l));
+        _xenServer625GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128 * 1024l));
+    }
 
     public static String getXcpGuestOsType(String stdType) {
         String guestOS =  _xcp100GuestOsMap.get(stdType);
@@ -1857,7 +2162,7 @@ public class CitrixHelper {
         return guestOS;
     }
     
-    public static String getXenServer56FP1GuestOsType(String stdType, boolean bootFromCD) {       
+    public static String getXenServer56FP1GuestOsType(String stdType, boolean bootFromCD) {
         String guestOS =  _xenServer56FP1GuestOsMap.get(stdType);
         if (guestOS == null) {
             if ( !bootFromCD ) {
@@ -2023,6 +2328,20 @@ public class CitrixHelper {
         return guestOS;
     }
 
+    public static String getXenServer625GuestOsType(String stdType, boolean bootFromCD) {
+        String guestOS = _xenServer625GuestOsMap.get(stdType);
+        if (guestOS == null) {
+            if (!bootFromCD) {
+                s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 6.2.5 guestOS type, start it as HVM guest");
+                guestOS = "Other install media";
+            } else {
+                String msg = "XenServer 6.2.5 DOES NOT support Guest OS type " + stdType;
+                s_logger.warn(msg);
+            }
+        }
+        return guestOS;
+    }
+
     public static long getXenServer620StaticMax(String stdType, boolean bootFromCD) {
         MemoryValues recommendedMaxMinMemory = _xenServer620GuestOsMemoryMap.get(stdType);
         if (recommendedMaxMinMemory == null) {
@@ -2038,4 +2357,20 @@ public class CitrixHelper {
         }
         return recommendedMaxMinMemory.getMin();
     }
+
+    public static long getXenServer625StaticMax(String stdType, boolean bootFromCD) {
+        MemoryValues recommendedMaxMinMemory = _xenServer625GuestOsMemoryMap.get(stdType);
+        if (recommendedMaxMinMemory == null) {
+            return 0l;
+        }
+        return recommendedMaxMinMemory.getMax();
+    }
+
+    public static long getXenServer625StaticMin(String stdType, boolean bootFromCD) {
+        MemoryValues recommendedMaxMinMemory = _xenServer625GuestOsMemoryMap.get(stdType);
+        if (recommendedMaxMinMemory == null) {
+            return 0l;
+        }
+        return recommendedMaxMinMemory.getMin();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d4a1adac/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java
index 7d2a2a1..a085e2d 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java
@@ -25,20 +25,22 @@ import java.util.Map;
 
 import javax.ejb.Local;
 
-import org.apache.cloudstack.hypervisor.xenserver.XenServerResourceNewBase;
 import org.apache.log4j.Logger;
 
+import com.xensource.xenapi.Connection;
+
+import org.apache.cloudstack.hypervisor.xenserver.XenServerResourceNewBase;
+
 import com.cloud.agent.api.StartupRoutingCommand;
 import com.cloud.resource.ServerResource;
 import com.cloud.storage.resource.StorageSubsystemCommandHandler;
 import com.cloud.storage.resource.StorageSubsystemCommandHandlerBase;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
-import com.xensource.xenapi.Connection;
 
 @Local(value=ServerResource.class)
 public class Xenserver625Resource extends XenServerResourceNewBase {
-    private static final Logger s_logger = Logger.getLogger(XenServer620Resource.class);
+    private static final Logger s_logger = Logger.getLogger(Xenserver625Resource.class);
 
     public Xenserver625Resource() {
         super();
@@ -53,7 +55,7 @@ public class Xenserver625Resource extends XenServerResourceNewBase {
 
     @Override
     protected String getGuestOsType(String stdType, boolean bootFromCD) {
-        return CitrixHelper.getXenServer620GuestOsType(stdType, bootFromCD);
+        return CitrixHelper.getXenServer625GuestOsType(stdType, bootFromCD);
     }
 
     @Override
@@ -71,7 +73,7 @@ public class Xenserver625Resource extends XenServerResourceNewBase {
 
     @Override
     public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
-        long recommendedValue = CitrixHelper.getXenServer620StaticMax(os, b);
+        long recommendedValue = CitrixHelper.getXenServer625StaticMax(os, b);
         if(recommendedValue == 0){
             s_logger.warn("No recommended value found for dynamic max, setting static max and dynamic max equal");
             return dynamicMaxRam;
@@ -86,7 +88,7 @@ public class Xenserver625Resource extends XenServerResourceNewBase {
 
     @Override
     public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
-        long recommendedValue = CitrixHelper.getXenServer620StaticMin(os, b);
+        long recommendedValue = CitrixHelper.getXenServer625StaticMin(os, b);
         if(recommendedValue == 0){
             s_logger.warn("No recommended value found for dynamic min");
             return dynamicMinRam;
@@ -108,5 +110,4 @@ public class Xenserver625Resource extends XenServerResourceNewBase {
     protected void umountSnapshotDir(Connection conn, Long dcId) {
 
     }
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d4a1adac/setup/db/db/schema-421to430.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql
index b55e388..3811a5a 100644
--- a/setup/db/db/schema-421to430.sql
+++ b/setup/db/db/schema-421to430.sql
@@ -1099,3 +1099,7 @@ UPDATE `cloud`.`service_offering_details` set `display`=1 where id> 0;
 
 ALTER TABLE `cloud`.`disk_offering_details` CHANGE `display_detail` `display_detail` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the detail can be displayed to the end user';
 UPDATE `cloud`.`disk_offering_details` set `display_detail`=1 where id> 0;
+
+INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (168, UUID(), 6, 'Windows Server 2012 R2 (64-bit)');
+INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("XenServer", 'Windows Server 2012 R2 (64-bit)', 168);
+INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("VmWare", 'Windows Server 2012 R2 (64-bit)', 168);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d4a1adac/setup/db/templates.sql
----------------------------------------------------------------------
diff --git a/setup/db/templates.sql b/setup/db/templates.sql
index 266dc60..929345d 100755
--- a/setup/db/templates.sql
+++ b/setup/db/templates.sql
@@ -220,6 +220,7 @@ INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (164
 INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (165, UUID(), 6, 'Windows 8 (32-bit)');
 INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (166, UUID(), 6, 'Windows 8 (64-bit)');
 INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (167, UUID(), 6, 'Windows Server 2012 (64-bit)');
+INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (168, UUID(), 6, 'Windows Server 2012 R2 (64-bit)');
 INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (169, UUID(), 10, 'Ubuntu 11.04 (32-bit)');
 INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (170, UUID(), 10, 'Ubuntu 11.04 (64-bit)');
 INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (171, UUID(), 1, 'CentOS 6.3 (32-bit)');
@@ -375,6 +376,7 @@ INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("XenServer", 'Windows 8 (32-bit)', 165);
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("XenServer", 'Windows 8 (64-bit)', 166);
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("XenServer", 'Windows Server 2012 (64-bit)', 167);
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("XenServer", 'Windows Server 2012 R2 (64-bit)', 168);
 
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 7(32-bit)', 48);
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Microsoft Windows 7(64-bit)', 49);
@@ -406,6 +408,7 @@ INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("VmWare", 'Windows 8 (32-bit)', 165);
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("VmWare", 'Windows 8 (64-bit)', 166);
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("VmWare", 'Windows Server 2012 (64-bit)', 167);
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("VmWare", 'Windows Server 2012 R2 (64-bit)', 168);
 
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5.0(32-bit)', 30);
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Red Hat Enterprise Linux 5.1(32-bit)', 32);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d4a1adac/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
index 325e6a4..4197941 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
@@ -61,6 +61,7 @@ public class VmwareGuestOsMapper {
         s_mapper.put("Windows 8 (32-bit)", VirtualMachineGuestOsIdentifier.WINDOWS_8_GUEST);
         s_mapper.put("Windows 8 (64-bit)", VirtualMachineGuestOsIdentifier.WINDOWS_8_64_GUEST);
         s_mapper.put("Windows Server 2012 (64-bit)", VirtualMachineGuestOsIdentifier.WINDOWS_8_SERVER_64_GUEST);
+        s_mapper.put("Windows Server 2012 R2 (64-bit)", VirtualMachineGuestOsIdentifier.WINDOWS_8_SERVER_64_GUEST);
 
                 s_mapper.put("Apple Mac OS X 10.6 (32-bit)", VirtualMachineGuestOsIdentifier.DARWIN_10_GUEST);
                 s_mapper.put("Apple Mac OS X 10.6 (64-bit)", VirtualMachineGuestOsIdentifier.DARWIN_10_64_GUEST);
@@ -157,7 +158,7 @@ public class VmwareGuestOsMapper {
 		s_mapper.put("Red Hat Enterprise Linux 5.4 (32-bit)", VirtualMachineGuestOsIdentifier.RHEL_5_GUEST);
 		s_mapper.put("Red Hat Enterprise Linux 5.4 (64-bit)", VirtualMachineGuestOsIdentifier.RHEL_5_64_GUEST);
         s_mapper.put("Red Hat Enterprise Linux 6.0 (32-bit)", VirtualMachineGuestOsIdentifier.RHEL_6_GUEST);
-        s_mapper.put("Red Hat Enterprise Linux 6.0 (64-bit)", VirtualMachineGuestOsIdentifier.RHEL_6_64_GUEST);		
+        s_mapper.put("Red Hat Enterprise Linux 6.0 (64-bit)", VirtualMachineGuestOsIdentifier.RHEL_6_64_GUEST);
 
 		s_mapper.put("Ubuntu 8.04 (32-bit)", VirtualMachineGuestOsIdentifier.UBUNTU_GUEST);
 		s_mapper.put("Ubuntu 8.04 (64-bit)", VirtualMachineGuestOsIdentifier.UBUNTU_64_GUEST);
@@ -172,7 +173,7 @@ public class VmwareGuestOsMapper {
 		s_mapper.put("Ubuntu 10.10 (32-bit)", VirtualMachineGuestOsIdentifier.UBUNTU_GUEST);
 		s_mapper.put("Ubuntu 10.10 (64-bit)", VirtualMachineGuestOsIdentifier.UBUNTU_64_GUEST);
         s_mapper.put("Ubuntu 12.04 (32-bit)", VirtualMachineGuestOsIdentifier.UBUNTU_GUEST);
-        s_mapper.put("Ubuntu 12.04 (64-bit)", VirtualMachineGuestOsIdentifier.UBUNTU_64_GUEST);		
+        s_mapper.put("Ubuntu 12.04 (64-bit)", VirtualMachineGuestOsIdentifier.UBUNTU_64_GUEST);
 		s_mapper.put("Other Ubuntu (32-bit)", VirtualMachineGuestOsIdentifier.UBUNTU_GUEST);
 		s_mapper.put("Other Ubuntu (64-bit)", VirtualMachineGuestOsIdentifier.UBUNTU_64_GUEST);
 


[09/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
Fix the developer database simulator deploy procedure so it includes the mysql database driver
(cherry picked from commit f5aeac845df8b73b1525442461a8a811e61439d0)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: f31ac2a142c417d011fe05fdede7b451a0103fb8
Parents: 3cd33f6
Author: John Kinsella <jl...@stratosec.co>
Authored: Wed Feb 26 09:04:56 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:40:18 2014 -0800

----------------------------------------------------------------------
 developer/pom.xml | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f31ac2a1/developer/pom.xml
----------------------------------------------------------------------
diff --git a/developer/pom.xml b/developer/pom.xml
index a0b60c6..cf89fd6 100644
--- a/developer/pom.xml
+++ b/developer/pom.xml
@@ -182,6 +182,12 @@
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>exec-maven-plugin</artifactId>
+            <dependencies>
+              <dependency>
+                <groupId>mysql</groupId>
+                <artifactId>mysql-connector-java</artifactId>
+                <version>${cs.mysql.version}</version>
+              </dependency>
             <version>1.2.1</version>
             <executions>
               <execution>
@@ -194,6 +200,7 @@
             </executions>
             <configuration>
               <mainClass>com.cloud.upgrade.DatabaseCreator</mainClass>
+              <includePluginDependencies>true</includePluginDependencies>
               <arguments>
                 <!-- db properties file -->
                 <argument>${basedir}/../utils/conf/db.properties</argument>


[14/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6162:support OVS as connectivity service provider

adds 'Ovs' as network service provider in the physical network
(cherry picked from commit b8c4ed435abc26950e36e21f9d482639b6691206)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: a8a36de4c8b543971ea97a24195a55101f472ed3
Parents: 2d35096
Author: Murali Reddy <mu...@gmail.com>
Authored: Thu Feb 27 17:27:07 2014 +0530
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:41:52 2014 -0800

----------------------------------------------------------------------
 server/src/com/cloud/network/NetworkServiceImpl.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a8a36de4/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index 270ff7b..c3bf72a 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -2503,9 +2503,8 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
                     addDefaultInternalLbProviderToPhysicalNetwork(pNetwork.getId());
 
                     // Add OVS provider as default network service provider
-                    if (pNetwork.getIsolationMethods().contains("GRE")) {
-                        addDefaultOvsToPhysicalNetwork(pNetwork.getId());
-                    }
+                    addDefaultOvsToPhysicalNetwork(pNetwork.getId());
+
 
                     return pNetwork;
                 }


[13/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
BUG-ID: CLOUDSTACK-6162: UI > zone > physical network > service provider > add OVS.
Reviewed-by: Brian
(cherry picked from commit 82121a214926fe3ace33183da9e76e0c13c5e203)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: 2d350960bd68435eeed1d59f50427ca35aac5090
Parents: ecddd70
Author: Jessica Wang <je...@apache.org>
Authored: Wed Feb 26 15:56:30 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:41:31 2014 -0800

----------------------------------------------------------------------
 ui/scripts/system.js | 133 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 133 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2d350960/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 500a339..9ba2597 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -192,6 +192,16 @@
         return allowedActions;
     };
 
+    function ovsProviderActionFilter(args) {
+        var allowedActions = [];
+        var jsonObj = args.context.item; //args.context.item == nspMap["virtualRouter"]
+        if (jsonObj.state == "Enabled")
+            allowedActions.push("disable");
+        else if (jsonObj.state == "Disabled")
+            allowedActions.push("enable");
+        return allowedActions;
+    };
+    
     cloudStack.sections.system = {
         title: 'label.menu.infrastructure',
         id: 'system',
@@ -3858,6 +3868,120 @@
                         }
                     },
 
+                    OVS: {
+                        id: "OVS",
+                        label: "OVS",
+                        isMaximized: true,
+                        type: 'detailView',
+                        fields: {
+                            name: {
+                                label: 'label.name'
+                            },                          
+                            state: {
+                                label: 'label.status',
+                                indicator: {
+                                    'Enabled': 'on'
+                                }
+                            }
+                        },
+                        tabs: {
+                            network: {
+                                title: 'label.network',
+                                fields: [{
+                                    name: {
+                                        label: 'label.name'
+                                    }
+                                }, {                                    
+                                    state: {
+                                        label: 'label.state'
+                                    },                                                                      
+                                    supportedServices: {
+                                        label: 'label.supported.services'
+                                    },
+                                    id: {
+                                        label: 'label.id'
+                                    },
+                                    physicalnetworkid: {
+                                        label: 'label.physical.network.ID'
+                                    }
+                                }],
+                                dataProvider: function(args) {
+                                    refreshNspData("OVS");
+                                    args.response.success({
+                                        actionFilter: ovsProviderActionFilter,
+                                        data: $.extend(nspMap["OVS"], {
+                                            supportedServices: nspMap["OVS"] == undefined? "": nspMap["OVS"].servicelist.join(', ')
+                                        })
+                                    });
+                                }
+                            },
+                        },
+                        actions: {
+                            enable: {
+                                label: 'label.enable.provider',
+                                action: function(args) {
+                                    $.ajax({
+                                        url: createURL("updateNetworkServiceProvider&id=" + nspMap["OVS"].id + "&state=Enabled"),
+                                        dataType: "json",
+                                        success: function(json) {
+                                            var jid = json.updatenetworkserviceproviderresponse.jobid;
+                                            args.response.success({
+                                                _custom: {
+                                                    jobId: jid,
+                                                    getUpdatedItem: function(json) {
+                                                        $(window).trigger('cloudStack.fullRefresh');
+                                                    }
+                                                }
+                                            });
+                                        }
+                                    });
+                                },
+                                messages: {
+                                    confirm: function(args) {
+                                        return 'message.confirm.enable.provider';
+                                    },
+                                    notification: function() {
+                                        return 'label.enable.provider';
+                                    }
+                                },
+                                notification: {
+                                    poll: pollAsyncJobResult
+                                }
+                            },
+                            disable: {
+                                label: 'label.disable.provider',
+                                action: function(args) {
+                                    $.ajax({
+                                        url: createURL("updateNetworkServiceProvider&id=" + nspMap["OVS"].id + "&state=Disabled"),
+                                        dataType: "json",
+                                        success: function(json) {
+                                            var jid = json.updatenetworkserviceproviderresponse.jobid;
+                                            args.response.success({
+                                                _custom: {
+                                                    jobId: jid,
+                                                    getUpdatedItem: function(json) {
+                                                        $(window).trigger('cloudStack.fullRefresh');
+                                                    }
+                                                }
+                                            });
+                                        }
+                                    });
+                                },
+                                messages: {
+                                    confirm: function(args) {
+                                        return 'message.confirm.disable.provider';
+                                    },
+                                    notification: function() {
+                                        return 'label.disable.provider';
+                                    }
+                                },
+                                notification: {
+                                    poll: pollAsyncJobResult
+                                }
+                            }
+                        }
+                    },                    
+                   
                     // NetScaler provider detail view
                     netscaler: {
                         type: 'detailView',
@@ -17999,6 +18123,9 @@
                             case "VpcVirtualRouter":
                                 nspMap["vpcVirtualRouter"] = items[i];
                                 break;
+                            case "OVS":
+                                nspMap["OVS"] = items[i];
+                                break;      
                             case "Netscaler":
                                 nspMap["netscaler"] = items[i];
                                 break;
@@ -18107,6 +18234,12 @@
                 state: nspMap.pa ? nspMap.pa.state : 'Disabled'
             });
         }
+        
+        nspHardcodingArray.push({
+            id: 'OVS',
+            name: 'OVS',
+            state: nspMap.OVS ? nspMap.OVS.state : 'Disabled'
+        });        
     };
 
     cloudStack.actionFilter.physicalNetwork = function(args) {


[19/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6187: Fixed MigrateSystemVMCmd response for router
(cherry picked from commit 37ce4e52c28081a0c718ca87fdbff79935074b75)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: a1000b99ff5e91cac8c8d1a70a51f09b0850d2a8
Parents: 86643d6
Author: Jayapal <ja...@apache.org>
Authored: Fri Feb 28 11:01:43 2014 +0530
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:43:21 2014 -0800

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiResponseHelper.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1000b99/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 5bd8241..e543d1c 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -1127,7 +1127,7 @@ public class ApiResponseHelper implements ResponseGenerator {
     @Override
     public SystemVmResponse createSystemVmResponse(VirtualMachine vm) {
         SystemVmResponse vmResponse = new SystemVmResponse();
-        if (vm.getType() == Type.SecondaryStorageVm || vm.getType() == Type.ConsoleProxy) {
+        if (vm.getType() == Type.SecondaryStorageVm || vm.getType() == Type.ConsoleProxy || vm.getType() == Type.DomainRouter) {
             // SystemVm vm = (SystemVm) systemVM;
             vmResponse.setId(vm.getUuid());
             // vmResponse.setObjectId(vm.getId());


[16/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6162: UI > zone > physical network > service provider > OVS > match provider name "Ovs" in listNetworkServiceProviders API response.
(cherry picked from commit 930acdde3d9c9a6ef1db90ae2f6ba3a9d8f15959)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: e9a3d412850c86b21b8d8b8be373a57a132c0312
Parents: 2457a92
Author: Jessica Wang <je...@apache.org>
Authored: Thu Feb 27 11:40:15 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:42:24 2014 -0800

----------------------------------------------------------------------
 ui/scripts/system.js | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9a3d412/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 9ba2597..0c56baf 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -3868,9 +3868,9 @@
                         }
                     },
 
-                    OVS: {
-                        id: "OVS",
-                        label: "OVS",
+                    Ovs: {
+                        id: "Ovs",
+                        label: "Ovs",
                         isMaximized: true,
                         type: 'detailView',
                         fields: {
@@ -3906,11 +3906,11 @@
                                     }
                                 }],
                                 dataProvider: function(args) {
-                                    refreshNspData("OVS");
+                                    refreshNspData("Ovs");
                                     args.response.success({
                                         actionFilter: ovsProviderActionFilter,
-                                        data: $.extend(nspMap["OVS"], {
-                                            supportedServices: nspMap["OVS"] == undefined? "": nspMap["OVS"].servicelist.join(', ')
+                                        data: $.extend(nspMap["Ovs"], {
+                                            supportedServices: nspMap["Ovs"] == undefined? "": nspMap["Ovs"].servicelist.join(', ')
                                         })
                                     });
                                 }
@@ -3921,7 +3921,7 @@
                                 label: 'label.enable.provider',
                                 action: function(args) {
                                     $.ajax({
-                                        url: createURL("updateNetworkServiceProvider&id=" + nspMap["OVS"].id + "&state=Enabled"),
+                                        url: createURL("updateNetworkServiceProvider&id=" + nspMap["Ovs"].id + "&state=Enabled"),
                                         dataType: "json",
                                         success: function(json) {
                                             var jid = json.updatenetworkserviceproviderresponse.jobid;
@@ -3952,7 +3952,7 @@
                                 label: 'label.disable.provider',
                                 action: function(args) {
                                     $.ajax({
-                                        url: createURL("updateNetworkServiceProvider&id=" + nspMap["OVS"].id + "&state=Disabled"),
+                                        url: createURL("updateNetworkServiceProvider&id=" + nspMap["Ovs"].id + "&state=Disabled"),
                                         dataType: "json",
                                         success: function(json) {
                                             var jid = json.updatenetworkserviceproviderresponse.jobid;
@@ -18123,8 +18123,8 @@
                             case "VpcVirtualRouter":
                                 nspMap["vpcVirtualRouter"] = items[i];
                                 break;
-                            case "OVS":
-                                nspMap["OVS"] = items[i];
+                            case "Ovs":
+                                nspMap["Ovs"] = items[i];
                                 break;      
                             case "Netscaler":
                                 nspMap["netscaler"] = items[i];
@@ -18236,9 +18236,9 @@
         }
         
         nspHardcodingArray.push({
-            id: 'OVS',
-            name: 'OVS',
-            state: nspMap.OVS ? nspMap.OVS.state : 'Disabled'
+            id: "Ovs",
+            name: "Ovs",
+            state: nspMap.Ovs ? nspMap.Ovs.state : 'Disabled'
         });        
     };
 


[15/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6184: for userVm/ServiceOffering/StoragePool details set display=true by default in the VO objects
(cherry picked from commit 531a4ecc457ee3abfdc3f3ef1073895e482e5433)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: 2457a92599c2df4003d4f9c24673658ea421e9c4
Parents: a8a36de
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Thu Feb 27 10:47:38 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:42:09 2014 -0800

----------------------------------------------------------------------
 engine/schema/src/com/cloud/service/ServiceOfferingDetailsVO.java  | 2 +-
 engine/schema/src/com/cloud/vm/UserVmDetailVO.java                 | 2 +-
 .../cloudstack/storage/datastore/db/StoragePoolDetailVO.java       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2457a925/engine/schema/src/com/cloud/service/ServiceOfferingDetailsVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/service/ServiceOfferingDetailsVO.java b/engine/schema/src/com/cloud/service/ServiceOfferingDetailsVO.java
index 4ab3134..e044738 100644
--- a/engine/schema/src/com/cloud/service/ServiceOfferingDetailsVO.java
+++ b/engine/schema/src/com/cloud/service/ServiceOfferingDetailsVO.java
@@ -43,7 +43,7 @@ public class ServiceOfferingDetailsVO implements ResourceDetail {
     private String value;
     
     @Column(name="display")
-    boolean display;
+    boolean display = true;
 
     protected ServiceOfferingDetailsVO() {
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2457a925/engine/schema/src/com/cloud/vm/UserVmDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/UserVmDetailVO.java b/engine/schema/src/com/cloud/vm/UserVmDetailVO.java
index 82bf32d..84a11f6 100644
--- a/engine/schema/src/com/cloud/vm/UserVmDetailVO.java
+++ b/engine/schema/src/com/cloud/vm/UserVmDetailVO.java
@@ -43,7 +43,7 @@ public class UserVmDetailVO implements ResourceDetail {
     private String value;
     
     @Column(name="display")
-    private boolean display;
+    private boolean display = true;
     
     public UserVmDetailVO() {}
     

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2457a925/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java
index 5968fd2..ee22d74 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java
@@ -43,7 +43,7 @@ public class StoragePoolDetailVO implements ResourceDetail {
     String value;
 
     @Column(name="display")
-    private boolean display;
+    private boolean display = true;
     
     public StoragePoolDetailVO(long poolId, String name, String value) {
         this.resourceId = poolId;


[04/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6154: UI > compute offerings > memory field > check if value is undefined before converting it.
(cherry picked from commit d1440217e9a44b6c12b588cbdca52daac6335d0c)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: bb540994351f93c93958a1fe3bd23e1d387d2d51
Parents: a652737
Author: Jessica Wang <je...@apache.org>
Authored: Fri Feb 21 14:01:52 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:38:26 2014 -0800

----------------------------------------------------------------------
 ui/scripts/configuration.js   | 6 ++++++
 ui/scripts/sharedFunctions.js | 3 +++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bb540994/ui/scripts/configuration.js
----------------------------------------------------------------------
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index 420cb7b..e52f519 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -522,6 +522,9 @@
                                     memory: {
                                         label: 'label.memory.mb',
                                         converter: function(args) {
+                                    	    if (args == undefined)
+                                    	    	return '';
+                                    	    else                                     	
                                             return cloudStack.converters.convertBytes(args * 1024 * 1024);
                                         }
                                     },
@@ -1038,6 +1041,9 @@
                                     memory: {
                                         label: 'label.memory.mb',
                                         converter: function(args) {
+                                    	    if (args == undefined)
+                                	    	    return '';
+                                	        else 
                                             return cloudStack.converters.convertBytes(args * 1024 * 1024);
                                         }
                                     },

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bb540994/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 2a15967..9fa70e3 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -900,6 +900,9 @@ var roleTypeDomainAdmin = "2";
 
 cloudStack.converters = {
     convertBytes: function(bytes) {
+	    if (bytes == undefined)
+	    	return '';
+	
         if (bytes < 1024 * 1024) {
             return (bytes / 1024).toFixed(2) + " KB";
         } else if (bytes < 1024 * 1024 * 1024) {


[20/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6186: Unable to register private template across all Zones - crosszones flag no longer works. This was because the code skipped the loop after the first download initiation. Introduced a set so that if it is already downloaded to the same zone then skip it for private template. Reviewed-by: Min
(cherry picked from commit 258d8e2a0494ec8772d9238511fe5f8c6bf0ea01)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: 3297fccea5edf1d37c12fe25e2697acf39f754c9
Parents: a1000b9
Author: Nitin Mehta <ni...@citrix.com>
Authored: Fri Feb 28 10:42:24 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:43:45 2014 -0800

----------------------------------------------------------------------
 .../template/HypervisorTemplateAdapter.java     | 25 ++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3297fcce/server/src/com/cloud/template/HypervisorTemplateAdapter.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/HypervisorTemplateAdapter.java b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
index c6bb617..258528a 100755
--- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java
+++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
@@ -19,7 +19,9 @@ package com.cloud.template;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.ExecutionException;
 
 import javax.ejb.Local;
@@ -187,7 +189,8 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
             throw new CloudRuntimeException("Unable to find image store to download template "+ profile.getTemplate());
         }
 
-        Collections.shuffle(imageStores);// For private templates choose a random store. TODO - Have a better algorithm based on size, no. of objects, load etc.
+        Set<Long> zoneSet = new HashSet<Long>();
+        Collections.shuffle(imageStores); // For private templates choose a random store. TODO - Have a better algorithm based on size, no. of objects, load etc.
         for (DataStore imageStore : imageStores) {
             // skip data stores for a disabled zone
             Long zoneId = imageStore.getScope().getScopeId();
@@ -203,6 +206,14 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
                     s_logger.info("Zone " + zoneId + " is disabled, so skip downloading template to its image store " + imageStore.getId());
                     continue;
                 }
+
+                // We want to download private template to one of the image store in a zone
+                if(isPrivateTemplate(template) && zoneSet.contains(zoneId)){
+                    continue;
+                }else {
+                    zoneSet.add(zoneId);
+                }
+
             }
 
             TemplateInfo tmpl = imageFactory.getTemplate(template.getId(), imageStore);
@@ -211,15 +222,21 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
             caller.setCallback(caller.getTarget().createTemplateAsyncCallBack(null, null));
             caller.setContext(context);
             imageService.createTemplateAsync(tmpl, imageStore, caller);
-            if( !(profile.getIsPublic() || profile.getFeatured()) ){  // If private template then break
-                break;
-            }
         }
         _resourceLimitMgr.incrementResourceCount(profile.getAccountId(), ResourceType.template);
 
         return template;
     }
 
+    private boolean isPrivateTemplate(VMTemplateVO template){
+
+        // if public OR featured OR system template
+        if(template.isPublicTemplate() || template.isFeatured() || template.getTemplateType() == TemplateType.SYSTEM)
+            return false;
+        else
+            return true;
+    }
+
     private class CreateTemplateContext<T> extends AsyncRpcContext<T> {
         final TemplateInfo template;
         public CreateTemplateContext(AsyncCompletionCallback<T> callback, TemplateInfo template) {


[08/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6146. [VMware] [ESXi 5.5] Live VM migration of an already migrated VM (with storage) across clusters fails
In vCenter 5.5, once a volume is migrated the VMDKs are renamed to match the name of the VM.
Update volume path for every volume belonging to the VM to the corresponding new disk filename.
(cherry picked from commit 8cb03ddb2387c7aebf20dc0aa011e41f227e9f68)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: 3cd33f6f4ad756e61c1088d26f7e6b281638f219
Parents: e63af74
Author: Likitha Shetty <li...@citrix.com>
Authored: Tue Feb 25 18:10:52 2014 +0530
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:39:44 2014 -0800

----------------------------------------------------------------------
 .../vmware/resource/VmwareResource.java         | 25 ++++++++++++--
 .../motion/VmwareStorageMotionStrategy.java     | 36 +++++++++++++-------
 2 files changed, 45 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3cd33f6f/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 d27d81f..9f5cf04 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
@@ -4338,6 +4338,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         VolumeTO volume;
         StorageFilerTO filerTo;
         Set<String> mountedDatastoresAtSource = new HashSet<String>();
+        List<VolumeObjectTO> volumeToList =  new ArrayList<VolumeObjectTO>();
+        Map<Long, Integer> volumeDeviceKey = new HashMap<Long, Integer>();
 
         Map<VolumeTO, StorageFilerTO> volToFiler = cmd.getVolumeToFiler();
         String tgtHost = cmd.getTargetHost();
@@ -4402,9 +4404,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                         volume.getPath() + ".vmdk");
                 diskLocator = new VirtualMachineRelocateSpecDiskLocator();
                 diskLocator.setDatastore(morDsAtSource);
-                diskLocator.setDiskId(getVirtualDiskInfo(vmMo, volume.getPath() + ".vmdk"));
+                int diskId = getVirtualDiskInfo(vmMo, volume.getPath() + ".vmdk");
+                diskLocator.setDiskId(diskId);
 
                 diskLocators.add(diskLocator);
+                volumeDeviceKey.put(volume.getId(), diskId);
 
             }
             relocateSpec.getDisk().addAll(diskLocators);
@@ -4436,6 +4440,22 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                 s_logger.debug("Successfully migrated storage of VM " + vmName + " to target datastore(s)");
             }
 
+            // Update and return volume path for every disk because that could have changed after migration
+            for (Entry<VolumeTO, StorageFilerTO> entry : volToFiler.entrySet()) {
+                volume = entry.getKey();
+                long volumeId = volume.getId();
+                VirtualDisk[] disks = vmMo.getAllDiskDevice();
+                for (VirtualDisk disk : disks) {
+                    if (volumeDeviceKey.get(volumeId) == disk.getKey()) {
+                        VolumeObjectTO newVol = new VolumeObjectTO();
+                        newVol.setId(volumeId);
+                        newVol.setPath(vmMo.getVmdkFileBaseName(disk));
+                        volumeToList.add(newVol);
+                        break;
+                    }
+                }
+            }
+
             // Change host
             ManagedObjectReference morPool = tgtHyperHost.getHyperHostOwnerResourcePool();
             if (!vmMo.migrate(morPool, tgtHyperHost.getMor())) {
@@ -4445,7 +4465,6 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             }
 
             state = State.Stopping;
-            List<VolumeObjectTO> volumeToList = null;
             return new MigrateWithStorageAnswer(cmd, volumeToList);
         } catch (Throwable e) {
             if (e instanceof RemoteException) {
@@ -4552,7 +4571,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
     }
 
     private int getVirtualDiskInfo(VirtualMachineMO vmMo, String srcDiskName) throws Exception {
-        Pair<VirtualDisk, String> deviceInfo = vmMo.getDiskDevice(srcDiskName, false);
+        Pair<VirtualDisk, String> deviceInfo = vmMo.getDiskDevice(srcDiskName, true);
         if(deviceInfo == null) {
             throw new Exception("No such disk device: " + srcDiskName);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3cd33f6f/plugins/hypervisors/vmware/src/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java b/plugins/hypervisors/vmware/src/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java
index 446093f..3c4d704 100644
--- a/plugins/hypervisors/vmware/src/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java
+++ b/plugins/hypervisors/vmware/src/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java
@@ -20,6 +20,7 @@
 package org.apache.cloudstack.storage.motion;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.inject.Inject;
@@ -33,6 +34,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory;
 import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
+import org.apache.cloudstack.storage.to.VolumeObjectTO;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
@@ -143,7 +145,7 @@ public class VmwareStorageMotionStrategy implements DataMotionStrategy {
                         ". " + migrateWithStorageAnswer.getDetails());
             } else {
                 // Update the volume details after migration.
-                updateVolumesAfterMigration(volumeToPool);
+                updateVolumesAfterMigration(volumeToPool, migrateWithStorageAnswer.getVolumeTos());
             }
             s_logger.debug("Storage migration of VM " + vm.getInstanceName() + " completed successfully. Migrated to host " + destHost.getName());
 
@@ -178,7 +180,7 @@ public class VmwareStorageMotionStrategy implements DataMotionStrategy {
                         ". " + answer.getDetails());
             } else {
                 // Update the volume details after migration.
-                updateVolumesAfterMigration(volumeToPool);
+                updateVolumesAfterMigration(volumeToPool, answer.getVolumeTos());
             }
 
             return answer;
@@ -188,20 +190,28 @@ public class VmwareStorageMotionStrategy implements DataMotionStrategy {
         }
     }
 
-    private void updateVolumesAfterMigration(Map<VolumeInfo, DataStore> volumeToPool) {
+    private void updateVolumesAfterMigration(Map<VolumeInfo, DataStore> volumeToPool, List<VolumeObjectTO> volumeTos) {
         for (Map.Entry<VolumeInfo, DataStore> entry : volumeToPool.entrySet()) {
+            boolean updated = false;
             VolumeInfo volume = entry.getKey();
             StoragePool pool = (StoragePool)entry.getValue();
-
-            VolumeVO volumeVO = volDao.findById(volume.getId());
-            Long oldPoolId = volumeVO.getPoolId();
-            volumeVO.setLastPoolId(oldPoolId);
-            volumeVO.setFolder(pool.getPath());
-            volumeVO.setPodId(pool.getPodId());
-            volumeVO.setPoolId(pool.getId());
-
-            volDao.update(volume.getId(), volumeVO);
-            s_logger.debug("Volume path was successfully updated for volume " + volume.getName() + " after it was migrated.");
+            for (VolumeObjectTO volumeTo : volumeTos) {
+                if (volume.getId() == volumeTo.getId()) {
+                    VolumeVO volumeVO = volDao.findById(volume.getId());
+                    Long oldPoolId = volumeVO.getPoolId();
+                    volumeVO.setPath(volumeTo.getPath());
+                    volumeVO.setLastPoolId(oldPoolId);
+                    volumeVO.setFolder(pool.getPath());
+                    volumeVO.setPodId(pool.getPodId());
+                    volumeVO.setPoolId(pool.getId());
+                    volDao.update(volume.getId(), volumeVO);
+                    updated = true;
+                    break;
+                }
+            }
+            if (!updated) {
+                s_logger.error("Volume path wasn't updated for volume " + volume + " after it was migrated.");
+            }
         }
     }
 }


[02/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6124: During MS maintenance unfinished work items are not cleaned up resulting in them getting repeated for every subsequent maintenance
Updating the op_it_work table entry appropriately in db once the unfinished work item is completed.
(cherry picked from commit c6a8659ac2c2c85c6f0e9fb8af11606aaa2f9a37)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: 360b7e3b29061d88572a609bc5be7f3c7320f64a
Parents: 26002ae
Author: Koushik Das <ko...@apache.org>
Authored: Fri Feb 21 16:16:52 2014 +0530
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:37:42 2014 -0800

----------------------------------------------------------------------
 .../orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java  | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/360b7e3b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index e533386..bcfe3b4 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -2129,10 +2129,12 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
                                 if (work.getType() == State.Starting) {
                                     _haMgr.scheduleRestart(vm, true);
                                     work.setManagementServerId(_nodeId);
+                                    work.setStep(Step.Done);
                                     _workDao.update(work.getId(), work);
                                 } else if (work.getType() == State.Stopping) {
                                     _haMgr.scheduleStop(vm, vm.getHostId(), WorkType.CheckStop);
                                     work.setManagementServerId(_nodeId);
+                                    work.setStep(Step.Done);
                                     _workDao.update(work.getId(), work);
                                 } else if (work.getType() == State.Migrating) {
                                     _haMgr.scheduleMigration(vm);


[17/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CS-19377
[Baremetal] After deploy VM on Baremetal host, BM host fail to be PXE booted
(cherry picked from commit 793a6a7177e7b2737b01c328951c86da1ba1808b)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: 9e1525c0321d61357fa2c51d45cf8ee78ded5dbf
Parents: e9a3d41
Author: frank <fr...@citrix.com>
Authored: Thu Feb 27 15:17:38 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:42:37 2014 -0800

----------------------------------------------------------------------
 .../networkservice/BaremetalDhcpElement.java          | 14 +++++++++++---
 .../networkservice/BaremetalDhcpManagerImpl.java      |  7 +++----
 2 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e1525c0/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpElement.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpElement.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpElement.java
index 8057cd4..b3fdab5 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpElement.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpElement.java
@@ -25,6 +25,8 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
+import com.cloud.network.dao.PhysicalNetworkDao;
+import com.cloud.network.dao.PhysicalNetworkVO;
 import org.apache.log4j.Logger;
 
 import com.cloud.baremetal.database.BaremetalDhcpVO;
@@ -64,12 +66,14 @@ public class BaremetalDhcpElement extends AdapterBase implements DhcpServiceProv
     
     @Inject NicDao _nicDao;
     @Inject BaremetalDhcpManager _dhcpMgr;
+    @Inject
+    PhysicalNetworkDao phyNwDao;
     
     static {
         Capability cap = new Capability(BaremetalDhcpManager.BAREMETAL_DHCP_SERVICE_CAPABITLITY);
         Map<Capability, String> baremetalCaps = new HashMap<Capability, String>();
-        baremetalCaps.put(cap, null);
-        baremetalCaps.put(Capability.DhcpAccrossMultipleSubnets, Boolean.TRUE.toString());
+        baremetalCaps.put(cap, null);
+        baremetalCaps.put(Capability.DhcpAccrossMultipleSubnets, Boolean.TRUE.toString());
         capabilities = new HashMap<Service, Map<Capability, String>>();
         capabilities.put(Service.Dhcp, baremetalCaps);
     }
@@ -87,8 +91,12 @@ public class BaremetalDhcpElement extends AdapterBase implements DhcpServiceProv
     private boolean canHandle(DeployDestination dest, TrafficType trafficType, GuestType networkType) {
         Pod pod = dest.getPod();
         if (pod != null && dest.getDataCenter().getNetworkType() == NetworkType.Basic && trafficType == TrafficType.Guest) {
+            QueryBuilder<PhysicalNetworkVO> phyq = QueryBuilder.create(PhysicalNetworkVO.class);
+            phyq.and(phyq.entity().getDataCenterId(), Op.EQ, dest.getDataCenter().getId());
+            PhysicalNetworkVO phynw = phyq.find();
+
             QueryBuilder<BaremetalDhcpVO> sc = QueryBuilder.create(BaremetalDhcpVO.class);
-            sc.and(sc.entity().getPodId(), Op.EQ,pod.getId());
+            sc.and(sc.entity().getPhysicalNetworkId(), Op.EQ, phynw.getId());
             return sc.find() != null;
         }
         

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e1525c0/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
index 82397f5..e507b4d 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
@@ -133,14 +133,13 @@ public class BaremetalDhcpManagerImpl extends ManagerBase implements BaremetalDh
     public boolean addVirtualMachineIntoNetwork(Network network, NicProfile nic, VirtualMachineProfile profile,
             DeployDestination dest, ReservationContext context) throws ResourceUnavailableException {
         Long zoneId = profile.getVirtualMachine().getDataCenterId();
-        Long podId = profile.getVirtualMachine().getPodIdToDeployIn();
-        List<HostVO> hosts = _resourceMgr.listAllUpAndEnabledHosts(Type.BaremetalDhcp, null, podId, zoneId);
+        List<HostVO> hosts = _resourceMgr.listAllUpAndEnabledHosts(Type.BaremetalDhcp, null, null, zoneId);
         if (hosts.size() == 0) {
-            throw new CloudRuntimeException("No external Dhcp found in zone " + zoneId + " pod " + podId);
+            throw new CloudRuntimeException("No external Dhcp found in zone " + zoneId);
         }
 
         if (hosts.size() > 1) {
-            throw new CloudRuntimeException("Something wrong, more than 1 external Dhcp found in zone " + zoneId + " pod " + podId);
+            throw new CloudRuntimeException("Something wrong, more than 1 external Dhcp found in zone " + zoneId);
         }
 
         HostVO h = hosts.get(0);


[10/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
Last commit broke developer/pom.xml. fixing that.
(cherry picked from commit 54db315214f8dd518eaf1f1615d423d9f4129d31)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: fc35c98472084a4916150c423d469d47a89472c8
Parents: f31ac2a
Author: John Kinsella <jl...@stratosec.co>
Authored: Wed Feb 26 09:33:58 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:40:34 2014 -0800

----------------------------------------------------------------------
 developer/pom.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fc35c984/developer/pom.xml
----------------------------------------------------------------------
diff --git a/developer/pom.xml b/developer/pom.xml
index cf89fd6..7ed6335 100644
--- a/developer/pom.xml
+++ b/developer/pom.xml
@@ -188,6 +188,7 @@
                 <artifactId>mysql-connector-java</artifactId>
                 <version>${cs.mysql.version}</version>
               </dependency>
+	    </dependencies>
             <version>1.2.1</version>
             <executions>
               <execution>


[12/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6175:s3.singleupload.max.size option not applicable for
backup snapshot on KVM.
(cherry picked from commit 94257c0fc85c7178e6ca3146662de08feee2c290)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: ecddd70f90376eb3297a55e0e1021ef783845c7c
Parents: d4a1ada
Author: Min Chen <mi...@citrix.com>
Authored: Wed Feb 26 11:51:24 2014 -0800
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:41:06 2014 -0800

----------------------------------------------------------------------
 .../hypervisor/kvm/storage/KVMStorageProcessor.java  | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ecddd70f/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
index cd57643..8d237cc 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
@@ -18,6 +18,7 @@
  */
 package com.cloud.hypervisor.kvm.storage;
 
+import static com.cloud.utils.S3Utils.mputFile;
 import static com.cloud.utils.S3Utils.putFile;
 
 import java.io.BufferedOutputStream;
@@ -566,13 +567,20 @@ public class KVMStorageProcessor implements StorageProcessor {
     public Answer createTemplateFromSnapshot(CopyCommand cmd) {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
-    protected String copyToS3(File srcFile, S3TO destStore, String destPath) {
+
+    protected String copyToS3(File srcFile, S3TO destStore, String destPath) throws InterruptedException {
         final String bucket = destStore.getBucketName();
 
+        long srcSize = srcFile.length();
         String key = destPath + S3Utils.SEPARATOR + srcFile.getName();
-        putFile(destStore, srcFile, bucket, key);
+        if (!destStore.getSingleUpload(srcSize)) {
+            mputFile(destStore, srcFile, bucket, key);
+        } else {
+            putFile(destStore, srcFile, bucket, key);
+        }
         return key;
     }
+
     protected Answer copyToObjectStore(CopyCommand cmd) {
         DataTO srcData = cmd.getSrcTO();
         DataTO destData = cmd.getDestTO();
@@ -603,6 +611,9 @@ public class KVMStorageProcessor implements StorageProcessor {
             SnapshotObjectTO newSnapshot = new SnapshotObjectTO();
             newSnapshot.setPath(destPath);
             return new CopyCmdAnswer(newSnapshot);
+        } catch (Exception e) {
+            s_logger.error("failed to upload" + srcPath, e);
+            return new CopyCmdAnswer("failed to upload" + srcPath + e.toString());
         } finally {
             try {
                 if (srcFile != null) {


[05/20] git commit: updated refs/heads/4.3 to 3297fcc

Posted by an...@apache.org.
CLOUDSTACK-6159 Fixed creating volumes(Root, DataDisk) with uuid in primary store
(cherry picked from commit b44901c059e50ae34f55a56809cda74d4c0c08f9)

Signed-off-by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/4.3
Commit: 96118e485feb53e8de5c32184e023610dadb5dee
Parents: bb54099
Author: Rajesh Battala <ra...@citrix.com>
Authored: Fri Feb 21 15:47:26 2014 +0530
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Tue Mar 4 23:38:46 2014 -0800

----------------------------------------------------------------------
 .../HypervResource/CloudStackTypes.cs               | 16 ++++++++--------
 .../HypervResource/HypervResourceController.cs      | 10 ++++++----
 2 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96118e48/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
index 9637994..541c205 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
@@ -173,11 +173,11 @@ namespace HypervResource
                     PrimaryDataStoreTO store = this.primaryDataStore;
                     if (store.isLocal)
                     {
-                        fileName = Path.Combine(store.Path, this.name);
+                        fileName = Path.Combine(store.Path, this.uuid);
                     }
                     else
                     {
-                        fileName = @"\\" + store.uri.Host + store.uri.LocalPath + @"\" + this.name;
+                        fileName = @"\\" + store.uri.Host + store.uri.LocalPath + @"\" + this.uuid;
                         fileName = Utils.NormalizePath(fileName);
                     }
                 }
@@ -198,7 +198,7 @@ namespace HypervResource
                         fileName = Utils.NormalizePath(fileName);
                         if (Directory.Exists(fileName))
                         {
-                            fileName = Utils.NormalizePath(fileName + @"\" + this.name);
+                            fileName = Utils.NormalizePath(fileName + @"\" + this.uuid);
                         }
                     }
                 }
@@ -300,11 +300,11 @@ namespace HypervResource
                 path = Utils.NormalizePath(path);
                 if (Directory.Exists(path))
                 {
-                    string[] choices = choices = Directory.GetFiles(path, volInfo.name + ".vhd*");
+                    string[] choices = choices = Directory.GetFiles(path, volInfo.uuid + ".vhd*");
                     if (choices.Length != 1)
                     {
                         String errMsg = "Tried to guess file extension, but cannot find file corresponding to " +
-                            Path.Combine(volInfo.primaryDataStore.Path, volInfo.name);
+                            Path.Combine(volInfo.primaryDataStore.Path, volInfo.uuid);
                         logger.Debug(errMsg);
                     }
                     else
@@ -334,18 +334,18 @@ namespace HypervResource
                     PrimaryDataStoreTO store = this.primaryDataStore;
                     if (store.isLocal)
                     {
-                        fileName = Path.Combine(store.Path, this.name);
+                        fileName = Path.Combine(store.Path, this.uuid);
                     }
                     else
                     {
-                        fileName = @"\\" + store.uri.Host + store.uri.LocalPath + @"\" + this.name;
+                        fileName = @"\\" + store.uri.Host + store.uri.LocalPath + @"\" + this.uuid;
                     }
                     fileName = fileName + '.' + this.format.ToLowerInvariant();
                 }
                 else if (this.nfsDataStoreTO != null)
                 {
                     NFSTO store = this.nfsDataStoreTO;
-                    fileName = store.UncPath + @"\" + this.path + @"\" + this.name;
+                    fileName = store.UncPath + @"\" + this.path + @"\" + this.uuid;
                     if (!this.format.Equals("RAW"))
                     {
                         fileName = fileName + '.' + this.format.ToLowerInvariant();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96118e48/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
index a132606..8fd15f4 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
@@ -1150,13 +1150,13 @@ namespace HypervResource
 
                 bool result = false;
                 string details = null;
-
+                object newData = null;
                 try
                 {
                     VolumeObjectTO volume = VolumeObjectTO.ParseJson(cmd.data);
                     PrimaryDataStoreTO primary = volume.primaryDataStore;
                     ulong volumeSize = volume.size;
-                    string volumeName = volume.name + ".vhd";
+                    string volumeName = volume.uuid + ".vhd";
                     string volumePath = null;
 
                     if (primary.isLocal)
@@ -1169,11 +1169,13 @@ namespace HypervResource
                         volumePath = Utils.NormalizePath(volumePath);
                         Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password);
                     }
-
+                    volume.path = volumePath;
                     wmiCallsV2.CreateDynamicVirtualHardDisk(volumeSize, volumePath);
                     if (File.Exists(volumePath))
                     {
                         result = true;
+                        JObject ansObj = Utils.CreateCloudStackObject(CloudStackTypes.VolumeObjectTO, volume);
+                        newData = ansObj;
                     }
                     else
                     {
@@ -1191,7 +1193,7 @@ namespace HypervResource
                 {
                     result = result,
                     details = details,
-                    data = cmd.data,
+                    data = newData,
                     contextMap = contextMap
                 };