diff --git a/plugins/hypervisors/xenserver/findbugsExcludeFilter.xml b/plugins/hypervisors/xenserver/findbugsExcludeFilter.xml
new file mode 100644
index 00000000000..b341889e9d4
--- /dev/null
+++ b/plugins/hypervisors/xenserver/findbugsExcludeFilter.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/hypervisors/xenserver/pom.xml b/plugins/hypervisors/xenserver/pom.xml
new file mode 100644
index 00000000000..0bdb04afef0
--- /dev/null
+++ b/plugins/hypervisors/xenserver/pom.xml
@@ -0,0 +1,44 @@
+
+
+ 4.0.0
+ cloud-plugin-hypervisor-xenserver
+ Apache CloudStack Plugin - Hypervisor XenServer
+
+ org.apache.cloudstack
+ cloudstack-plugins
+ 4.5.0-SNAPSHOT
+ ../../pom.xml
+
+
+
+ org.apache.cloudstack
+ cloud-engine-storage
+ ${project.version}
+
+
+ org.apache.cloudstack
+ cloud-plugin-network-ovs
+ ${project.version}
+
+
+ org.apache.httpcomponents
+ httpclient
+ compile
+
+
+ net.java.dev.vcc.thirdparty
+ xen-api
+ ${cs.xapi.version}
+
+
+
diff --git a/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-compute/module.properties b/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-compute/module.properties
new file mode 100644
index 00000000000..c6c91f658fc
--- /dev/null
+++ b/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-compute/module.properties
@@ -0,0 +1,18 @@
+# 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.
+name=xenserver-compute
+parent=compute
\ No newline at end of file
diff --git a/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-compute/spring-xenserver-compute-context.xml b/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-compute/spring-xenserver-compute-context.xml
new file mode 100644
index 00000000000..e024ad837c8
--- /dev/null
+++ b/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-compute/spring-xenserver-compute-context.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-discoverer/module.properties b/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-discoverer/module.properties
new file mode 100644
index 00000000000..10d0ecdf729
--- /dev/null
+++ b/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-discoverer/module.properties
@@ -0,0 +1,18 @@
+# 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.
+name=xenserver-discoverer
+parent=discoverer
\ No newline at end of file
diff --git a/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-discoverer/spring-xenserver-discoverer-context.xml b/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-discoverer/spring-xenserver-discoverer-context.xml
new file mode 100644
index 00000000000..767e2d0e9a1
--- /dev/null
+++ b/plugins/hypervisors/xenserver/resources/META-INF/cloudstack/xenserver-discoverer/spring-xenserver-discoverer-context.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/ha/XenServerFencer.java b/plugins/hypervisors/xenserver/src/com/cloud/ha/XenServerFencer.java
new file mode 100755
index 00000000000..28cba2b98c4
--- /dev/null
+++ b/plugins/hypervisors/xenserver/src/com/cloud/ha/XenServerFencer.java
@@ -0,0 +1,129 @@
+// 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.
+package com.cloud.ha;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.agent.AgentManager;
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.FenceAnswer;
+import com.cloud.agent.api.FenceCommand;
+import com.cloud.exception.AgentUnavailableException;
+import com.cloud.exception.OperationTimedoutException;
+import com.cloud.host.Host;
+import com.cloud.host.HostVO;
+import com.cloud.host.Status;
+import com.cloud.host.dao.HostDao;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.resource.ResourceManager;
+import com.cloud.utils.component.AdapterBase;
+import com.cloud.vm.VirtualMachine;
+
+@Local(value = FenceBuilder.class)
+public class XenServerFencer extends AdapterBase implements FenceBuilder {
+ private static final Logger s_logger = Logger.getLogger(XenServerFencer.class);
+
+ @Inject
+ HostDao _hostDao;
+ @Inject
+ AgentManager _agentMgr;
+ @Inject
+ ResourceManager _resourceMgr;
+
+ @Override
+ public Boolean fenceOff(VirtualMachine vm, Host host) {
+ if (host.getHypervisorType() != HypervisorType.XenServer) {
+ s_logger.debug("Don't know how to fence non XenServer hosts " + host.getHypervisorType());
+ return null;
+ }
+
+ List hosts = _resourceMgr.listAllHostsInCluster(host.getClusterId());
+ FenceCommand fence = new FenceCommand(vm, host);
+
+ for (HostVO h : hosts) {
+ if (h.getHypervisorType() == HypervisorType.XenServer) {
+ if (h.getStatus() != Status.Up) {
+ continue;
+ }
+ if (h.getId() == host.getId()) {
+ continue;
+ }
+ FenceAnswer answer;
+ try {
+ Answer ans = _agentMgr.send(h.getId(), fence);
+ if (!(ans instanceof FenceAnswer)) {
+ s_logger.debug("Answer is not fenceanswer. Result = " + ans.getResult() + "; Details = " + ans.getDetails());
+ continue;
+ }
+ answer = (FenceAnswer)ans;
+ } catch (AgentUnavailableException e) {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable");
+ }
+ continue;
+ } catch (OperationTimedoutException e) {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable");
+ }
+ continue;
+ }
+ if (answer != null && answer.getResult()) {
+ return true;
+ }
+ }
+ }
+
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Unable to fence off " + vm.toString() + " on " + host.toString());
+ }
+
+ return false;
+ }
+
+ public XenServerFencer() {
+ super();
+ }
+
+ @Override
+ public boolean configure(String name, Map params) throws ConfigurationException {
+ _name = name;
+ return true;
+ }
+
+ @Override
+ public String getName() {
+ return _name;
+ }
+
+ @Override
+ public boolean start() {
+ return true;
+ }
+
+ @Override
+ public boolean stop() {
+ return true;
+ }
+
+}
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
new file mode 100644
index 00000000000..89e4ab5d94b
--- /dev/null
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
@@ -0,0 +1,160 @@
+// 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.
+package com.cloud.hypervisor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.to.DataObjectType;
+import com.cloud.agent.api.to.DataStoreTO;
+import com.cloud.agent.api.to.DataTO;
+import com.cloud.agent.api.to.DiskTO;
+import com.cloud.agent.api.to.NfsTO;
+import com.cloud.agent.api.to.VirtualMachineTO;
+import com.cloud.host.HostVO;
+import com.cloud.host.dao.HostDao;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.storage.GuestOSVO;
+import com.cloud.storage.VolumeVO;
+import com.cloud.storage.dao.GuestOSDao;
+import com.cloud.storage.dao.VolumeDao;
+import com.cloud.template.VirtualMachineTemplate.BootloaderType;
+import com.cloud.utils.Pair;
+import com.cloud.vm.VirtualMachine;
+import com.cloud.vm.VirtualMachineProfile;
+
+import org.apache.cloudstack.hypervisor.xenserver.XenserverConfigs;
+import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
+import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
+import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory;
+import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
+import org.apache.cloudstack.storage.command.CopyCommand;
+import org.apache.cloudstack.storage.command.DettachCommand;
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
+import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
+
+@Local(value = HypervisorGuru.class)
+public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru {
+ @Inject
+ GuestOSDao _guestOsDao;
+ @Inject
+ EndPointSelector endPointSelector;
+ @Inject
+ HostDao hostDao;
+ @Inject
+ VolumeDao _volumeDao;
+ @Inject
+ PrimaryDataStoreDao _storagePoolDao;
+ @Inject
+ VolumeDataFactory _volFactory;
+
+ protected XenServerGuru() {
+ super();
+ }
+
+ @Override
+ public HypervisorType getHypervisorType() {
+ return HypervisorType.XenServer;
+ }
+
+ @Override
+ public VirtualMachineTO implement(VirtualMachineProfile vm) {
+ BootloaderType bt = BootloaderType.PyGrub;
+ if (vm.getBootLoaderType() == BootloaderType.CD) {
+ bt = vm.getBootLoaderType();
+ }
+ VirtualMachineTO to = toVirtualMachineTO(vm);
+ to.setBootloader(bt);
+
+ // Determine the VM's OS description
+ GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId());
+ to.setOs(guestOS.getDisplayName());
+
+ return to;
+ }
+
+ @Override
+ public boolean trackVmHostChange() {
+ return true;
+ }
+
+ @Override
+ public List finalizeExpungeVolumes(VirtualMachine vm) {
+ List commands = new ArrayList();
+
+ List volumes = _volumeDao.findByInstance(vm.getId());
+
+ // it's OK in this case to send a detach command to the host for a root volume as this
+ // will simply lead to the SR that supports the root volume being removed
+ if (volumes != null) {
+ for (VolumeVO volume : volumes) {
+ StoragePoolVO storagePool = _storagePoolDao.findById(volume.getPoolId());
+
+ // storagePool should be null if we are expunging a volume that was never
+ // attached to a VM that was started (the "trick" for storagePool to be null
+ // is that none of the VMs this volume may have been attached to were ever started,
+ // so the volume was never assigned to a storage pool)
+ if (storagePool != null && storagePool.isManaged()) {
+ DataTO volTO = _volFactory.getVolume(volume.getId()).getTO();
+ DiskTO disk = new DiskTO(volTO, volume.getDeviceId(), volume.getPath(), volume.getVolumeType());
+
+ DettachCommand cmd = new DettachCommand(disk, vm.getInstanceName());
+
+ cmd.setManaged(true);
+
+ cmd.setStorageHost(storagePool.getHostAddress());
+ cmd.setStoragePort(storagePool.getPort());
+
+ cmd.set_iScsiName(volume.get_iScsiName());
+
+ commands.add(cmd);
+ }
+ }
+ }
+
+ return commands;
+ }
+
+ @Override
+ public Pair getCommandHostDelegation(long hostId, Command cmd) {
+ if (cmd instanceof CopyCommand) {
+ CopyCommand cpyCommand = (CopyCommand)cmd;
+ DataTO srcData = cpyCommand.getSrcTO();
+ DataTO destData = cpyCommand.getDestTO();
+
+ if (srcData.getObjectType() == DataObjectType.SNAPSHOT && destData.getObjectType() == DataObjectType.TEMPLATE) {
+ DataStoreTO srcStore = srcData.getDataStore();
+ DataStoreTO destStore = destData.getDataStore();
+ if (srcStore instanceof NfsTO && destStore instanceof NfsTO) {
+ HostVO host = hostDao.findById(hostId);
+ EndPoint ep = endPointSelector.selectHypervisorHost(new ZoneScope(host.getDataCenterId()));
+ host = hostDao.findById(ep.getId());
+ hostDao.loadDetails(host);
+ String snapshotHotFixVersion = host.getDetail(XenserverConfigs.XS620HotFix);
+ if (snapshotHotFixVersion != null && snapshotHotFixVersion.equalsIgnoreCase(XenserverConfigs.XSHotFix62ESP1004)) {
+ return new Pair(Boolean.TRUE, new Long(ep.getId()));
+ }
+ }
+ }
+ }
+ return new Pair(Boolean.FALSE, new Long(hostId));
+ }
+}
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
new file mode 100755
index 00000000000..630edb5038d
--- /dev/null
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
@@ -0,0 +1,726 @@
+// 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.
+package com.cloud.hypervisor.xenserver.discoverer;
+
+import java.net.InetAddress;
+import java.net.URI;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Queue;
+import java.util.Set;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import javax.persistence.EntityExistsException;
+
+import org.apache.log4j.Logger;
+import org.apache.xmlrpc.XmlRpcException;
+
+import com.cloud.agent.AgentManager;
+import com.cloud.agent.Listener;
+import com.cloud.agent.api.AgentControlAnswer;
+import com.cloud.agent.api.AgentControlCommand;
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.SetupAnswer;
+import com.cloud.agent.api.SetupCommand;
+import com.cloud.agent.api.StartupCommand;
+import com.cloud.agent.api.StartupRoutingCommand;
+import com.cloud.alert.AlertManager;
+import com.cloud.configuration.Config;
+import com.cloud.dc.ClusterVO;
+import com.cloud.dc.DataCenterVO;
+import com.cloud.dc.HostPodVO;
+import com.cloud.dc.dao.HostPodDao;
+import com.cloud.exception.AgentUnavailableException;
+import com.cloud.exception.ConnectionException;
+import com.cloud.exception.DiscoveredWithErrorException;
+import com.cloud.exception.DiscoveryException;
+import com.cloud.exception.OperationTimedoutException;
+import com.cloud.host.HostEnvironment;
+import com.cloud.host.HostInfo;
+import com.cloud.host.HostVO;
+import com.cloud.host.Status;
+import com.cloud.hypervisor.Hypervisor;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
+import com.cloud.hypervisor.xenserver.resource.XcpOssResource;
+import com.cloud.hypervisor.xenserver.resource.XcpServer16Resource;
+import com.cloud.hypervisor.xenserver.resource.XcpServerResource;
+import com.cloud.hypervisor.xenserver.resource.XenServer56FP1Resource;
+import com.cloud.hypervisor.xenserver.resource.XenServer56Resource;
+import com.cloud.hypervisor.xenserver.resource.XenServer56SP2Resource;
+import com.cloud.hypervisor.xenserver.resource.XenServer600Resource;
+import com.cloud.hypervisor.xenserver.resource.XenServer602Resource;
+import com.cloud.hypervisor.xenserver.resource.XenServer610Resource;
+import com.cloud.hypervisor.xenserver.resource.XenServer620Resource;
+import com.cloud.hypervisor.xenserver.resource.XenServer620SP1Resource;
+import com.cloud.hypervisor.xenserver.resource.XenServerConnectionPool;
+import com.cloud.hypervisor.xenserver.resource.Xenserver625Resource;
+import org.apache.cloudstack.hypervisor.xenserver.XenserverConfigs;
+import com.cloud.resource.Discoverer;
+import com.cloud.resource.DiscovererBase;
+import com.cloud.resource.ResourceStateAdapter;
+import com.cloud.resource.ServerResource;
+import com.cloud.resource.UnableDeleteHostException;
+import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.storage.Storage.TemplateType;
+import com.cloud.storage.VMTemplateVO;
+import com.cloud.storage.dao.VMTemplateDao;
+import com.cloud.user.Account;
+import com.cloud.utils.NumbersUtil;
+import com.cloud.utils.db.QueryBuilder;
+import com.cloud.utils.db.SearchCriteria.Op;
+import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.exception.HypervisorVersionChangedException;
+import com.xensource.xenapi.Connection;
+import com.xensource.xenapi.Host;
+import com.xensource.xenapi.Pool;
+import com.xensource.xenapi.Session;
+import com.xensource.xenapi.PoolPatch;
+import com.xensource.xenapi.HostPatch;
+import com.xensource.xenapi.Types.SessionAuthenticationFailed;
+import com.xensource.xenapi.Types.XenAPIException;
+import com.xensource.xenapi.Types.UuidInvalid;
+
+
+@Local(value = Discoverer.class)
+public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, Listener, ResourceStateAdapter {
+ private static final Logger s_logger = Logger.getLogger(XcpServerDiscoverer.class);
+ protected String _publicNic;
+ protected String _privateNic;
+ protected String _storageNic1;
+ protected String _storageNic2;
+ protected int _wait;
+ protected XenServerConnectionPool _connPool;
+ protected boolean _checkHvm;
+ protected String _guestNic;
+ protected boolean _setupMultipath;
+ protected String _instance;
+ private String xs620snapshothotfix = "Xenserver-Vdi-Copy-HotFix";
+
+ @Inject
+ protected AlertManager _alertMgr;
+ @Inject
+ protected AgentManager _agentMgr;
+ @Inject
+ VMTemplateDao _tmpltDao;
+ @Inject
+ HostPodDao _podDao;
+
+ protected XcpServerDiscoverer() {
+ }
+
+ void setClusterGuid(ClusterVO cluster, String guid) {
+ cluster.setGuid(guid);
+ try {
+ _clusterDao.update(cluster.getId(), cluster);
+ } catch (EntityExistsException e) {
+ QueryBuilder sc = QueryBuilder.create(ClusterVO.class);
+ sc.and(sc.entity().getGuid(), Op.EQ, guid);
+ List clusters = sc.list();
+ ClusterVO clu = clusters.get(0);
+ List clusterHosts = _resourceMgr.listAllHostsInCluster(clu.getId());
+ if (clusterHosts == null || clusterHosts.size() == 0) {
+ clu.setGuid(null);
+ _clusterDao.update(clu.getId(), clu);
+ _clusterDao.update(cluster.getId(), cluster);
+ return;
+ }
+ throw e;
+ }
+ }
+
+ protected boolean poolHasHotFix(Connection conn, String hostIp, String hotFixUuid) {
+ try {
+ Map hosts = Host.getAllRecords(conn);
+ for (Map.Entry entry : hosts.entrySet()) {
+
+ Host.Record re = entry.getValue();
+ if (!re.address.equalsIgnoreCase(hostIp)){
+ continue;
+ }
+ Set patches = re.patches;
+ PoolPatch poolPatch = PoolPatch.getByUuid(conn, hotFixUuid);
+ for(HostPatch patch : patches) {
+ PoolPatch pp = patch.getPoolPatch(conn);
+ if (pp.equals(poolPatch) && patch.getApplied(conn)) {
+ s_logger.debug("host " + hostIp + " does have " + hotFixUuid +" Hotfix.");
+ return true;
+ }
+ }
+ }
+ return false;
+ } catch (UuidInvalid e) {
+ s_logger.debug("host " + hostIp + " doesn't have " + hotFixUuid + " Hotfix");
+ } catch (Exception e) {
+ s_logger.debug("can't get patches information, consider it doesn't have " + hotFixUuid + " Hotfix");
+ }
+ return false;
+ }
+
+
+
+ @Override
+ public Map extends ServerResource, Map>
+ find(long dcId, Long podId, Long clusterId, URI url, String username, String password, List hostTags) throws DiscoveryException {
+ Map> resources = new HashMap>();
+ Connection conn = null;
+ if (!url.getScheme().equals("http")) {
+ String msg = "urlString is not http so we're not taking care of the discovery for this: " + url;
+ s_logger.debug(msg);
+ return null;
+ }
+ if (clusterId == null) {
+ String msg = "must specify cluster Id when add host";
+ s_logger.debug(msg);
+ throw new RuntimeException(msg);
+ }
+
+ if (podId == null) {
+ String msg = "must specify pod Id when add host";
+ s_logger.debug(msg);
+ throw new RuntimeException(msg);
+ }
+
+ ClusterVO cluster = _clusterDao.findById(clusterId);
+ if (cluster == null || cluster.getHypervisorType() != HypervisorType.XenServer) {
+ if (s_logger.isInfoEnabled())
+ s_logger.info("invalid cluster id or cluster is not for XenServer hypervisors");
+ return null;
+ }
+
+ try {
+ String hostname = url.getHost();
+ InetAddress ia = InetAddress.getByName(hostname);
+ String hostIp = ia.getHostAddress();
+ Queue pass = new LinkedList();
+ pass.add(password);
+ conn = _connPool.getConnect(hostIp, username, pass);
+ if (conn == null) {
+ String msg = "Unable to get a connection to " + url;
+ s_logger.debug(msg);
+ throw new DiscoveryException(msg);
+ }
+
+ Set pools = Pool.getAll(conn);
+ Pool pool = pools.iterator().next();
+ Pool.Record pr = pool.getRecord(conn);
+ String poolUuid = pr.uuid;
+ Map hosts = Host.getAllRecords(conn);
+ String latestHotFix = "";
+ if (poolHasHotFix(conn, hostIp, XenserverConfigs.XSHotFix62ESP1004)) {
+ latestHotFix = XenserverConfigs.XSHotFix62ESP1004;
+ } else if (poolHasHotFix(conn, hostIp, XenserverConfigs.XSHotFix62ESP1)) {
+ latestHotFix = XenserverConfigs.XSHotFix62ESP1;
+ }
+
+ /*set cluster hypervisor type to xenserver*/
+ ClusterVO clu = _clusterDao.findById(clusterId);
+ if (clu.getGuid() == null) {
+ setClusterGuid(clu, poolUuid);
+ } else {
+ List clusterHosts = _resourceMgr.listAllHostsInCluster(clusterId);
+ if (clusterHosts != null && clusterHosts.size() > 0) {
+ if (!clu.getGuid().equals(poolUuid)) {
+ String msg = "Please join the host " + hostIp + " to XS pool "
+ + clu.getGuid() + " through XC/XS before adding it through CS UI";
+ s_logger.warn(msg);
+ throw new DiscoveryException(msg);
+ }
+ } else {
+ setClusterGuid(clu, poolUuid);
+ }
+ }
+ // can not use this conn after this point, because this host may join a pool, this conn is retired
+ if (conn != null) {
+ try {
+ Session.logout(conn);
+ } catch (Exception e) {
+ }
+ conn.dispose();
+ conn = null;
+ }
+
+ poolUuid = clu.getGuid();
+ _clusterDao.update(clusterId, clu);
+
+ if (_checkHvm) {
+ for (Map.Entry entry : hosts.entrySet()) {
+ Host.Record record = entry.getValue();
+
+ boolean support_hvm = false;
+ for (String capability : record.capabilities) {
+ if (capability.contains("hvm")) {
+ support_hvm = true;
+ break;
+ }
+ }
+ if (!support_hvm) {
+ String msg = "Unable to add host " + record.address + " because it doesn't support hvm";
+ _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, dcId, podId, msg, msg);
+ s_logger.debug(msg);
+ throw new RuntimeException(msg);
+ }
+ }
+ }
+
+ for (Map.Entry entry : hosts.entrySet()) {
+ Host.Record record = entry.getValue();
+ String hostAddr = record.address;
+
+ String prodVersion = record.softwareVersion.get("product_version");
+ if (prodVersion == null) {
+ prodVersion = record.softwareVersion.get("platform_version");
+ }
+ String xenVersion = record.softwareVersion.get("xenserver");
+ String hostOS = record.softwareVersion.get("product_brand");
+ if (hostOS == null) {
+ hostOS = record.softwareVersion.get("platform_name");
+ }
+
+ String hostOSVer = prodVersion;
+ String hostKernelVer = record.softwareVersion.get("linux");
+
+ if (_resourceMgr.findHostByGuid(record.uuid) != null) {
+ s_logger.debug("Skipping " + record.address + " because " + record.uuid + " is already in the database.");
+ continue;
+ }
+
+ CitrixResourceBase resource = createServerResource(dcId, podId, record, latestHotFix);
+ s_logger.info("Found host " + record.hostname + " ip=" + record.address + " product version=" + prodVersion);
+
+ Map details = new HashMap();
+ Map params = new HashMap();
+ details.put("url", hostAddr);
+ details.put("username", username);
+ params.put("username", username);
+ details.put("password", password);
+ params.put("password", password);
+ params.put("zone", Long.toString(dcId));
+ params.put("guid", record.uuid);
+ params.put("pod", podId.toString());
+ params.put("cluster", clusterId.toString());
+ params.put("pool", poolUuid);
+ params.put("ipaddress", record.address);
+
+ details.put(HostInfo.HOST_OS, hostOS);
+ details.put(HostInfo.HOST_OS_VERSION, hostOSVer);
+ details.put(HostInfo.HOST_OS_KERNEL_VERSION, hostKernelVer);
+ details.put(HostInfo.HYPERVISOR_VERSION, xenVersion);
+
+ String privateNetworkLabel = _networkMgr.getDefaultManagementTrafficLabel(dcId, HypervisorType.XenServer);
+ String storageNetworkLabel = _networkMgr.getDefaultStorageTrafficLabel(dcId, HypervisorType.XenServer);
+
+ if (!params.containsKey("private.network.device") && privateNetworkLabel != null) {
+ params.put("private.network.device", privateNetworkLabel);
+ details.put("private.network.device", privateNetworkLabel);
+ }
+
+ if (!params.containsKey("storage.network.device1") && storageNetworkLabel != null) {
+ params.put("storage.network.device1", storageNetworkLabel);
+ details.put("storage.network.device1", storageNetworkLabel);
+ }
+
+ DataCenterVO zone = _dcDao.findById(dcId);
+ boolean securityGroupEnabled = zone.isSecurityGroupEnabled();
+ params.put("securitygroupenabled", Boolean.toString(securityGroupEnabled));
+
+ params.put("wait", Integer.toString(_wait));
+ details.put("wait", Integer.toString(_wait));
+ params.put("migratewait", _configDao.getValue(Config.MigrateWait.toString()));
+ params.put(Config.XenMaxNics.toString().toLowerCase(), _configDao.getValue(Config.XenMaxNics.toString()));
+ params.put(Config.XenHeartBeatInterval.toString().toLowerCase(), _configDao.getValue(Config.XenHeartBeatInterval.toString()));
+ params.put(Config.InstanceName.toString().toLowerCase(), _instance);
+ details.put(Config.InstanceName.toString().toLowerCase(), _instance);
+ try {
+ resource.configure("Xen Server", params);
+ } catch (ConfigurationException e) {
+ _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, dcId, podId, "Unable to add " + record.address, "Error is " + e.getMessage());
+ s_logger.warn("Unable to instantiate " + record.address, e);
+ continue;
+ }
+ resource.start();
+ resources.put(resource, details);
+ }
+ } catch (SessionAuthenticationFailed e) {
+ throw new DiscoveredWithErrorException("Authentication error");
+ } catch (XenAPIException e) {
+ s_logger.warn("XenAPI exception", e);
+ return null;
+ } catch (XmlRpcException e) {
+ s_logger.warn("Xml Rpc Exception", e);
+ return null;
+ } catch (UnknownHostException e) {
+ s_logger.warn("Unable to resolve the host name", e);
+ return null;
+ } catch (Exception e) {
+ s_logger.debug("other exceptions: " + e.toString(), e);
+ return null;
+ }
+ return resources;
+ }
+
+ String getPoolUuid(Connection conn) throws XenAPIException, XmlRpcException {
+ Map pools = Pool.getAllRecords(conn);
+ assert pools.size() == 1 : "Pools size is " + pools.size();
+ return pools.values().iterator().next().uuid;
+ }
+
+ protected void addSamePool(Connection conn, Map> resources) throws XenAPIException, XmlRpcException {
+ Map hps = Pool.getAllRecords(conn);
+ assert (hps.size() == 1) : "How can it be more than one but it's actually " + hps.size();
+
+ // This is the pool.
+ String poolUuid = hps.values().iterator().next().uuid;
+
+ for (Map details : resources.values()) {
+ details.put("pool", poolUuid);
+ }
+ }
+
+
+ protected CitrixResourceBase createServerResource(long dcId, Long podId, Host.Record record, String hotfix) {
+ String prodBrand = record.softwareVersion.get("product_brand");
+ if (prodBrand == null) {
+ prodBrand = record.softwareVersion.get("platform_name").trim();
+ } else {
+ prodBrand = prodBrand.trim();
+ }
+
+ String prodVersion = record.softwareVersion.get("product_version");
+ if (prodVersion == null) {
+ prodVersion = record.softwareVersion.get("platform_version").trim();
+ } else {
+ prodVersion = prodVersion.trim();
+ }
+
+ // Xen Cloud Platform group of hypervisors
+ if (prodBrand.equals("XCP") && (prodVersion.equals("1.0.0") || prodVersion.equals("1.1.0") || prodVersion.equals("5.6.100") || prodVersion.startsWith("1.4"))) {
+ return new XcpServerResource();
+ } else if (prodBrand.equals("XCP") && prodVersion.startsWith("1.6")) {
+ return new XcpServer16Resource();
+ } // Citrix Xenserver group of hypervisors
+ else if (prodBrand.equals("XenServer") && prodVersion.equals("5.6.0"))
+ return new XenServer56Resource();
+ else if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.0"))
+ return new XenServer600Resource();
+ else if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.2"))
+ return new XenServer602Resource();
+ else if (prodBrand.equals("XenServer") && prodVersion.equals("6.1.0"))
+ return new XenServer610Resource();
+ else if (prodBrand.equals("XenServer") && prodVersion.equals("6.2.0")) {
+ if (hotfix.equals(XenserverConfigs.XSHotFix62ESP1004)) {
+ return new Xenserver625Resource();
+ } else if (hotfix.equals(XenserverConfigs.XSHotFix62ESP1)) {
+ return new XenServer620SP1Resource();
+ } else {
+ return new XenServer620Resource();
+ }
+ } else if (prodBrand.equals("XenServer") && prodVersion.equals("5.6.100")) {
+ String prodVersionTextShort = record.softwareVersion.get("product_version_text_short").trim();
+ if ("5.6 SP2".equals(prodVersionTextShort)) {
+ return new XenServer56SP2Resource();
+ } else if ("5.6 FP1".equals(prodVersionTextShort)) {
+ return new XenServer56FP1Resource();
+ }
+ } else if (prodBrand.equals("XCP_Kronos")) {
+ return new XcpOssResource();
+ }
+
+ String msg =
+ "Only support XCP 1.0.0, 1.1.0, 1.4.x, 1.5 beta, 1.6.x; XenServer 5.6, XenServer 5.6 FP1, XenServer 5.6 SP2, Xenserver 6.0, 6.0.2, 6.1.0, 6.2.0 but this one is " +
+ prodBrand + " " + prodVersion;
+ _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, dcId, podId, msg, msg);
+ s_logger.debug(msg);
+ throw new RuntimeException(msg);
+ }
+
+ protected void serverConfig() {
+ String value = _params.get(Config.XenSetupMultipath.key());
+ _setupMultipath = Boolean.parseBoolean(value);
+ }
+
+ @Override
+ public boolean configure(String name, Map params) throws ConfigurationException {
+ super.configure(name, params);
+ serverConfig();
+
+ _publicNic = _params.get(Config.XenPublicNetwork.key());
+ _privateNic = _params.get(Config.XenPrivateNetwork.key());
+
+ _storageNic1 = _params.get(Config.XenStorageNetwork1.key());
+ _storageNic2 = _params.get(Config.XenStorageNetwork2.key());
+
+ _guestNic = _params.get(Config.XenGuestNetwork.key());
+
+ String value = _params.get(Config.XapiWait.toString());
+ _wait = NumbersUtil.parseInt(value, Integer.parseInt(Config.XapiWait.getDefaultValue()));
+
+ _instance = _params.get(Config.InstanceName.key());
+
+ value = _params.get(Config.XenSetupMultipath.key());
+ Boolean.parseBoolean(value);
+
+ value = _params.get("xenserver.check.hvm");
+ _checkHvm = false;
+ _connPool = XenServerConnectionPool.getInstance();
+
+ _agentMgr.registerForHostEvents(this, true, false, true);
+
+ createXsToolsISO();
+ _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
+ return true;
+ }
+
+ @Override
+ public boolean matchHypervisor(String hypervisor) {
+ if (hypervisor == null)
+ return true;
+ return Hypervisor.HypervisorType.XenServer.toString().equalsIgnoreCase(hypervisor);
+ }
+
+ @Override
+ public Hypervisor.HypervisorType getHypervisorType() {
+ return Hypervisor.HypervisorType.XenServer;
+ }
+
+ @Override
+ public void postDiscovery(List hosts, long msId) throws DiscoveryException {
+ //do nothing
+ }
+
+ @Override
+ public int getTimeout() {
+ return 0;
+ }
+
+ @Override
+ public boolean isRecurring() {
+ return false;
+ }
+
+ @Override
+ public boolean processAnswers(long agentId, long seq, Answer[] answers) {
+ return false;
+ }
+
+ @Override
+ public boolean processCommands(long agentId, long seq, Command[] commands) {
+ return false;
+ }
+
+ private void createXsToolsISO() {
+ String isoName = "xs-tools.iso";
+ VMTemplateVO tmplt = _tmpltDao.findByTemplateName(isoName);
+ Long id;
+ if (tmplt == null) {
+ id = _tmpltDao.getNextInSequence(Long.class, "id");
+ VMTemplateVO template =
+ VMTemplateVO.createPreHostIso(id, isoName, isoName, ImageFormat.ISO, true, true, TemplateType.PERHOST, null, null, true, 64, Account.ACCOUNT_ID_SYSTEM,
+ null, "xen-pv-drv-iso", false, 1, false, HypervisorType.XenServer);
+ _tmpltDao.persist(template);
+ } else {
+ id = tmplt.getId();
+ tmplt.setTemplateType(TemplateType.PERHOST);
+ tmplt.setUrl(null);
+ _tmpltDao.update(id, tmplt);
+ }
+ }
+
+ @Override
+ public void processConnect(com.cloud.host.Host agent, StartupCommand cmd, boolean forRebalance) throws ConnectionException {
+ if (!(cmd instanceof StartupRoutingCommand)) {
+ return;
+ }
+ long agentId = agent.getId();
+
+ StartupRoutingCommand startup = (StartupRoutingCommand)cmd;
+ if (startup.getHypervisorType() != HypervisorType.XenServer) {
+ s_logger.debug("Not XenServer so moving on.");
+ return;
+ }
+
+ HostVO host = _hostDao.findById(agentId);
+
+ ClusterVO cluster = _clusterDao.findById(host.getClusterId());
+ if (cluster.getGuid() == null) {
+ cluster.setGuid(startup.getPool());
+ _clusterDao.update(cluster.getId(), cluster);
+ } else if (!cluster.getGuid().equals(startup.getPool())) {
+ String msg = "pool uuid for cluster " + cluster.getId() + " changed from " + cluster.getGuid() + " to " + startup.getPool();
+ s_logger.warn(msg);
+ throw new CloudRuntimeException(msg);
+ }
+ String resource = null;
+ Map details = startup.getHostDetails();
+ String prodBrand = details.get("product_brand").trim();
+ String prodVersion = details.get("product_version").trim();
+
+ if (prodBrand.equals("XCP") && (prodVersion.equals("1.0.0") || prodVersion.equals("1.1.0") || prodVersion.equals("5.6.100") || prodVersion.startsWith("1.4"))) {
+ resource = XcpServerResource.class.getName();
+ } else if (prodBrand.equals("XCP") && prodVersion.startsWith("1.6")) {
+ resource = XcpServer16Resource.class.getName();
+ } else if (prodBrand.equals("XenServer") && prodVersion.equals("5.6.0")) {
+ resource = XenServer56Resource.class.getName();
+ } else if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.0")) {
+ resource = XenServer600Resource.class.getName();
+ } else if (prodBrand.equals("XenServer") && prodVersion.equals("6.0.2")) {
+ resource = XenServer602Resource.class.getName();
+ } else if (prodBrand.equals("XenServer") && prodVersion.equals("6.1.0")) {
+ resource = XenServer610Resource.class.getName();
+ } else if (prodBrand.equals("XenServer") && prodVersion.equals("6.2.0")) {
+ String hotfix = details.get(XenserverConfigs.XS620HotFix);
+ if (hotfix != null && hotfix.equalsIgnoreCase(XenserverConfigs.XSHotFix62ESP1004)) {
+ resource = Xenserver625Resource.class.getName();
+ } else if (hotfix != null && hotfix.equalsIgnoreCase(XenserverConfigs.XSHotFix62ESP1)){
+ resource = XenServer620SP1Resource.class.getName();
+ } else {
+ resource = XenServer620Resource.class.getName();
+ }
+ } else if (prodBrand.equals("XenServer") && prodVersion.equals("5.6.100")) {
+ String prodVersionTextShort = details.get("product_version_text_short").trim();
+ if ("5.6 SP2".equals(prodVersionTextShort)) {
+ resource = XenServer56SP2Resource.class.getName();
+ } else if ("5.6 FP1".equals(prodVersionTextShort)) {
+ resource = XenServer56FP1Resource.class.getName();
+ }
+ } else if (prodBrand.equals("XCP_Kronos")) {
+ resource = XcpOssResource.class.getName();
+ }
+
+ if (resource == null) {
+ String msg =
+ "Only support XCP 1.0.0, 1.1.0, 1.4.x, 1.5 beta, 1.6.x; XenServer 5.6, 5.6 FP1, 5.6 SP2 and Xenserver 6.0 , 6.0.2, 6.1.0, 6.2.0 but this one is " +
+ prodBrand + " " + prodVersion;
+ s_logger.debug(msg);
+ throw new RuntimeException(msg);
+ }
+ if (!resource.equals(host.getResource())) {
+ String msg = "host " + host.getPrivateIpAddress() + " changed from " + host.getResource() + " to " + resource;
+ s_logger.debug(msg);
+ host.setResource(resource);
+ host.setSetup(false);
+ _hostDao.update(agentId, host);
+ throw new HypervisorVersionChangedException(msg);
+ }
+
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Setting up host " + agentId);
+ }
+ HostEnvironment env = new HostEnvironment();
+
+ SetupCommand setup = new SetupCommand(env);
+ if (_setupMultipath) {
+ setup.setMultipathOn();
+ }
+ if (!host.isSetup()) {
+ setup.setNeedSetup(true);
+ }
+
+ try {
+ Answer answer = _agentMgr.send(agentId, setup);
+ if (answer != null && answer.getResult() && answer instanceof SetupAnswer) {
+ host.setSetup(true);
+ host.setLastPinged((System.currentTimeMillis() >> 10) - 5 * 60);
+ _hostDao.update(host.getId(), host);
+ if (((SetupAnswer)answer).needReconnect()) {
+ throw new ConnectionException(false, "Reinitialize agent after setup.");
+ }
+ return;
+ } else {
+ s_logger.warn("Unable to setup agent " + agentId + " due to " + ((answer != null) ? answer.getDetails() : "return null"));
+ }
+ } catch (AgentUnavailableException e) {
+ s_logger.warn("Unable to setup agent " + agentId + " because it became unavailable.", e);
+ } catch (OperationTimedoutException e) {
+ s_logger.warn("Unable to setup agent " + agentId + " because it timed out", e);
+ }
+ throw new ConnectionException(true, "Reinitialize agent after setup.");
+ }
+
+ @Override
+ public AgentControlAnswer processControlCommand(long agentId, AgentControlCommand cmd) {
+ return null;
+ }
+
+ @Override
+ public boolean processDisconnect(long agentId, Status state) {
+ return false;
+ }
+
+ @Override
+ public boolean processTimeout(long agentId, long seq) {
+ return false;
+ }
+
+ @Override
+ public HostVO createHostVOForConnectedAgent(HostVO host, StartupCommand[] cmd) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public HostVO createHostVOForDirectConnectAgent(HostVO host, StartupCommand[] startup, ServerResource resource, Map details, List hostTags) {
+ StartupCommand firstCmd = startup[0];
+ if (!(firstCmd instanceof StartupRoutingCommand)) {
+ return null;
+ }
+
+ StartupRoutingCommand ssCmd = ((StartupRoutingCommand)firstCmd);
+ if (ssCmd.getHypervisorType() != HypervisorType.XenServer) {
+ return null;
+ }
+
+ HostPodVO pod = _podDao.findById(host.getPodId());
+ DataCenterVO dc = _dcDao.findById(host.getDataCenterId());
+ s_logger.info("Host: " + host.getName() + " connected with hypervisor type: " + HypervisorType.XenServer + ". Checking CIDR...");
+ _resourceMgr.checkCIDR(pod, dc, ssCmd.getPrivateIpAddress(), ssCmd.getPrivateNetmask());
+ return _resourceMgr.fillRoutingHostVO(host, ssCmd, HypervisorType.XenServer, details, hostTags);
+ }
+
+ @Override
+ public DeleteHostAnswer deleteHost(HostVO host, boolean isForced, boolean isForceDeleteStorage) throws UnableDeleteHostException {
+ if (host.getType() != com.cloud.host.Host.Type.Routing || host.getHypervisorType() != HypervisorType.XenServer) {
+ return null;
+ }
+
+ _resourceMgr.deleteRoutingHost(host, isForced, isForceDeleteStorage);
+ return new DeleteHostAnswer(true);
+ }
+
+ @Override
+ protected HashMap buildConfigParams(HostVO host) {
+ HashMap params = super.buildConfigParams(host);
+ DataCenterVO zone = _dcDao.findById(host.getDataCenterId());
+ if (zone != null) {
+ boolean securityGroupEnabled = zone.isSecurityGroupEnabled();
+ params.put("securitygroupenabled", Boolean.toString(securityGroupEnabled));
+ }
+ return params;
+ }
+
+ @Override
+ public boolean stop() {
+ _resourceMgr.unregisterResourceStateAdapter(this.getClass().getSimpleName());
+ return super.stop();
+ }
+}
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
new file mode 100644
index 00000000000..96fafec8320
--- /dev/null
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
@@ -0,0 +1,2404 @@
+// 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.
+package com.cloud.hypervisor.xenserver.resource;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Reduce bloat inside CitrixResourceBase
+ *
+ */
+public class CitrixHelper {
+ private static final Logger s_logger = Logger.getLogger(CitrixHelper.class);
+
+ private static final HashMap Xcp100GuestOsMap = new HashMap(70);
+ private static final HashMap Xcp160GuestOsMap = new HashMap(70);
+ private static final HashMap XenServerGuestOsMap = new HashMap(70);
+ private static final HashMap XenServer56FP1GuestOsMap = new HashMap(70);
+ private static final HashMap XenServer56FP2GuestOsMap = new HashMap(70);
+ private static final HashMap XenServer600GuestOsMap = new HashMap(70);
+ private static final HashMap XenServer602GuestOsMap = new HashMap(70);
+ private static final HashMap XenServer610GuestOsMap = new HashMap(70);
+ private static final HashMap XenServer620GuestOsMap = new HashMap(70);
+ private static final HashMap XenServer620SP1GuestOsMap = new HashMap(70);
+ private static final HashMap XenServer620GuestOsMemoryMap = new HashMap(70);
+ private static final HashMap XenServer620SP1GuestOsMemoryMap = new HashMap(70);
+ private static final HashMap XenServer610GuestOsMemoryMap = new HashMap(70);
+ private static final HashMap XenServer602GuestOsMemoryMap = new HashMap(70);
+ private static final HashMap XenServer600GuestOsMemoryMap = new HashMap(70);
+ private static final HashMap XenServer56SP2GuestOsMemoryMap = new HashMap(70);
+ private static final HashMap XenServer56FP1GuestOsMemoryMap = new HashMap(70);
+ private static final ArrayList GuestOsList = new ArrayList(70);
+
+ static {
+ Xcp100GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
+ Xcp100GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
+ Xcp100GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
+ Xcp100GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp100GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp100GuestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)");
+ Xcp100GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+ Xcp100GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit) (experimental)");
+ Xcp100GuestOsMap.put("Debian GNU/Linux 7(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+ Xcp100GuestOsMap.put("Debian GNU/Linux 7(64-bit)", "Debian Squeeze 6.0 (64-bit) (experimental)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ Xcp100GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ Xcp100GuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 9 SP4");
+ Xcp100GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1");
+ Xcp100GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 x64");
+ Xcp100GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2");
+ Xcp100GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 x64");
+ Xcp100GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "Other install media");
+ Xcp100GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11");
+ Xcp100GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 x64");
+ Xcp100GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", "SUSE Linux Enterprise Server 11 SP1 (32-bit)");
+ Xcp100GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", "SUSE Linux Enterprise Server 11 SP1 (64-bit)");
+ Xcp100GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)");
+ Xcp100GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)");
+ Xcp100GuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003 (32-bit)");
+ Xcp100GuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 (64-bit)");
+ Xcp100GuestOsMap.put("Windows Server 2003 Enterprise Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ Xcp100GuestOsMap.put("Windows Server 2003 Enterprise Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ Xcp100GuestOsMap.put("Windows Server 2003 DataCenter Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ Xcp100GuestOsMap.put("Windows Server 2003 DataCenter Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ Xcp100GuestOsMap.put("Windows Server 2003 Standard Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ Xcp100GuestOsMap.put("Windows Server 2003 Standard Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ Xcp100GuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008 (32-bit)");
+ Xcp100GuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 (64-bit)");
+ Xcp100GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+ Xcp100GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)");
+ Xcp100GuestOsMap.put("Windows Vista (32-bit)", "Windows Vista (32-bit)");
+ Xcp100GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit) (experimental)");
+ Xcp100GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit) (experimental)");
+ Xcp100GuestOsMap.put("Other Linux (32-bit)", "Other install media");
+ Xcp100GuestOsMap.put("Other Linux (64-bit)", "Other install media");
+ Xcp100GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
+ Xcp100GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
+ }
+
+ static {
+ Xcp160GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.6 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.6 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.7 (32-bit)", "CentOS 5 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 5.7 (64-bit)", "CentOS 5 (64-bit)");
+ Xcp160GuestOsMap.put("CentOS 6.0 (32-bit)", "CentOS 6 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 6.0 (64-bit)", "CentOS 6 (64-bit)");
+ Xcp160GuestOsMap.put("CentOS 6.1 (32-bit)", "CentOS 6 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 6.1 (64-bit)", "CentOS 6 (64-bit)");
+ Xcp160GuestOsMap.put("CentOS 6.2 (32-bit)", "CentOS 6 (32-bit)");
+ Xcp160GuestOsMap.put("CentOS 6.2 (64-bit)", "CentOS 6 (64-bit)");
+ Xcp160GuestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)");
+ Xcp160GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+ Xcp160GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit)");
+ Xcp160GuestOsMap.put("Debian GNU/Linux 7(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+ Xcp160GuestOsMap.put("Debian GNU/Linux 7(64-bit)", "Debian Squeeze 6.0 (64-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.6 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.6 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.7 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 5.7 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 6.0 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 6.0 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 6.1 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 6.1 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 6.2 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ Xcp160GuestOsMap.put("Oracle Enterprise Linux 6.2 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ Xcp160GuestOsMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ Xcp160GuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 9 SP4");
+ Xcp160GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1");
+ Xcp160GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 x64");
+ Xcp160GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2");
+ Xcp160GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 x64");
+ Xcp160GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "Other install media");
+ Xcp160GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11");
+ Xcp160GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 x64");
+ Xcp160GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", "SUSE Linux Enterprise Server 11 SP1 (32-bit)");
+ Xcp160GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", "SUSE Linux Enterprise Server 11 SP1 (64-bit)");
+ Xcp160GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)");
+ Xcp160GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)");
+ Xcp160GuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003 (32-bit)");
+ Xcp160GuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 (64-bit)");
+ Xcp160GuestOsMap.put("Windows Server 2003 Enterprise Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ Xcp160GuestOsMap.put("Windows Server 2003 Enterprise Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ Xcp160GuestOsMap.put("Windows Server 2003 DataCenter Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ Xcp160GuestOsMap.put("Windows Server 2003 DataCenter Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ Xcp160GuestOsMap.put("Windows Server 2003 Standard Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ Xcp160GuestOsMap.put("Windows Server 2003 Standard Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ Xcp160GuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008 (32-bit)");
+ Xcp160GuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 (64-bit)");
+ Xcp160GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+ Xcp160GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)");
+ Xcp160GuestOsMap.put("Windows Vista (32-bit)", "Windows Vista (32-bit)");
+ Xcp160GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit)");
+ Xcp160GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit)");
+ Xcp160GuestOsMap.put("Ubuntu 12.04 (32-bit)", "Ubuntu Precise Pangolin 12.04 (32-bit)");
+ Xcp160GuestOsMap.put("Ubuntu 12.04 (64-bit)", "Ubuntu Precise Pangolin 12.04 (64-bit)");
+ Xcp160GuestOsMap.put("Other Linux (32-bit)", "Other install media");
+ Xcp160GuestOsMap.put("Other Linux (64-bit)", "Other install media");
+ Xcp160GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
+ Xcp160GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
+ }
+
+ static {
+ XenServerGuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
+ XenServerGuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
+ XenServerGuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
+ XenServerGuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)");
+ XenServerGuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5.0 (32-bit)");
+ XenServerGuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5.0 (64-bit)");
+ XenServerGuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5.1 (32-bit)");
+ XenServerGuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5.1 (64-bit)");
+ XenServerGuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5.2 (32-bit)");
+ XenServerGuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5.2 (64-bit)");
+ XenServerGuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5.3 (32-bit)");
+ XenServerGuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5.3 (64-bit)");
+ XenServerGuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5.4 (32-bit)");
+ XenServerGuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5.4 (64-bit)");
+ XenServerGuestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)");
+ XenServerGuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Lenny 5.0 (32-bit)"); // This is to support Debian 6.0 in XS 5.6
+ XenServerGuestOsMap.put("Debian GNU/Linux 7(32-bit)", "Debian Lenny 5.0 (32-bit)"); // This is to support Debian 7.0 in XS 5.6
+ XenServerGuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5.0 (32-bit)");
+ XenServerGuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5.0 (64-bit)");
+ XenServerGuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5.1 (32-bit)");
+ XenServerGuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5.1 (64-bit)");
+ XenServerGuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5.2 (32-bit)");
+ XenServerGuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5.2 (64-bit)");
+ XenServerGuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5.3 (32-bit)");
+ XenServerGuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5.3 (64-bit)");
+ XenServerGuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5.4 (32-bit)");
+ XenServerGuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5.4 (64-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5.0 (32-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5.0 (64-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5.1 (32-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5.1 (64-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5.2 (32-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5.2 (64-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5.3 (32-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5.3 (64-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5.4 (32-bit)");
+ XenServerGuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5.4 (64-bit)");
+ XenServerGuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 9 SP4 (32-bit)");
+ XenServerGuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)");
+ XenServerGuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 (64-bit)");
+ XenServerGuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2 (32-bit)");
+ XenServerGuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 (64-bit)");
+ XenServerGuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "SUSE Linux Enterprise Server 10 SP3 (64-bit)");
+ XenServerGuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11 (32-bit)");
+ XenServerGuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 (64-bit)");
+ XenServerGuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)");
+ XenServerGuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)");
+ XenServerGuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003 (32-bit)");
+ XenServerGuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 (64-bit)");
+ XenServerGuestOsMap.put("Windows Server 2003 Enterprise Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServerGuestOsMap.put("Windows Server 2003 Enterprise Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServerGuestOsMap.put("Windows Server 2003 DataCenter Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServerGuestOsMap.put("Windows Server 2003 DataCenter Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServerGuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008 (32-bit)");
+ XenServerGuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 (64-bit)");
+ XenServerGuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+ XenServerGuestOsMap.put("Windows 2000 SP4 (32-bit)", "Windows 2000 SP4 (32-bit)");
+ XenServerGuestOsMap.put("Windows 2000 Server SP4 (32-bit)", "Windows 2000 SP4 (32-bit)");
+ XenServerGuestOsMap.put("Windows Vista (32-bit)", "Windows Vista (32-bit)");
+ XenServerGuestOsMap.put("Windows XP SP2 (32-bit)", "Windows XP SP2 (32-bit)");
+ XenServerGuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)");
+ XenServerGuestOsMap.put("Other Linux (32-bit)", "Other install media");
+ XenServerGuestOsMap.put("Other Linux (64-bit)", "Other install media");
+ XenServerGuestOsMap.put("Other PV (32-bit)", "CentOS 5.4 (32-bit)");
+ XenServerGuestOsMap.put("Other PV (64-bit)", "CentOS 5.4 (64-bit)");
+ }
+
+ static {
+ XenServer56FP1GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit) (experimental)");
+ XenServer56FP1GuestOsMap.put("Debian GNU/Linux 7(32-bit)", "Debian Squeeze 6.0 (32-bit)"); // This is to support Debian 7.0 in XS 5.6FP1
+ XenServer56FP1GuestOsMap.put("Debian GNU/Linux 7(64-bit)", "Debian Squeeze 6.0 (64-bit) (experimental)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit) (experimental)");
+ XenServer56FP1GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit) (experimental)");
+ XenServer56FP1GuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 9 SP4 (32-bit)");
+ XenServer56FP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)");
+ XenServer56FP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 (64-bit)");
+ XenServer56FP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2 (32-bit)");
+ XenServer56FP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 (64-bit)");
+ XenServer56FP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "SUSE Linux Enterprise Server 10 SP3 (64-bit)");
+ XenServer56FP1GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11 (32-bit)");
+ XenServer56FP1GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Windows Server 2003 Enterprise Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Windows Server 2003 Enterprise Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Windows Server 2003 DataCenter Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Windows Server 2003 DataCenter Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+ XenServer56FP1GuestOsMap.put("Windows 2000 SP4 (32-bit)", "Windows 2000 SP4 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Windows 2000 Server SP4 (32-bit)", "Windows 2000 SP4 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Windows Vista (32-bit)", "Windows Vista (32-bit)");
+ XenServer56FP1GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit) (experimental)");
+ XenServer56FP1GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit) (experimental)");
+ XenServer56FP1GuestOsMap.put("Other Linux (32-bit)", "Other install media");
+ XenServer56FP1GuestOsMap.put("Other Linux (64-bit)", "Other install media");
+ XenServer56FP1GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP1GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
+ }
+
+ static {
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Debian GNU/Linux 7(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Debian GNU/Linux 7(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ // XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Windows Vista (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ XenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32 * 1024l));
+ // XenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ //_xenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ XenServer56FP1GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer56FP1GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128 * 1024l));
+ // XenServer56FP1GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56FP1GuestOsMemoryMap.put("Other Linux (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other CentOS (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other CentOS (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other Ubuntu (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other Ubuntu (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other SUSE Linux(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other SUSE Linux(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other PV (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other PV (64-bit)", new MemoryValues(512l, 16*1024l));
+ }
+
+ static {
+ XenServer56FP2GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit) (experimental)");
+ XenServer56FP2GuestOsMap.put("Debian GNU/Linux 7(32-bit)", "Debian Squeeze 6.0 (32-bit)"); // This is to support Debian 7.0 in XS 5.6FP2
+ XenServer56FP2GuestOsMap.put("Debian GNU/Linux 7(64-bit)", "Debian Squeeze 6.0 (64-bit) (experimental)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer56FP2GuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 9 SP4 (32-bit)");
+ XenServer56FP2GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)");
+ XenServer56FP2GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 (64-bit)");
+ XenServer56FP2GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2 (32-bit)");
+ XenServer56FP2GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 (64-bit)");
+ XenServer56FP2GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "SUSE Linux Enterprise Server 10 SP3 (64-bit)");
+ XenServer56FP2GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11 (32-bit)");
+ XenServer56FP2GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+ XenServer56FP2GuestOsMap.put("Windows Vista (32-bit)", "Windows Vista (32-bit)");
+ XenServer56FP2GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit) (experimental)");
+ XenServer56FP2GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit) (experimental)");
+ XenServer56FP2GuestOsMap.put("Other Linux (32-bit)", "Other install media");
+ XenServer56FP2GuestOsMap.put("Other Linux (64-bit)", "Other install media");
+ XenServer56FP2GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
+ XenServer56FP2GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
+ }
+
+ static {
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Debian GNU/Linux 7(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Debian GNU/Linux 7(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ XenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ // XenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Windows Vista (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ XenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32 * 1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ //_xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ XenServer56SP2GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer56SP2GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128 * 1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other Linux (64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other (64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other CentOS (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other CentOS (64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other Ubuntu (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other Ubuntu (64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other SUSE Linux(32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other SUSE Linux(64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other PV (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer56SP2GuestOsMemoryMap.put("Other PV (64-bit)", new MemoryValues(512l, 16*1024l));
+ }
+
+ static {
+ XenServer600GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
+ XenServer600GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
+ XenServer600GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
+ XenServer600GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.6 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer600GuestOsMap.put("CentOS 5.6 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer600GuestOsMap.put("CentOS 6.0 (32-bit)", "CentOS 6.0 (32-bit) (experimental)");
+ XenServer600GuestOsMap.put("CentOS 6.0 (64-bit)", "CentOS 6.0 (64-bit) (experimental)");
+ XenServer600GuestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)");
+ XenServer600GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+ XenServer600GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit)");
+ XenServer600GuestOsMap.put("Debian GNU/Linux 7(32-bit)", "Debian Squeeze 6.0 (32-bit)"); // This is to support Debian 7.0 in XS 6.0
+ XenServer600GuestOsMap.put("Debian GNU/Linux 7(64-bit)", "Debian Squeeze 6.0 (64-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.6 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 5.6 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 6.0 (32-bit)", "Oracle Enterprise Linux 6.0 (32-bit)");
+ XenServer600GuestOsMap.put("Oracle Enterprise Linux 6.0 (64-bit)", "Oracle Enterprise Linux 6.0 (64-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6.0 (32-bit)");
+ XenServer600GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6.0 (64-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 9 SP4 (32-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 (64-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2 (32-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 (64-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", "SUSE Linux Enterprise Server 10 SP3 (32-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "SUSE Linux Enterprise Server 10 SP3 (64-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", "SUSE Linux Enterprise Server 10 SP4 (32-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", "SUSE Linux Enterprise Server 10 SP4 (64-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11 (32-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 (64-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", "SUSE Linux Enterprise Server 11 SP1 (32-bit)");
+ XenServer600GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", "SUSE Linux Enterprise Server 11 SP1 (64-bit)");
+ XenServer600GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)");
+ XenServer600GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)");
+ XenServer600GuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer600GuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer600GuestOsMap.put("Windows Server 2003 Enterprise Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer600GuestOsMap.put("Windows Server 2003 Enterprise Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer600GuestOsMap.put("Windows Server 2003 DataCenter Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer600GuestOsMap.put("Windows Server 2003 DataCenter Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer600GuestOsMap.put("Windows Server 2003 Standard Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer600GuestOsMap.put("Windows Server 2003 Standard Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer600GuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008 (32-bit)");
+ XenServer600GuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 (64-bit)");
+ XenServer600GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+ XenServer600GuestOsMap.put("Windows Vista (32-bit)", "Windows Vista (32-bit)");
+ XenServer600GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)");
+ XenServer600GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit)");
+ XenServer600GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit)");
+ XenServer600GuestOsMap.put("Ubuntu 10.10 (32-bit)", "Ubuntu Maverick Meerkat 10.10 (32-bit) (experimental)");
+ XenServer600GuestOsMap.put("Ubuntu 10.10 (64-bit)", "Ubuntu Maverick Meerkat 10.10 (64-bit) (experimental)");
+ XenServer600GuestOsMap.put("Other Linux (32-bit)", "Other install media");
+ XenServer600GuestOsMap.put("Other Linux (64-bit)", "Other install media");
+ XenServer600GuestOsMap.put("Other (32-bit)", "Other install media");
+ XenServer600GuestOsMap.put("Other (64-bit)", "Other install media");
+ XenServer600GuestOsMap.put("Other CentOS (32-bit)", "Other install media");
+ XenServer600GuestOsMap.put("Other CentOS (64-bit)", "Other install media");
+ XenServer600GuestOsMap.put("Other Ubuntu (32-bit)", "Other install media");
+ XenServer600GuestOsMap.put("Other Ubuntu (64-bit)", "Other install media");
+ XenServer600GuestOsMap.put("Other SUSE Linux(32-bit)", "Other install media");
+ XenServer600GuestOsMap.put("Other SUSE Linux(64-bit)", "Other install media");
+ XenServer600GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
+ XenServer600GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
+ }
+
+ static {
+ XenServer600GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Debian GNU/Linux 7(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Debian GNU/Linux 7(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ //_xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ XenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ //_xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ //_xenServer600GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer600GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer600GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer600GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ // XenServer600GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ XenServer600GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Windows Vista (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ XenServer600GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32 * 1024l));
+ //_xenServer600GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ //_xenServer600GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ XenServer600GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer600GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128 * 1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other Linux (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other CentOS (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other CentOS (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other Ubuntu (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other Ubuntu (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other SUSE Linux(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other SUSE Linux(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other PV (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other PV (64-bit)", new MemoryValues(512l, 16*1024l));
+ }
+
+ static {
+ XenServer602GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.6 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.6 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.7 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 5.7 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer602GuestOsMap.put("CentOS 6.0 (32-bit)", "CentOS 6.0 (32-bit)");
+ XenServer602GuestOsMap.put("CentOS 6.0 (64-bit)", "CentOS 6.0 (64-bit)");
+ XenServer602GuestOsMap.put("Debian GNU/Linux 5.0 (32-bit)", "Debian Lenny 5.0 (32-bit)");
+ XenServer602GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+ XenServer602GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit)");
+ XenServer602GuestOsMap.put("Debian GNU/Linux 7(32-bit)", "Debian Squeeze 6.0 (32-bit)"); // This is to support Debian 7.0 in XS 6.0.2
+ XenServer602GuestOsMap.put("Debian GNU/Linux 7(64-bit)", "Debian Squeeze 6.0 (64-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.6 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.6 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.7 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 5.7 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 6.0 (32-bit)", "Oracle Enterprise Linux 6.0 (32-bit)");
+ XenServer602GuestOsMap.put("Oracle Enterprise Linux 6.0 (64-bit)", "Oracle Enterprise Linux 6.0 (64-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6.0 (32-bit)");
+ XenServer602GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6.0 (64-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 (64-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2 (32-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 (64-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", "SUSE Linux Enterprise Server 10 SP3 (32-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "SUSE Linux Enterprise Server 10 SP3 (64-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", "SUSE Linux Enterprise Server 10 SP4 (32-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", "SUSE Linux Enterprise Server 10 SP4 (64-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11 (32-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 (64-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", "SUSE Linux Enterprise Server 11 SP1 (32-bit)");
+ XenServer602GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", "SUSE Linux Enterprise Server 11 SP1 (64-bit)");
+ XenServer602GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)");
+ XenServer602GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)");
+ XenServer602GuestOsMap.put("Windows 8 (32-bit)", "Windows 8 (32-bit) (experimental)");
+ XenServer602GuestOsMap.put("Windows 8 (64-bit)", "Windows 8 (64-bit) (experimental)");
+ XenServer602GuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer602GuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer602GuestOsMap.put("Windows Server 2003 PAE (32-bit)", "Windows Server 2003 PAE (32-bit)");
+ XenServer602GuestOsMap.put("Windows Server 2003 Enterprise Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer602GuestOsMap.put("Windows Server 2003 Enterprise Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer602GuestOsMap.put("Windows Server 2003 DataCenter Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer602GuestOsMap.put("Windows Server 2003 DataCenter Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer602GuestOsMap.put("Windows Server 2003 Standard Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer602GuestOsMap.put("Windows Server 2003 Standard Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer602GuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008 (32-bit)");
+ XenServer602GuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 (64-bit)");
+ XenServer602GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+ XenServer602GuestOsMap.put("Windows Server 8 (64-bit)", "Windows Server 8 (64-bit) (experimental)");
+ XenServer602GuestOsMap.put("Windows Vista (32-bit)", "Windows Vista (32-bit)");
+ XenServer602GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)");
+ XenServer602GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit)");
+ XenServer602GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit)");
+ XenServer602GuestOsMap.put("Ubuntu 10.10 (32-bit)", "Ubuntu Maverick Meerkat 10.10 (32-bit) (experimental)");
+ XenServer602GuestOsMap.put("Ubuntu 10.10 (64-bit)", "Ubuntu Maverick Meerkat 10.10 (64-bit) (experimental)");
+ XenServer602GuestOsMap.put("Other Linux (32-bit)", "Other install media");
+ XenServer602GuestOsMap.put("Other Linux (64-bit)", "Other install media");
+ XenServer602GuestOsMap.put("Other (32-bit)", "Other install media");
+ XenServer602GuestOsMap.put("Other (64-bit)", "Other install media");
+ XenServer602GuestOsMap.put("Other CentOS (32-bit)", "Other install media");
+ XenServer602GuestOsMap.put("Other CentOS (64-bit)", "Other install media");
+ XenServer602GuestOsMap.put("Other Ubuntu (32-bit)", "Other install media");
+ XenServer602GuestOsMap.put("Other Ubuntu (64-bit)", "Other install media");
+ XenServer602GuestOsMap.put("Other SUSE Linux(32-bit)", "Other install media");
+ XenServer602GuestOsMap.put("Other SUSE Linux(64-bit)", "Other install media");
+ XenServer602GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
+ XenServer602GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
+ }
+
+ static {
+ XenServer602GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Debian GNU/Linux 5.0 (32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Debian GNU/Linux 7(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Debian GNU/Linux 7(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ // XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ //_xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ //_xenServer602GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer602GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer602GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer602GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ XenServer602GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Windows Vista (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ XenServer602GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32 * 1024l));
+ //_xenServer602GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ //_xenServer602GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ XenServer602GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer602GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128 * 1024l));
+ // XenServer602GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer602GuestOsMemoryMap.put("Other Linux (64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer602GuestOsMemoryMap.put("Other (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer602GuestOsMemoryMap.put("Other (64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer602GuestOsMemoryMap.put("Other CentOS (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer602GuestOsMemoryMap.put("Other CentOS (64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer602GuestOsMemoryMap.put("Other Ubuntu (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer602GuestOsMemoryMap.put("Other Ubuntu (64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer602GuestOsMemoryMap.put("Other SUSE Linux(32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer602GuestOsMemoryMap.put("Other SUSE Linux(64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer602GuestOsMemoryMap.put("Other PV (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer602GuestOsMemoryMap.put("Other PV (64-bit)", new MemoryValues(512l, 16*1024l));
+ }
+
+ static {
+ XenServer610GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.6 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.6 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.7 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 5.7 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer610GuestOsMap.put("CentOS 6.0 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 6.0 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer610GuestOsMap.put("CentOS 6.1 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 6.1 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer610GuestOsMap.put("CentOS 6.2 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 6.2 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer610GuestOsMap.put("CentOS 6.3 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer610GuestOsMap.put("CentOS 6.3 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer610GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+ XenServer610GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit)");
+ XenServer610GuestOsMap.put("Debian GNU/Linux 7(32-bit)", "Debian Squeeze 6.0 (32-bit)"); // This is to support Debian 7.0 in XS 6.1
+ XenServer610GuestOsMap.put("Debian GNU/Linux 7(64-bit)", "Debian Squeeze 6.0 (64-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.6 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.6 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.7 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 5.7 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 6.0 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 6.0 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 6.1 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 6.1 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 6.2 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer610GuestOsMap.put("Oracle Enterprise Linux 6.2 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer610GuestOsMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 (64-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2 (32-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 (64-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", "SUSE Linux Enterprise Server 10 SP3 (32-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "SUSE Linux Enterprise Server 10 SP3 (64-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", "SUSE Linux Enterprise Server 10 SP4 (32-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", "SUSE Linux Enterprise Server 10 SP4 (64-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11 (32-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 (64-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", "SUSE Linux Enterprise Server 11 SP1 (32-bit)");
+ XenServer610GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", "SUSE Linux Enterprise Server 11 SP1 (64-bit)");
+ XenServer610GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)");
+ XenServer610GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)");
+ XenServer610GuestOsMap.put("Windows 8 (32-bit)", "Windows 8 (32-bit) (experimental)");
+ XenServer610GuestOsMap.put("Windows 8 (64-bit)", "Windows 8 (64-bit) (experimental)");
+ XenServer610GuestOsMap.put("Windows Server 2003 (32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2003 (64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2003 PAE (32-bit)", "Windows Server 2003 PAE (32-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2003 Enterprise Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2003 Enterprise Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2003 DataCenter Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2003 DataCenter Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2003 Standard Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2003 Standard Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2008 (32-bit)", "Windows Server 2008 (32-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2008 (64-bit)", "Windows Server 2008 (64-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+ XenServer610GuestOsMap.put("Windows Server 2012 (64-bit)", "Windows Server 2012 (64-bit) (experimental)");
+ XenServer610GuestOsMap.put("Windows Server 8 (64-bit)", "Windows Server 2012 (64-bit) (experimental)");
+ XenServer610GuestOsMap.put("Windows Vista (32-bit)", "Windows Vista (32-bit)");
+ XenServer610GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)");
+ XenServer610GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit)");
+ XenServer610GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit)");
+ XenServer610GuestOsMap.put("Ubuntu 10.10 (32-bit)", "Ubuntu Maverick Meerkat 10.10 (32-bit) (experimental)");
+ XenServer610GuestOsMap.put("Ubuntu 10.10 (64-bit)", "Ubuntu Maverick Meerkat 10.10 (64-bit) (experimental)");
+ XenServer610GuestOsMap.put("Ubuntu 12.04 (32-bit)", "Ubuntu Precise Pangolin 12.04 (32-bit)");
+ XenServer610GuestOsMap.put("Ubuntu 12.04 (64-bit)", "Ubuntu Precise Pangolin 12.04 (64-bit)");
+ XenServer610GuestOsMap.put("Ubuntu 11.04 (32-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Ubuntu 11.04 (64-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Other Linux (32-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Other Linux (64-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Other (32-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Other (64-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Other CentOS (32-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Other CentOS (64-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Other Ubuntu (32-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Other Ubuntu (64-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Other SUSE Linux(32-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Other SUSE Linux(64-bit)", "Other install media");
+ XenServer610GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
+ XenServer610GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
+ }
+
+ static {
+ XenServer620GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.6 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.6 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.7 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.7 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.8 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.8 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.9 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 5.9 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 6.0 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 6.0 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 6.1 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 6.1 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 6.2 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 6.2 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 6.3 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 6.3 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer620GuestOsMap.put("CentOS 6.4 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer620GuestOsMap.put("CentOS 6.4 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer620GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+ XenServer620GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit)");
+ XenServer620GuestOsMap.put("Debian GNU/Linux 7(32-bit)", "Debian Wheezy 7.0 (32-bit)");
+ XenServer620GuestOsMap.put("Debian GNU/Linux 7(64-bit)", "Debian Wheezy 7.0 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.6 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.6 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.7 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.7 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.8 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.8 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.9 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 5.9 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 6.0 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 6.0 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 6.1 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 6.1 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 6.2 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 6.2 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 6.3 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 6.3 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 6.4 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer620GuestOsMap.put("Oracle Enterprise Linux 6.4 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.8 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.8 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.9 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 5.9 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 6.3 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 6.3 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 6.4 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer620GuestOsMap.put("Red Hat Enterprise Linux 6.4 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 (64-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2 (32-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 (64-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", "SUSE Linux Enterprise Server 10 SP3 (32-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "SUSE Linux Enterprise Server 10 SP3 (64-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", "SUSE Linux Enterprise Server 10 SP4 (32-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", "SUSE Linux Enterprise Server 10 SP4 (64-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11 (32-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 (64-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", "SUSE Linux Enterprise Server 11 SP1 (32-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", "SUSE Linux Enterprise Server 11 SP1 (64-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 11 SP2 (32-bit)", "SUSE Linux Enterprise Server 11 SP2 (32-bit)");
+ XenServer620GuestOsMap.put("SUSE Linux Enterprise Server 11 SP2 (64-bit)", "SUSE Linux Enterprise Server 11 SP2 (64-bit)");
+ XenServer620GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)");
+ XenServer620GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)");
+ XenServer620GuestOsMap.put("Windows 7 SP1 (32-bit)", "Windows 7 SP1 (32-bit)");
+ XenServer620GuestOsMap.put("Windows 7 SP1 (64-bit)", "Windows 7 SP1 (64-bit)");
+ XenServer620GuestOsMap.put("Windows 8 (32-bit)", "Windows 8 (32-bit)");
+ XenServer620GuestOsMap.put("Windows 8 (64-bit)", "Windows 8 (64-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2003 SP2 (32-bit)", "Windows Server 2003 SP2 (32-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2003 SP2 (64-bit)", "Windows Server 2003 SP2 (64-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2003 PAE (32-bit)", "Windows Server 2003 PAE (32-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2003 Enterprise Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2003 Enterprise Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2003 DataCenter Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2003 DataCenter Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2003 Standard Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2003 Standard Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2008 SP2 (32-bit)", "Windows Server 2008 SP2 (32-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2008 SP2 (64-bit)", "Windows Server 2008 SP2 (64-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2008 R2 SP1 (64-bit)", "Windows Server 2008 R2 SP1 (64-bit)");
+ XenServer620GuestOsMap.put("Windows Server 2012 (64-bit)", "Windows Server 2012 (64-bit)");
+ XenServer620GuestOsMap.put("Windows Vista SP2 (32-bit)", "Windows Vista (32-bit)");
+ XenServer620GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)");
+ XenServer620GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit)");
+ XenServer620GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit)");
+ XenServer620GuestOsMap.put("Ubuntu 10.10 (32-bit)", "Ubuntu Maverick Meerkat 10.10 (32-bit) (experimental)");
+ XenServer620GuestOsMap.put("Ubuntu 10.10 (64-bit)", "Ubuntu Maverick Meerkat 10.10 (64-bit) (experimental)");
+ XenServer620GuestOsMap.put("Ubuntu 12.04 (32-bit)", "Ubuntu Precise Pangolin 12.04 (32-bit)");
+ XenServer620GuestOsMap.put("Ubuntu 12.04 (64-bit)", "Ubuntu Precise Pangolin 12.04 (64-bit)");
+ XenServer620GuestOsMap.put("Ubuntu 11.04 (32-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Ubuntu 11.04 (64-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Other Linux (32-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Other Linux (64-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Other (32-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Other (64-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Other CentOS (32-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Other CentOS (64-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Other Ubuntu (32-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Other Ubuntu (64-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Other SUSE Linux(32-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Other SUSE Linux(64-bit)", "Other install media");
+ XenServer620GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
+ }
+
+ static {
+ XenServer620SP1GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 4.8 (32-bit)", "CentOS 4.8 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.0 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.0 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.1 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.1 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.2 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.2 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.3 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.3 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.4 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.4 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.5 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.5 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.6 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.6 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.7 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.7 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.8 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.8 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.9 (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 5.9 (64-bit)", "CentOS 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 6.0 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 6.0 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 6.1 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 6.1 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 6.2 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 6.2 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 6.3 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 6.3 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 6.4 (32-bit)", "CentOS 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("CentOS 6.4 (64-bit)", "CentOS 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Debian GNU/Linux 6(32-bit)", "Debian Squeeze 6.0 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Debian GNU/Linux 6(64-bit)", "Debian Squeeze 6.0 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Debian GNU/Linux 7(32-bit)", "Debian Wheezy 7.0 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Debian GNU/Linux 7(64-bit)", "Debian Wheezy 7.0 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.0 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.0 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.1 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.1 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.2 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.2 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.3 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.3 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.4 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.4 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.5 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.5 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.6 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.6 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.7 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.7 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.8 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.8 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.9 (32-bit)", "Oracle Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 5.9 (64-bit)", "Oracle Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 6.0 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 6.0 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 6.1 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 6.1 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 6.2 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 6.2 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 6.3 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 6.3 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 6.4 (32-bit)", "Oracle Enterprise Linux 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Oracle Enterprise Linux 6.4 (64-bit)", "Oracle Enterprise Linux 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", "Red Hat Enterprise Linux 4.5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", "Red Hat Enterprise Linux 4.6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", "Red Hat Enterprise Linux 4.7 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", "Red Hat Enterprise Linux 4.8 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.8 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.8 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.9 (32-bit)", "Red Hat Enterprise Linux 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 5.9 (64-bit)", "Red Hat Enterprise Linux 5 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 6.3 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 6.3 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 6.4 (32-bit)", "Red Hat Enterprise Linux 6 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Red Hat Enterprise Linux 6.4 (64-bit)", "Red Hat Enterprise Linux 6 (64-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", "SUSE Linux Enterprise Server 10 SP1 (32-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", "SUSE Linux Enterprise Server 10 SP1 (64-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", "SUSE Linux Enterprise Server 10 SP2 (32-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", "SUSE Linux Enterprise Server 10 SP2 (64-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", "SUSE Linux Enterprise Server 10 SP3 (32-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", "SUSE Linux Enterprise Server 10 SP3 (64-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", "SUSE Linux Enterprise Server 10 SP4 (32-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", "SUSE Linux Enterprise Server 10 SP4 (64-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 11 (32-bit)", "SUSE Linux Enterprise Server 11 (32-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 11 (64-bit)", "SUSE Linux Enterprise Server 11 (64-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", "SUSE Linux Enterprise Server 11 SP1 (32-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", "SUSE Linux Enterprise Server 11 SP1 (64-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 11 SP2 (32-bit)", "SUSE Linux Enterprise Server 11 SP2 (32-bit)");
+ XenServer620SP1GuestOsMap.put("SUSE Linux Enterprise Server 11 SP2 (64-bit)", "SUSE Linux Enterprise Server 11 SP2 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows 7 (32-bit)", "Windows 7 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Windows 7 (64-bit)", "Windows 7 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows 7 SP1 (32-bit)", "Windows 7 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Windows 7 SP1 (64-bit)", "Windows 7 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows 8 (32-bit)", "Windows 8 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Windows 8 (64-bit)", "Windows 8 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2003 SP2 (32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2003 SP2 (64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2003 PAE (32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2003 Enterprise Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2003 Enterprise Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2003 DataCenter Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2003 DataCenter Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2003 Standard Edition(32-bit)", "Windows Server 2003 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2003 Standard Edition(64-bit)", "Windows Server 2003 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2008 SP2 (32-bit)", "Windows Server 2008 (34-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2008 SP2 (64-bit)", "Windows Server 2008 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2008 R2 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2008 R2 SP1 (64-bit)", "Windows Server 2008 R2 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2012 (64-bit)", "Windows Server 2012 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Server 2012 R2 (64-bit)", "Windows Server 2012 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Windows Vista SP2 (32-bit)", "Windows Vista (32-bit)");
+ XenServer620SP1GuestOsMap.put("Windows XP SP3 (32-bit)", "Windows XP SP3 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Ubuntu 10.04 (32-bit)", "Ubuntu Lucid Lynx 10.04 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Ubuntu 10.04 (64-bit)", "Ubuntu Lucid Lynx 10.04 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Ubuntu 10.10 (32-bit)", "Ubuntu Maverick Meerkat 10.10 (32-bit) (experimental)");
+ XenServer620SP1GuestOsMap.put("Ubuntu 10.10 (64-bit)", "Ubuntu Maverick Meerkat 10.10 (64-bit) (experimental)");
+ XenServer620SP1GuestOsMap.put("Ubuntu 12.04 (32-bit)", "Ubuntu Precise Pangolin 12.04 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Ubuntu 12.04 (64-bit)", "Ubuntu Precise Pangolin 12.04 (64-bit)");
+ XenServer620SP1GuestOsMap.put("Ubuntu 11.04 (32-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Ubuntu 11.04 (64-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Other Linux (32-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Other Linux (64-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Other (32-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Other (64-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Other CentOS (32-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Other CentOS (64-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Other Ubuntu (32-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Other Ubuntu (64-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Other SUSE Linux(32-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Other SUSE Linux(64-bit)", "Other install media");
+ XenServer620SP1GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
+ XenServer620SP1GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
+ }
+
+ public static class MemoryValues {
+ long max;
+ long min;
+
+ public MemoryValues(long min, long max) {
+ this.min = min * 1024 * 1024;
+ this.max = max * 1024 * 1024;
+ }
+
+ public long getMax() {
+ return max;
+ }
+
+ public long getMin() {
+ return min;
+ }
+ }
+
+ static {
+ XenServer610GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Debian GNU/Linux 7(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Debian GNU/Linux 7(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(2 * 1024l, 128 * 1024l));
+ //_xenServer610GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ XenServer610GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ XenServer610GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Windows Vista (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(256l, 4 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ XenServer610GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32 * 1024l));
+ //_xenServer610GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ //_xenServer610GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ XenServer610GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer610GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128 * 1024l));
+ // XenServer610GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer610GuestOsMemoryMap.put("Other Linux (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer610GuestOsMemoryMap.put("Other (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer610GuestOsMemoryMap.put("Other (64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer610GuestOsMemoryMap.put("Other CentOS (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer610GuestOsMemoryMap.put("Other CentOS (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer610GuestOsMemoryMap.put("Other Ubuntu (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer610GuestOsMemoryMap.put("Other Ubuntu (64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer610GuestOsMemoryMap.put("Other SUSE Linux(32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer610GuestOsMemoryMap.put("Other SUSE Linux(64-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer610GuestOsMemoryMap.put("Other PV (32-bit)", new MemoryValues(512l, 16*1024l));
+ // XenServer610GuestOsMemoryMap.put("Other PV (64-bit)", new MemoryValues(512l, 16*1024l));
+ }
+
+ static {
+ XenServer620GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.8 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.8 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.9 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 5.9 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 6.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 6.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 6.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("CentOS 6.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Debian GNU/Linux 7(32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Debian GNU/Linux 7(64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.8 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.8 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.9 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 5.9 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 6.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 6.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 6.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Oracle Enterprise Linux 6.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.8 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.8 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.9 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.9 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+
+ XenServer620GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(2 * 1024l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows 7 SP1 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows 7 SP1 (64-bit)", new MemoryValues(2 * 1024l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(2 * 1024l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows Server 2003 SP2 (32-bit)", new MemoryValues(256l, 64 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows Server 2003 SP2 (64-bit)", new MemoryValues(256l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows Server 2008 SP2 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows Server 2008 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows Server 2008 R2 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows Vista SP2 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(256l, 4 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ XenServer620GuestOsMemoryMap.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)); //?
+ XenServer620GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer620GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128 * 1024l));
+ }
+
+
+ static {
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.8 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.8 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.9 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 5.9 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 6.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 6.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 6.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("CentOS 6.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Debian GNU/Linux 7(32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Debian GNU/Linux 7(64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.8 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.8 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.9 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.9 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.8 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.8 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.9 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.9 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP2 (32-bit)", new MemoryValues(512l, 16 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+
+ XenServer620SP1GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(2 * 1024l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows 7 SP1 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows 7 SP1 (64-bit)", new MemoryValues(2 * 1024l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(2 * 1024l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows Server 2003 SP2 (32-bit)", new MemoryValues(256l, 64 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows Server 2003 SP2 (64-bit)", new MemoryValues(256l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows Server 2008 SP2 (32-bit)", new MemoryValues(512l, 64 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows Server 2008 SP2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows Server 2008 R2 SP1 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows Server 2012 R2 (64-bit)", new MemoryValues(512l, 128 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows Vista SP2 (32-bit)", new MemoryValues(1024l, 4 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(256l, 4 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ XenServer620SP1GuestOsMemoryMap.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)); //?
+ XenServer620SP1GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32 * 1024l));
+ XenServer620SP1GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128 * 1024l));
+ }
+
+
+ public static String getXcpGuestOsType(String stdType) {
+ String guestOS = Xcp100GuestOsMap.get(stdType);
+ if (guestOS == null) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XCP's guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ }
+ return guestOS;
+ }
+
+ public static String getXcp160GuestOsType(String stdType) {
+ String guestOS = Xcp160GuestOsMap.get(stdType);
+ if (guestOS == null) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XCP's guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ }
+ return guestOS;
+ }
+
+ public static String getXenServerGuestOsType(String stdType, boolean bootFromCD) {
+ String guestOS = XenServerGuestOsMap.get(stdType);
+ if (guestOS == null) {
+ if (!bootFromCD) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 doesn't support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }
+ }
+ return guestOS;
+ }
+
+ public static String getXenServer56FP1GuestOsType(String stdType, boolean bootFromCD) {
+ String guestOS = XenServer56FP1GuestOsMap.get(stdType);
+ if (guestOS == null) {
+ if (!bootFromCD) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }
+ }
+ return guestOS;
+ }
+
+ public static long getXenServer56FP1StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer56FP1GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer56FP1StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer56FP1GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
+
+ public static String getXenServer56SP2GuestOsType(String stdType, boolean bootFromCD) {
+ String guestOS = XenServer56FP2GuestOsMap.get(stdType);
+ if (guestOS == null) {
+ if (!bootFromCD) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 SP2 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 SP2 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }
+ }
+ return guestOS;
+ }
+
+ public static long getXenServer56SP2StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer56SP2GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer56SP2StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer56SP2GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
+
+ public static String getXenServer600GuestOsType(String stdType, boolean bootFromCD) {
+ String guestOS = XenServer600GuestOsMap.get(stdType);
+ if (guestOS == null) {
+ if (!bootFromCD) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 6.0.2 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 6.0.2 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }
+
+ }
+ return guestOS;
+ }
+
+ public static long getXenServer600StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer600GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer600StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer600GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
+
+ public static String getXenServer602GuestOsType(String stdType, boolean bootFromCD) {
+ String guestOS = XenServer602GuestOsMap.get(stdType);
+ if (guestOS == null) {
+ if (!bootFromCD) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 6.0.2 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 6.0.2 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }
+
+ }
+ return guestOS;
+ }
+
+ public static long getXenServer602StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer602GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer602StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer602GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
+
+ public static String getXenServer610GuestOsType(String stdType, boolean bootFromCD) {
+ String guestOS = XenServer610GuestOsMap.get(stdType);
+ if (guestOS == null) {
+ if (!bootFromCD) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 6.1.0 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 6.1.0 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }
+ }
+ return guestOS;
+ }
+
+ public static long getXenServer610StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer610GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer610StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer610GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
+
+ public static String getXenServer620GuestOsType(String stdType, boolean bootFromCD) {
+ String guestOS = XenServer620GuestOsMap.get(stdType);
+ if (guestOS == null) {
+ if (!bootFromCD) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 6.2.0 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 6.2.0 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }
+ }
+ return guestOS;
+ }
+
+ public static String getXenServer620SP1GuestOsType(String stdType, boolean bootFromCD) {
+ String guestOS = XenServer620SP1GuestOsMap.get(stdType);
+ if (guestOS == null) {
+ if (!bootFromCD) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 6.2.0 SP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 6.2.0 SP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }
+ }
+ return guestOS;
+ }
+
+ public static String getXenServer625GuestOsType(String stdType, boolean bootFromCD) {
+ String guestOS = XenServer620SP1GuestOsMap.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) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer620StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer620GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
+
+ public static long getXenServer620SP1StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer620SP1GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer620SP1StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer620SP1GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
+
+ public static long getXenServer625StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer620SP1GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer625StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = XenServer620SP1GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
+}
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
new file mode 100644
index 00000000000..4213508f712
--- /dev/null
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -0,0 +1,7553 @@
+// 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.
+package com.cloud.hypervisor.xenserver.resource;
+
+import com.cloud.agent.IAgentControl;
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.AttachIsoCommand;
+import com.cloud.agent.api.AttachVolumeAnswer;
+import com.cloud.agent.api.AttachVolumeCommand;
+import com.cloud.agent.api.CheckHealthAnswer;
+import com.cloud.agent.api.CheckHealthCommand;
+import com.cloud.agent.api.CheckNetworkAnswer;
+import com.cloud.agent.api.CheckNetworkCommand;
+import com.cloud.agent.api.CheckOnHostAnswer;
+import com.cloud.agent.api.CheckOnHostCommand;
+import com.cloud.agent.api.CheckVirtualMachineAnswer;
+import com.cloud.agent.api.CheckVirtualMachineCommand;
+import com.cloud.agent.api.CleanupNetworkRulesCmd;
+import com.cloud.agent.api.ClusterSyncAnswer;
+import com.cloud.agent.api.ClusterSyncCommand;
+import com.cloud.agent.api.ClusterVMMetaDataSyncAnswer;
+import com.cloud.agent.api.ClusterVMMetaDataSyncCommand;
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.CreateStoragePoolCommand;
+import com.cloud.agent.api.CreateVMSnapshotAnswer;
+import com.cloud.agent.api.CreateVMSnapshotCommand;
+import com.cloud.agent.api.DeleteStoragePoolCommand;
+import com.cloud.agent.api.DeleteVMSnapshotAnswer;
+import com.cloud.agent.api.DeleteVMSnapshotCommand;
+import com.cloud.agent.api.GetHostStatsAnswer;
+import com.cloud.agent.api.GetHostStatsCommand;
+import com.cloud.agent.api.GetStorageStatsAnswer;
+import com.cloud.agent.api.GetStorageStatsCommand;
+import com.cloud.agent.api.GetVmDiskStatsAnswer;
+import com.cloud.agent.api.GetVmDiskStatsCommand;
+import com.cloud.agent.api.GetVmStatsAnswer;
+import com.cloud.agent.api.GetVmStatsCommand;
+import com.cloud.agent.api.GetVncPortAnswer;
+import com.cloud.agent.api.GetVncPortCommand;
+import com.cloud.agent.api.HostStatsEntry;
+import com.cloud.agent.api.HostVmStateReportEntry;
+import com.cloud.agent.api.MaintainAnswer;
+import com.cloud.agent.api.MaintainCommand;
+import com.cloud.agent.api.MigrateAnswer;
+import com.cloud.agent.api.MigrateCommand;
+import com.cloud.agent.api.ModifySshKeysCommand;
+import com.cloud.agent.api.ModifyStoragePoolAnswer;
+import com.cloud.agent.api.ModifyStoragePoolCommand;
+import com.cloud.agent.api.NetworkRulesSystemVmCommand;
+import com.cloud.agent.api.NetworkRulesVmSecondaryIpCommand;
+import com.cloud.agent.api.OvsCreateGreTunnelAnswer;
+import com.cloud.agent.api.OvsCreateGreTunnelCommand;
+import com.cloud.agent.api.OvsCreateTunnelAnswer;
+import com.cloud.agent.api.OvsCreateTunnelCommand;
+import com.cloud.agent.api.OvsDeleteFlowCommand;
+import com.cloud.agent.api.OvsDestroyBridgeCommand;
+import com.cloud.agent.api.OvsDestroyTunnelCommand;
+import com.cloud.agent.api.OvsFetchInterfaceAnswer;
+import com.cloud.agent.api.OvsFetchInterfaceCommand;
+import com.cloud.agent.api.OvsSetTagAndFlowAnswer;
+import com.cloud.agent.api.OvsSetTagAndFlowCommand;
+import com.cloud.agent.api.OvsSetupBridgeCommand;
+import com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand;
+import com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand;
+import com.cloud.agent.api.PerformanceMonitorAnswer;
+import com.cloud.agent.api.PerformanceMonitorCommand;
+import com.cloud.agent.api.PingCommand;
+import com.cloud.agent.api.PingRoutingCommand;
+import com.cloud.agent.api.PingRoutingWithNwGroupsCommand;
+import com.cloud.agent.api.PingRoutingWithOvsCommand;
+import com.cloud.agent.api.PingTestCommand;
+import com.cloud.agent.api.PlugNicAnswer;
+import com.cloud.agent.api.PlugNicCommand;
+import com.cloud.agent.api.PrepareForMigrationAnswer;
+import com.cloud.agent.api.PrepareForMigrationCommand;
+import com.cloud.agent.api.PvlanSetupCommand;
+import com.cloud.agent.api.ReadyAnswer;
+import com.cloud.agent.api.ReadyCommand;
+import com.cloud.agent.api.RebootAnswer;
+import com.cloud.agent.api.RebootCommand;
+import com.cloud.agent.api.RebootRouterCommand;
+import com.cloud.agent.api.RevertToVMSnapshotAnswer;
+import com.cloud.agent.api.RevertToVMSnapshotCommand;
+import com.cloud.agent.api.ScaleVmAnswer;
+import com.cloud.agent.api.ScaleVmCommand;
+import com.cloud.agent.api.SecurityGroupRuleAnswer;
+import com.cloud.agent.api.SecurityGroupRulesCmd;
+import com.cloud.agent.api.SetupAnswer;
+import com.cloud.agent.api.SetupCommand;
+import com.cloud.agent.api.SetupGuestNetworkCommand;
+import com.cloud.agent.api.StartAnswer;
+import com.cloud.agent.api.StartCommand;
+import com.cloud.agent.api.StartupCommand;
+import com.cloud.agent.api.StartupRoutingCommand;
+import com.cloud.agent.api.StartupStorageCommand;
+import com.cloud.agent.api.StopAnswer;
+import com.cloud.agent.api.StopCommand;
+import com.cloud.agent.api.StoragePoolInfo;
+import com.cloud.agent.api.UnPlugNicAnswer;
+import com.cloud.agent.api.UnPlugNicCommand;
+import com.cloud.agent.api.UpdateHostPasswordCommand;
+import com.cloud.agent.api.UpgradeSnapshotCommand;
+import com.cloud.agent.api.VmStatsEntry;
+import com.cloud.agent.api.check.CheckSshAnswer;
+import com.cloud.agent.api.check.CheckSshCommand;
+import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand;
+import com.cloud.agent.api.proxy.ConsoleProxyLoadAnswer;
+import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand;
+import com.cloud.agent.api.routing.IpAssocCommand;
+import com.cloud.agent.api.routing.IpAssocVpcCommand;
+import com.cloud.agent.api.routing.NetworkElementCommand;
+import com.cloud.agent.api.routing.SetNetworkACLCommand;
+import com.cloud.agent.api.routing.SetSourceNatCommand;
+import com.cloud.agent.api.storage.CreateAnswer;
+import com.cloud.agent.api.storage.CreateCommand;
+import com.cloud.agent.api.storage.DestroyCommand;
+import com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer;
+import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
+import com.cloud.agent.api.storage.ResizeVolumeAnswer;
+import com.cloud.agent.api.storage.ResizeVolumeCommand;
+import com.cloud.agent.api.to.DataStoreTO;
+import com.cloud.agent.api.to.DataTO;
+import com.cloud.agent.api.to.DiskTO;
+import com.cloud.agent.api.to.GPUDeviceTO;
+import com.cloud.agent.api.to.IpAddressTO;
+import com.cloud.agent.api.to.NfsTO;
+import com.cloud.agent.api.to.NicTO;
+import com.cloud.agent.api.to.StorageFilerTO;
+import com.cloud.agent.api.to.VirtualMachineTO;
+import com.cloud.agent.api.to.VolumeTO;
+import com.cloud.agent.resource.virtualnetwork.VirtualRouterDeployer;
+import com.cloud.agent.resource.virtualnetwork.VirtualRoutingResource;
+import com.cloud.exception.InternalErrorException;
+import com.cloud.host.Host.Type;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.network.Networks;
+import com.cloud.network.Networks.BroadcastDomainType;
+import com.cloud.network.Networks.IsolationType;
+import com.cloud.network.Networks.TrafficType;
+import com.cloud.network.PhysicalNetworkSetupInfo;
+import com.cloud.resource.ServerResource;
+import com.cloud.resource.hypervisor.HypervisorResource;
+import com.cloud.storage.Storage;
+import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.Volume;
+import com.cloud.storage.VolumeVO;
+import com.cloud.storage.resource.StorageSubsystemCommandHandler;
+import com.cloud.storage.resource.StorageSubsystemCommandHandlerBase;
+import com.cloud.storage.template.TemplateProp;
+import com.cloud.template.VirtualMachineTemplate.BootloaderType;
+import com.cloud.utils.ExecutionResult;
+import com.cloud.utils.NumbersUtil;
+import com.cloud.utils.Pair;
+import com.cloud.utils.StringUtils;
+import com.cloud.utils.Ternary;
+import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.net.NetUtils;
+import com.cloud.utils.ssh.SSHCmdHelper;
+import com.cloud.vm.DiskProfile;
+import com.cloud.vm.VirtualMachine;
+import com.cloud.vm.VirtualMachine.PowerState;
+import com.cloud.vm.VirtualMachine.State;
+import com.cloud.vm.snapshot.VMSnapshot;
+import com.trilead.ssh2.SCPClient;
+import com.xensource.xenapi.Bond;
+import com.xensource.xenapi.Connection;
+import com.xensource.xenapi.Console;
+import com.xensource.xenapi.Host;
+import com.xensource.xenapi.HostCpu;
+import com.xensource.xenapi.HostMetrics;
+import com.xensource.xenapi.Network;
+import com.xensource.xenapi.PBD;
+import com.xensource.xenapi.PIF;
+import com.xensource.xenapi.Pool;
+import com.xensource.xenapi.SR;
+import com.xensource.xenapi.Session;
+import com.xensource.xenapi.Task;
+import com.xensource.xenapi.Types;
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.VmPowerState;
+import com.xensource.xenapi.Types.XenAPIException;
+import com.xensource.xenapi.VBD;
+import com.xensource.xenapi.VBDMetrics;
+import com.xensource.xenapi.VDI;
+import com.xensource.xenapi.VGPU;
+import com.xensource.xenapi.VIF;
+import com.xensource.xenapi.VLAN;
+import com.xensource.xenapi.VM;
+import com.xensource.xenapi.VMGuestMetrics;
+import com.xensource.xenapi.XenAPIObject;
+import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
+import org.apache.cloudstack.storage.to.TemplateObjectTO;
+import org.apache.cloudstack.storage.to.VolumeObjectTO;
+import org.apache.log4j.Logger;
+import org.apache.xmlrpc.XmlRpcException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import javax.ejb.Local;
+import javax.naming.ConfigurationException;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Queue;
+import java.util.Random;
+import java.util.Set;
+import java.util.UUID;
+
+/**
+ * CitrixResourceBase encapsulates the calls to the XenServer Xapi process
+ * to perform the required functionalities for CloudStack.
+ *
+ * ==============> READ THIS <==============
+ * Because the XenServer objects can expire when the session expires, we cannot
+ * keep any of the actual XenServer objects in this class. The only
+ * thing that is constant is the UUID of the XenServer objects but not the
+ * objects themselves! This is very important before you do any changes in
+ * this code here.
+ *
+ */
+@Local(value = ServerResource.class)
+public abstract class CitrixResourceBase implements ServerResource, HypervisorResource, VirtualRouterDeployer {
+ private static final Logger s_logger = Logger.getLogger(CitrixResourceBase.class);
+ protected static final XenServerConnectionPool ConnPool = XenServerConnectionPool.getInstance();
+ protected String _name;
+ protected String _username;
+ protected Queue _password = new LinkedList();
+ protected final int _retry = 100;
+ protected final int _sleep = 10000;
+ protected long _dcId;
+ protected String _pod;
+ protected String _cluster;
+ protected static final XenServerPoolVms s_vms = new XenServerPoolVms();
+ protected String _privateNetworkName;
+ protected String _linkLocalPrivateNetworkName;
+ protected String _publicNetworkName;
+ protected String _storageNetworkName1;
+ protected String _storageNetworkName2;
+ protected String _guestNetworkName;
+ protected int _wait;
+ protected int _migratewait;
+ protected String _instance; //instance name (default is usually "VM")
+ static final Random Rand = new Random(System.currentTimeMillis());
+ protected boolean _securityGroupEnabled;
+
+ protected IAgentControl _agentControl;
+
+ final int _maxWeight = 256;
+ protected int _heartbeatInterval = 60;
+ protected final XsHost _host = new XsHost();
+
+ // Guest and Host Performance Statistics
+ protected String _consolidationFunction = "AVERAGE";
+ protected int _pollingIntervalInSeconds = 60;
+
+ //Hypervisor specific params with generic value, may need to be overridden for specific versions
+ long _xsMemoryUsed = 128 * 1024 * 1024L; // xen hypervisor used 128 M
+ double _xsVirtualizationFactor = 63.0 / 64.0; // 1 - virtualization overhead
+
+ //static min values for guests on xen
+ private static final long mem_128m = 134217728L;
+
+ protected boolean _canBridgeFirewall = false;
+ protected boolean _isOvs = false;
+ protected List _tmpDom0Vif = new ArrayList();
+ protected StorageSubsystemCommandHandler storageHandler;
+ protected int _maxNics = 7;
+
+ protected VirtualRoutingResource _vrResource;
+
+ public enum SRType {
+ NFS, LVM, ISCSI, ISO, LVMOISCSI, LVMOHBA, EXT, FILE;
+
+ String _str;
+
+ private SRType() {
+ _str = super.toString().toLowerCase();
+ }
+
+ @Override
+ public String toString() {
+ return _str;
+ }
+
+ public boolean equals(String type) {
+ return _str.equalsIgnoreCase(type);
+ }
+ }
+
+ protected static final HashMap s_powerStatesTable;
+ static {
+ s_powerStatesTable = new HashMap();
+ s_powerStatesTable.put(Types.VmPowerState.HALTED, PowerState.PowerOff);
+ s_powerStatesTable.put(Types.VmPowerState.PAUSED, PowerState.PowerOff);
+ s_powerStatesTable.put(Types.VmPowerState.RUNNING, PowerState.PowerOn);
+ s_powerStatesTable.put(Types.VmPowerState.SUSPENDED, PowerState.PowerOff);
+ s_powerStatesTable.put(Types.VmPowerState.UNRECOGNIZED, PowerState.PowerUnknown);
+ }
+
+ // TODO vmsync {
+ protected static final HashMap s_statesTable;
+ static {
+ s_statesTable = new HashMap();
+ s_statesTable.put(Types.VmPowerState.HALTED, State.Stopped);
+ s_statesTable.put(Types.VmPowerState.PAUSED, State.Running);
+ s_statesTable.put(Types.VmPowerState.RUNNING, State.Running);
+ s_statesTable.put(Types.VmPowerState.SUSPENDED, State.Running);
+ s_statesTable.put(Types.VmPowerState.UNRECOGNIZED, State.Unknown);
+ }
+
+ // TODO vmsync }
+
+ public XsHost getHost() {
+ return _host;
+ }
+
+ private static boolean isAlienVm(VM vm, Connection conn) throws XenAPIException, XmlRpcException {
+ // TODO : we need a better way to tell whether or not the VM belongs to CloudStack
+ String vmName = vm.getNameLabel(conn);
+ if (vmName.matches("^[ivs]-\\d+-.+"))
+ return false;
+
+ return true;
+ }
+
+ protected boolean cleanupHaltedVms(Connection conn) throws XenAPIException, XmlRpcException {
+ Host host = Host.getByUuid(conn, _host.uuid);
+ Map vms = VM.getAllRecords(conn);
+ boolean success = true;
+ for (Map.Entry entry : vms.entrySet()) {
+ VM vm = entry.getKey();
+ VM.Record vmRec = entry.getValue();
+ if (vmRec.isATemplate || vmRec.isControlDomain) {
+ continue;
+ }
+
+ if (VmPowerState.HALTED.equals(vmRec.powerState) && vmRec.affinity.equals(host) && !isAlienVm(vm, conn)) {
+ try {
+ vm.destroy(conn);
+ } catch (Exception e) {
+ s_logger.warn("Catch Exception " + e.getClass().getName() + ": unable to destroy VM " + vmRec.nameLabel + " due to ", e);
+ success = false;
+ }
+ }
+ }
+ return success;
+ }
+
+ protected boolean isRefNull(XenAPIObject object) {
+ return (object == null || object.toWireString().equals("OpaqueRef:NULL") || object.toWireString().equals(""));
+ }
+
+ @Override
+ public void disconnected() {
+ }
+
+ protected boolean pingdomr(Connection conn, String host, String port) {
+ String status;
+ status = callHostPlugin(conn, "vmops", "pingdomr", "host", host, "port", port);
+
+ if (status == null || status.isEmpty()) {
+ return false;
+ }
+
+ return true;
+
+ }
+
+ protected boolean pingXAPI() {
+ Connection conn = getConnection();
+ try {
+ Host host = Host.getByUuid(conn, _host.uuid);
+ if( !host.getEnabled(conn) ) {
+ s_logger.debug("Host " + _host.ip + " is not enabled!");
+ return false;
+ }
+ } catch (Exception e) {
+ s_logger.debug("cannot get host enabled status, host " + _host.ip + " due to " + e.toString(), e);
+ return false;
+ }
+ try {
+ callHostPlugin(conn, "echo", "main");
+ } catch (Exception e) {
+ s_logger.debug("cannot ping host " + _host.ip + " due to " + e.toString(), e);
+ return false;
+ }
+ return true;
+ }
+
+
+ protected String logX(XenAPIObject obj, String msg) {
+ return new StringBuilder("Host ").append(_host.ip).append(" ").append(obj.toWireString()).append(": ").append(msg).toString();
+ }
+
+ @Override
+ public Answer executeRequest(Command cmd) {
+ Class extends Command> clazz = cmd.getClass();
+ if (clazz == CreateCommand.class) {
+ return execute((CreateCommand)cmd);
+ } else if (cmd instanceof NetworkElementCommand) {
+ return _vrResource.executeRequest((NetworkElementCommand)cmd);
+ } else if (clazz == CheckConsoleProxyLoadCommand.class) {
+ return execute((CheckConsoleProxyLoadCommand)cmd);
+ } else if (clazz == WatchConsoleProxyLoadCommand.class) {
+ return execute((WatchConsoleProxyLoadCommand)cmd);
+ } else if (clazz == ReadyCommand.class) {
+ return execute((ReadyCommand)cmd);
+ } else if (clazz == GetHostStatsCommand.class) {
+ return execute((GetHostStatsCommand)cmd);
+ } else if (clazz == GetVmStatsCommand.class) {
+ return execute((GetVmStatsCommand)cmd);
+ } else if (clazz == GetVmDiskStatsCommand.class) {
+ return execute((GetVmDiskStatsCommand)cmd);
+ } else if (clazz == CheckHealthCommand.class) {
+ return execute((CheckHealthCommand)cmd);
+ } else if (clazz == StopCommand.class) {
+ return execute((StopCommand)cmd);
+ } else if (clazz == RebootRouterCommand.class) {
+ return execute((RebootRouterCommand)cmd);
+ } else if (clazz == RebootCommand.class) {
+ return execute((RebootCommand)cmd);
+ } else if (clazz == CheckVirtualMachineCommand.class) {
+ return execute((CheckVirtualMachineCommand)cmd);
+ } else if (clazz == PrepareForMigrationCommand.class) {
+ return execute((PrepareForMigrationCommand)cmd);
+ } else if (clazz == MigrateCommand.class) {
+ return execute((MigrateCommand)cmd);
+ } else if (clazz == DestroyCommand.class) {
+ return execute((DestroyCommand)cmd);
+ } else if (clazz == CreateStoragePoolCommand.class) {
+ return execute((CreateStoragePoolCommand)cmd);
+ } else if (clazz == ModifyStoragePoolCommand.class) {
+ return execute((ModifyStoragePoolCommand)cmd);
+ } else if (clazz == DeleteStoragePoolCommand.class) {
+ return execute((DeleteStoragePoolCommand) cmd);
+ }else if (clazz == ResizeVolumeCommand.class) {
+ return execute((ResizeVolumeCommand) cmd);
+ } else if (clazz == AttachVolumeCommand.class) {
+ return execute((AttachVolumeCommand)cmd);
+ } else if (clazz == AttachIsoCommand.class) {
+ return execute((AttachIsoCommand) cmd);
+ } else if (clazz == UpgradeSnapshotCommand.class) {
+ return execute((UpgradeSnapshotCommand)cmd);
+ } else if (clazz == GetStorageStatsCommand.class) {
+ return execute((GetStorageStatsCommand)cmd);
+ } else if (clazz == PrimaryStorageDownloadCommand.class) {
+ return execute((PrimaryStorageDownloadCommand)cmd);
+ } else if (clazz == GetVncPortCommand.class) {
+ return execute((GetVncPortCommand)cmd);
+ } else if (clazz == SetupCommand.class) {
+ return execute((SetupCommand)cmd);
+ } else if (clazz == MaintainCommand.class) {
+ return execute((MaintainCommand)cmd);
+ } else if (clazz == PingTestCommand.class) {
+ return execute((PingTestCommand)cmd);
+ } else if (clazz == CheckOnHostCommand.class) {
+ return execute((CheckOnHostCommand)cmd);
+ } else if (clazz == ModifySshKeysCommand.class) {
+ return execute((ModifySshKeysCommand)cmd);
+ } else if (clazz == StartCommand.class) {
+ return execute((StartCommand)cmd);
+ } else if (clazz == CheckSshCommand.class) {
+ return execute((CheckSshCommand)cmd);
+ } else if (clazz == SecurityGroupRulesCmd.class) {
+ return execute((SecurityGroupRulesCmd)cmd);
+ } else if (clazz == OvsFetchInterfaceCommand.class) {
+ return execute((OvsFetchInterfaceCommand)cmd);
+ } else if (clazz == OvsCreateGreTunnelCommand.class) {
+ return execute((OvsCreateGreTunnelCommand)cmd);
+ } else if (clazz == OvsSetTagAndFlowCommand.class) {
+ return execute((OvsSetTagAndFlowCommand)cmd);
+ } else if (clazz == OvsDeleteFlowCommand.class) {
+ return execute((OvsDeleteFlowCommand)cmd);
+ } else if (clazz == OvsVpcPhysicalTopologyConfigCommand.class) {
+ return execute((OvsVpcPhysicalTopologyConfigCommand) cmd);
+ } else if (clazz == OvsVpcRoutingPolicyConfigCommand.class) {
+ return execute((OvsVpcRoutingPolicyConfigCommand) cmd);
+ } else if (clazz == CleanupNetworkRulesCmd.class) {
+ return execute((CleanupNetworkRulesCmd)cmd);
+ } else if (clazz == NetworkRulesSystemVmCommand.class) {
+ return execute((NetworkRulesSystemVmCommand)cmd);
+ } else if (clazz == OvsCreateTunnelCommand.class) {
+ return execute((OvsCreateTunnelCommand)cmd);
+ } else if (clazz == OvsSetupBridgeCommand.class) {
+ return execute((OvsSetupBridgeCommand)cmd);
+ } else if (clazz == OvsDestroyBridgeCommand.class) {
+ return execute((OvsDestroyBridgeCommand)cmd);
+ } else if (clazz == OvsDestroyTunnelCommand.class) {
+ return execute((OvsDestroyTunnelCommand)cmd);
+ } else if (clazz == UpdateHostPasswordCommand.class) {
+ return execute((UpdateHostPasswordCommand)cmd);
+ } else if (cmd instanceof ClusterSyncCommand) {
+ return execute((ClusterSyncCommand)cmd);
+ } else if (cmd instanceof ClusterVMMetaDataSyncCommand) {
+ return execute((ClusterVMMetaDataSyncCommand)cmd);
+ } else if (clazz == CheckNetworkCommand.class) {
+ return execute((CheckNetworkCommand)cmd);
+ } else if (clazz == PlugNicCommand.class) {
+ return execute((PlugNicCommand)cmd);
+ } else if (clazz == UnPlugNicCommand.class) {
+ return execute((UnPlugNicCommand) cmd);
+ } else if (cmd instanceof StorageSubSystemCommand) {
+ return storageHandler.handleStorageCommands((StorageSubSystemCommand) cmd);
+ } else if (clazz == CreateVMSnapshotCommand.class) {
+ return execute((CreateVMSnapshotCommand) cmd);
+ } else if (clazz == DeleteVMSnapshotCommand.class) {
+ return execute((DeleteVMSnapshotCommand) cmd);
+ } else if (clazz == RevertToVMSnapshotCommand.class) {
+ return execute((RevertToVMSnapshotCommand) cmd);
+ } else if (clazz == NetworkRulesVmSecondaryIpCommand.class) {
+ return execute((NetworkRulesVmSecondaryIpCommand) cmd);
+ } else if (clazz == ScaleVmCommand.class) {
+ return execute((ScaleVmCommand)cmd);
+ } else if (clazz == PvlanSetupCommand.class) {
+ return execute((PvlanSetupCommand)cmd);
+ } else if (clazz == PerformanceMonitorCommand.class) {
+ return execute((PerformanceMonitorCommand)cmd);
+ } else {
+ return Answer.createUnsupportedCommandAnswer(cmd);
+ }
+ }
+
+ @Override
+ public ExecutionResult executeInVR(String routerIP, String script, String args, int timeout) {
+ Connection conn = getConnection();
+ String rc = callHostPluginAsync(conn, "vmops", "routerProxy", timeout, "args", script + " " + routerIP + " " + args);
+ // Fail case would be start with "fail#"
+ return new ExecutionResult(rc.startsWith("succ#"), rc.substring(5));
+ }
+
+ @Override
+ public ExecutionResult executeInVR(String routerIP, String script, String args) {
+ // Timeout is 120 seconds by default
+ return executeInVR(routerIP, script, args, 120);
+ }
+
+ @Override
+ public ExecutionResult createFileInVR(String routerIp, String path, String filename, String content) {
+ Connection conn = getConnection();
+ String rc = callHostPlugin(conn, "vmops", "createFileInDomr", "domrip", routerIp, "filepath", path + filename, "filecontents", content);
+ // Fail case would be start with "fail#"
+ return new ExecutionResult(rc.startsWith("succ#"), rc.substring(5));
+ }
+
+ @Override
+ public ExecutionResult prepareCommand(NetworkElementCommand cmd) {
+ //Update IP used to access router
+ cmd.setRouterAccessIp(cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP));
+ assert cmd.getRouterAccessIp() != null;
+
+ if (cmd instanceof IpAssocVpcCommand) {
+ return prepareNetworkElementCommand((IpAssocVpcCommand)cmd);
+ } else if (cmd instanceof IpAssocCommand) {
+ return prepareNetworkElementCommand((IpAssocCommand)cmd);
+ } else if (cmd instanceof SetupGuestNetworkCommand) {
+ return prepareNetworkElementCommand((SetupGuestNetworkCommand)cmd);
+ } else if (cmd instanceof SetSourceNatCommand) {
+ return prepareNetworkElementCommand((SetSourceNatCommand)cmd);
+ } else if (cmd instanceof SetNetworkACLCommand) {
+ return prepareNetworkElementCommand((SetNetworkACLCommand)cmd);
+ }
+ return new ExecutionResult(true, null);
+ }
+
+ @Override
+ public ExecutionResult cleanupCommand(NetworkElementCommand cmd) {
+ if (cmd instanceof IpAssocCommand && !(cmd instanceof IpAssocVpcCommand)) {
+ return cleanupNetworkElementCommand((IpAssocCommand)cmd);
+ }
+ return new ExecutionResult(true, null);
+ }
+
+ private Answer execute(PerformanceMonitorCommand cmd) {
+ Connection conn = getConnection();
+ String perfMon = getPerfMon(conn, cmd.getParams(), cmd.getWait());
+ if (perfMon == null) {
+ return new PerformanceMonitorAnswer(cmd, false, perfMon);
+ } else
+ return new PerformanceMonitorAnswer(cmd, true, perfMon);
+ }
+
+ private String getPerfMon(Connection conn, Map params,
+ int wait) {
+ String result = null;
+ try {
+ result = callHostPluginAsync(conn, "vmopspremium", "asmonitor", 60,
+ params);
+ if (result != null)
+ return result;
+ } catch (Exception e) {
+ s_logger.error("Can not get performance monitor for AS due to ", e);
+ }
+ return null;
+ }
+
+ protected String callHostPluginAsync(Connection conn, String plugin,
+ String cmd, int wait, Map params) {
+ int timeout = wait * 1000;
+ Map args = new HashMap();
+ Task task = null;
+ try {
+ for (String key : params.keySet()) {
+ args.put(key, params.get(key));
+ }
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace("callHostPlugin executing for command " + cmd
+ + " with " + getArgsString(args));
+ }
+ Host host = Host.getByUuid(conn, _host.uuid);
+ task = host.callPluginAsync(conn, plugin, cmd, args);
+ // poll every 1 seconds
+ waitForTask(conn, task, 1000, timeout);
+ checkForSuccess(conn, task);
+ String result = task.getResult(conn);
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace("callHostPlugin Result: " + result);
+ }
+ return result.replace("", "").replace("", "")
+ .replace("\n", "");
+ } catch (Types.HandleInvalid e) {
+ s_logger.warn("callHostPlugin failed for cmd: " + cmd
+ + " with args " + getArgsString(args)
+ + " due to HandleInvalid clazz:" + e.clazz + ", handle:"
+ + e.handle);
+ } catch (XenAPIException e) {
+ s_logger.warn(
+ "callHostPlugin failed for cmd: " + cmd + " with args "
+ + getArgsString(args) + " due to " + e.toString(),
+ e);
+ } catch (XmlRpcException e) {
+ s_logger.warn(
+ "callHostPlugin failed for cmd: " + cmd + " with args "
+ + getArgsString(args) + " due to " + e.getMessage(),
+ e);
+ } finally {
+ if (task != null) {
+ try {
+ task.destroy(conn);
+ } catch (Exception e1) {
+ s_logger.warn("unable to destroy task(" + task.toString()
+ + ") on host(" + _host.uuid + ") due to ", e1);
+ }
+ }
+ }
+ return null;
+ }
+
+ protected void scaleVM(Connection conn, VM vm, VirtualMachineTO vmSpec, Host host) throws XenAPIException, XmlRpcException {
+
+ Long staticMemoryMax = vm.getMemoryStaticMax(conn);
+ Long staticMemoryMin = vm.getMemoryStaticMin(conn);
+ Long newDynamicMemoryMin = vmSpec.getMinRam();
+ Long newDynamicMemoryMax = vmSpec.getMaxRam();
+ if (staticMemoryMin > newDynamicMemoryMin || newDynamicMemoryMax > staticMemoryMax) {
+ throw new CloudRuntimeException("Cannot scale up the vm because of memory constraint violation: " + "0 <= memory-static-min(" + staticMemoryMin +
+ ") <= memory-dynamic-min(" + newDynamicMemoryMin + ") <= memory-dynamic-max(" + newDynamicMemoryMax + ") <= memory-static-max(" + staticMemoryMax + ")");
+ }
+
+ vm.setMemoryDynamicRange(conn, newDynamicMemoryMin, newDynamicMemoryMax);
+ vm.setVCPUsNumberLive(conn, (long)vmSpec.getCpus());
+
+ Integer speed = vmSpec.getMinSpeed();
+ if (speed != null) {
+
+ int cpuWeight = _maxWeight; //cpu_weight
+
+ // weight based allocation
+
+ cpuWeight = (int)((speed * 0.99) / _host.speed * _maxWeight);
+ if (cpuWeight > _maxWeight) {
+ cpuWeight = _maxWeight;
+ }
+
+ if (vmSpec.getLimitCpuUse()) {
+ long utilization = 0; // max CPU cap, default is unlimited
+ utilization = (int)((vmSpec.getMaxSpeed() * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
+ //vm.addToVCPUsParamsLive(conn, "cap", Long.toString(utilization)); currently xenserver doesnot support Xapi to add VCPUs params live.
+ callHostPlugin(conn, "vmops", "add_to_VCPUs_params_live", "key", "cap", "value", Long.toString(utilization), "vmname", vmSpec.getName());
+ }
+ //vm.addToVCPUsParamsLive(conn, "weight", Integer.toString(cpuWeight));
+ callHostPlugin(conn, "vmops", "add_to_VCPUs_params_live", "key", "weight", "value", Integer.toString(cpuWeight), "vmname", vmSpec.getName());
+ }
+ }
+
+ public ScaleVmAnswer execute(ScaleVmCommand cmd) {
+ VirtualMachineTO vmSpec = cmd.getVirtualMachine();
+ String vmName = vmSpec.getName();
+ try {
+ Connection conn = getConnection();
+ Set vms = VM.getByNameLabel(conn, vmName);
+ Host host = Host.getByUuid(conn, _host.uuid);
+
+ // If DMC is not enable then don't execute this command.
+ if (!isDmcEnabled(conn, host)) {
+ throw new CloudRuntimeException("Unable to scale the vm: " + vmName + " as DMC - Dynamic memory control is not enabled for the XenServer:" + _host.uuid +
+ " ,check your license and hypervisor version.");
+ }
+
+ // stop vm which is running on this host or is in halted state
+ Iterator iter = vms.iterator();
+ while (iter.hasNext()) {
+ VM vm = iter.next();
+ VM.Record vmr = vm.getRecord(conn);
+
+ if ((vmr.powerState == VmPowerState.HALTED) ||
+ (vmr.powerState == VmPowerState.RUNNING && !isRefNull(vmr.residentOn) && !vmr.residentOn.getUuid(conn).equals(_host.uuid))) {
+ iter.remove();
+ }
+ }
+
+ if (vms.size() == 0) {
+ s_logger.info("No running VM " + vmName + " exists on XenServer" + _host.uuid);
+ return new ScaleVmAnswer(cmd, false, "VM does not exist");
+ }
+
+ for (VM vm : vms) {
+ vm.getRecord(conn);
+ try {
+ scaleVM(conn, vm, vmSpec, host);
+ } catch (Exception e) {
+ String msg = "Catch exception " + e.getClass().getName() + " when scaling VM:" + vmName + " due to " + e.toString();
+ s_logger.debug(msg);
+ return new ScaleVmAnswer(cmd, false, msg);
+ }
+
+ }
+ String msg = "scaling VM " + vmName + " is successful on host " + host;
+ s_logger.debug(msg);
+ return new ScaleVmAnswer(cmd, true, msg);
+
+ } catch (XenAPIException e) {
+ String msg = "Upgrade Vm " + vmName + " fail due to " + e.toString();
+ s_logger.warn(msg, e);
+ return new ScaleVmAnswer(cmd, false, msg);
+ } catch (XmlRpcException e) {
+ String msg = "Upgrade Vm " + vmName + " fail due to " + e.getMessage();
+ s_logger.warn(msg, e);
+ return new ScaleVmAnswer(cmd, false, msg);
+ } catch (Exception e) {
+ String msg = "Unable to upgrade " + vmName + " due to " + e.getMessage();
+ s_logger.warn(msg, e);
+ return new ScaleVmAnswer(cmd, false, msg);
+ }
+ }
+
+ private Answer execute(RevertToVMSnapshotCommand cmd) {
+ String vmName = cmd.getVmName();
+ List listVolumeTo = cmd.getVolumeTOs();
+ VMSnapshot.Type vmSnapshotType = cmd.getTarget().getType();
+ Boolean snapshotMemory = vmSnapshotType == VMSnapshot.Type.DiskAndMemory;
+ Connection conn = getConnection();
+ VirtualMachine.State vmState = null;
+ VM vm = null;
+ try {
+
+ // remove vm from s_vms, for delta sync
+ s_vms.remove(_cluster, _name, vmName);
+
+ Set vmSnapshots = VM.getByNameLabel(conn, cmd.getTarget().getSnapshotName());
+ if (vmSnapshots.size() == 0)
+ return new RevertToVMSnapshotAnswer(cmd, false, "Cannot find vmSnapshot with name: " + cmd.getTarget().getSnapshotName());
+
+ VM vmSnapshot = vmSnapshots.iterator().next();
+
+ // find target VM or creating a work VM
+ try {
+ vm = getVM(conn, vmName);
+ } catch (Exception e) {
+ vm = createWorkingVM(conn, vmName, cmd.getGuestOSType(), listVolumeTo);
+ }
+
+ if (vm == null) {
+ return new RevertToVMSnapshotAnswer(cmd, false, "Revert to VM Snapshot Failed due to can not find vm: " + vmName);
+ }
+
+ // call plugin to execute revert
+ revertToSnapshot(conn, vmSnapshot, vmName, vm.getUuid(conn), snapshotMemory, _host.uuid);
+ vm = getVM(conn, vmName);
+ Set vbds = vm.getVBDs(conn);
+ Map vdiMap = new HashMap();
+ // get vdi:vbdr to a map
+ for (VBD vbd : vbds) {
+ VBD.Record vbdr = vbd.getRecord(conn);
+ if (vbdr.type == Types.VbdType.DISK) {
+ VDI vdi = vbdr.VDI;
+ vdiMap.put(vbdr.userdevice, vdi);
+ }
+ }
+
+ if (!snapshotMemory) {
+ vm.destroy(conn);
+ vmState = VirtualMachine.State.Stopped;
+ } else {
+ s_vms.put(_cluster, _name, vmName, State.Running);
+ vmState = VirtualMachine.State.Running;
+ }
+
+ // after revert, VM's volumes path have been changed, need to report to manager
+ for (VolumeObjectTO volumeTo : listVolumeTo) {
+ Long deviceId = volumeTo.getDeviceId();
+ VDI vdi = vdiMap.get(deviceId.toString());
+ volumeTo.setPath(vdi.getUuid(conn));
+ }
+
+ return new RevertToVMSnapshotAnswer(cmd, listVolumeTo, vmState);
+ } catch (Exception e) {
+ s_logger.error("revert vm " + vmName + " to snapshot " + cmd.getTarget().getSnapshotName() + " failed due to " + e.getMessage());
+ return new RevertToVMSnapshotAnswer(cmd, false, e.getMessage());
+ }
+ }
+
+ protected String revertToSnapshot(Connection conn, VM vmSnapshot, String vmName, String oldVmUuid, Boolean snapshotMemory, String hostUUID) throws XenAPIException,
+ XmlRpcException {
+
+ String results =
+ callHostPluginAsync(conn, "vmopsSnapshot", "revert_memory_snapshot", 10 * 60 * 1000, "snapshotUUID", vmSnapshot.getUuid(conn), "vmName", vmName, "oldVmUuid",
+ oldVmUuid, "snapshotMemory", snapshotMemory.toString(), "hostUUID", hostUUID);
+ String errMsg = null;
+ if (results == null || results.isEmpty()) {
+ errMsg = "revert_memory_snapshot return null";
+ } else {
+ if (results.equals("0")) {
+ return results;
+ } else {
+ errMsg = "revert_memory_snapshot exception";
+ }
+ }
+ s_logger.warn(errMsg);
+ throw new CloudRuntimeException(errMsg);
+ }
+
+ protected XsLocalNetwork getNativeNetworkForTraffic(Connection conn, TrafficType type, String name) throws XenAPIException, XmlRpcException {
+ if (name != null) {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Looking for network named " + name);
+ }
+ return getNetworkByName(conn, name);
+ }
+
+ if (type == TrafficType.Guest) {
+ return new XsLocalNetwork(Network.getByUuid(conn, _host.guestNetwork), null, PIF.getByUuid(conn, _host.guestPif), null);
+ } else if (type == TrafficType.Control) {
+ setupLinkLocalNetwork(conn);
+ return new XsLocalNetwork(Network.getByUuid(conn, _host.linkLocalNetwork));
+ } else if (type == TrafficType.Management) {
+ return new XsLocalNetwork(Network.getByUuid(conn, _host.privateNetwork), null, PIF.getByUuid(conn, _host.privatePif), null);
+ } else if (type == TrafficType.Public) {
+ return new XsLocalNetwork(Network.getByUuid(conn, _host.publicNetwork), null, PIF.getByUuid(conn, _host.publicPif), null);
+ } else if (type == TrafficType.Storage) {
+ /* TrafficType.Storage is for secondary storage, while storageNetwork1 is for primary storage, we need better name here */
+ return new XsLocalNetwork(Network.getByUuid(conn, _host.storageNetwork1), null, PIF.getByUuid(conn, _host.storagePif1), null);
+ }
+
+ throw new CloudRuntimeException("Unsupported network type: " + type);
+ }
+
+ /**
+ * This is a tricky to create network in xenserver.
+ * if you create a network then create bridge by brctl or openvswitch yourself,
+ * then you will get an expection that is "REQUIRED_NETWROK" when you start a
+ * vm with this network. The soultion is, create a vif of dom0 and plug it in
+ * network, xenserver will create the bridge on behalf of you
+ * @throws XmlRpcException
+ * @throws XenAPIException
+ */
+ private void enableXenServerNetwork(Connection conn, Network nw, String vifNameLabel, String networkDesc) throws XenAPIException, XmlRpcException {
+ /* Make sure there is a physical bridge on this network */
+ VIF dom0vif = null;
+ Pair vm = getControlDomain(conn);
+ VM dom0 = vm.first();
+ // Create a VIF unless there's not already another VIF
+ Set dom0Vifs = dom0.getVIFs(conn);
+ for (VIF vif : dom0Vifs) {
+ vif.getRecord(conn);
+ if (vif.getNetwork(conn).getUuid(conn).equals(nw.getUuid(conn))) {
+ dom0vif = vif;
+ s_logger.debug("A VIF for dom0 has already been found - No need to create one");
+ }
+ }
+ if (dom0vif == null) {
+ s_logger.debug("Create a vif on dom0 for " + networkDesc);
+ VIF.Record vifr = new VIF.Record();
+ vifr.VM = dom0;
+ vifr.device = getLowestAvailableVIFDeviceNum(conn, dom0);
+ if (vifr.device == null) {
+ s_logger.debug("Failed to create " + networkDesc + ", no vif available");
+ return;
+ }
+ Map config = new HashMap();
+ config.put("nameLabel", vifNameLabel);
+ vifr.otherConfig = config;
+ vifr.MAC = "FE:FF:FF:FF:FF:FF";
+ vifr.network = nw;
+
+ vifr.lockingMode = Types.VifLockingMode.NETWORK_DEFAULT;
+ dom0vif = VIF.create(conn, vifr);
+ }
+ // At this stage we surely have a VIF
+ dom0vif.plug(conn);
+ dom0vif.unplug(conn);
+ synchronized (_tmpDom0Vif) {
+ _tmpDom0Vif.add(dom0vif);
+ }
+
+ }
+
+ private synchronized Network setupvSwitchNetwork(Connection conn) {
+ try {
+ if (_host.vswitchNetwork == null) {
+ Network vswitchNw = null;
+ Network.Record rec = new Network.Record();
+ String nwName = Networks.BroadcastScheme.VSwitch.toString();
+ Set networks = Network.getByNameLabel(conn, nwName);
+
+ if (networks.size() == 0) {
+ rec.nameDescription = "vswitch network for " + nwName;
+ rec.nameLabel = nwName;
+ vswitchNw = Network.create(conn, rec);
+ } else {
+ vswitchNw = networks.iterator().next();
+ }
+ if (!is_xcp())
+ enableXenServerNetwork(conn, vswitchNw, "vswitch", "vswitch network");
+ _host.vswitchNetwork = vswitchNw;
+ }
+ return _host.vswitchNetwork;
+ } catch (BadServerResponse e) {
+ s_logger.error("Failed to setup vswitch network", e);
+ } catch (XenAPIException e) {
+ s_logger.error("Failed to setup vswitch network", e);
+ } catch (XmlRpcException e) {
+ s_logger.error("Failed to setup vswitch network", e);
+ }
+
+ return null;
+ }
+
+ /**
+ * This method just creates a XenServer network following the tunnel network naming convention
+ */
+ private synchronized Network findOrCreateTunnelNetwork(Connection conn, String nwName) {
+ try {
+ Network nw = null;
+ Network.Record rec = new Network.Record();
+ Set networks = Network.getByNameLabel(conn, nwName);
+
+ if (networks.size() == 0) {
+ rec.nameDescription = "tunnel network id# " + nwName;
+ rec.nameLabel = nwName;
+ //Initialize the ovs-host-setup to avoid error when doing get-param in plugin
+ Map otherConfig = new HashMap();
+ otherConfig.put("ovs-host-setup", "");
+ rec.otherConfig = otherConfig;
+ nw = Network.create(conn, rec);
+ // Plug dom0 vif only when creating network
+ if (!is_xcp())
+ enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + nwName);
+ s_logger.debug("### Xen Server network for tunnels created:" + nwName);
+ } else {
+ nw = networks.iterator().next();
+ s_logger.debug("Xen Server network for tunnels found:" + nwName);
+ }
+ return nw;
+ } catch (Exception e) {
+ s_logger.warn("createTunnelNetwork failed", e);
+ return null;
+ }
+ }
+
+ /**
+ * This method creates a XenServer network and configures it for being used as a L2-in-L3 tunneled network
+ */
+ private synchronized Network configureTunnelNetwork(Connection conn, Long networkId, long hostId, String bridgeName) {
+ try {
+ Network nw = findOrCreateTunnelNetwork(conn, bridgeName);
+ String nwName = bridgeName;
+ //Invoke plugin to setup the bridge which will be used by this network
+ String bridge = nw.getBridge(conn);
+ Map nwOtherConfig = nw.getOtherConfig(conn);
+ String configuredHosts = nwOtherConfig.get("ovs-host-setup");
+ boolean configured = false;
+ if (configuredHosts != null) {
+ String hostIdsStr[] = configuredHosts.split(",");
+ for (String hostIdStr : hostIdsStr) {
+ if (hostIdStr.equals(((Long)hostId).toString())) {
+ configured = true;
+ break;
+ }
+ }
+ }
+ if (!configured) {
+ // Plug dom0 vif only if not done before for network and host
+ if (!is_xcp())
+ enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + bridgeName);
+ String result;
+ if (bridgeName.startsWith("OVS-DR-VPC-Bridge")) {
+ result = callHostPlugin(conn, "ovstunnel", "setup_ovs_bridge_for_distributed_routing", "bridge", bridge,
+ "key", bridgeName,
+ "xs_nw_uuid", nw.getUuid(conn),
+ "cs_host_id", ((Long)hostId).toString());
+ } else {
+ result = callHostPlugin(conn, "ovstunnel", "setup_ovs_bridge", "bridge", bridge,
+ "key", bridgeName,
+ "xs_nw_uuid", nw.getUuid(conn),
+ "cs_host_id", ((Long)hostId).toString());
+ }
+
+ //Note down the fact that the ovs bridge has been setup
+ String[] res = result.split(":");
+ if (res.length != 2 || !res[0].equalsIgnoreCase("SUCCESS")) {
+ //TODO: Should make this error not fatal?
+ throw new CloudRuntimeException("Unable to pre-configure OVS bridge " + bridge );
+ }
+ }
+ return nw;
+ } catch (Exception e) {
+ s_logger.warn("createandConfigureTunnelNetwork failed", e);
+ return null;
+ }
+ }
+
+ private synchronized void destroyTunnelNetwork(Connection conn, String bridgeName) {
+ try {
+ Network nw = findOrCreateTunnelNetwork(conn, bridgeName);
+ String bridge = nw.getBridge(conn);
+ String result = callHostPlugin(conn, "ovstunnel", "destroy_ovs_bridge", "bridge", bridge);
+ String[] res = result.split(":");
+ if (res.length != 2 || !res[0].equalsIgnoreCase("SUCCESS")) {
+ //TODO: Should make this error not fatal?
+ //Can Concurrent VM shutdown/migration/reboot events can cause this method
+ //to be executed on a bridge which has already been removed?
+ throw new CloudRuntimeException("Unable to remove OVS bridge " + bridge + ":" + res);
+ }
+ return;
+ } catch (Exception e) {
+ s_logger.warn("destroyTunnelNetwork failed:", e);
+ return;
+ }
+ }
+
+ protected Network getNetwork(Connection conn, NicTO nic) throws XenAPIException, XmlRpcException {
+ String name = nic.getName();
+ XsLocalNetwork network = getNativeNetworkForTraffic(conn, nic.getType(), name);
+ if (network == null) {
+ s_logger.error("Network is not configured on the backend for nic " + nic.toString());
+ throw new CloudRuntimeException("Network for the backend is not configured correctly for network broadcast domain: " + nic.getBroadcastUri());
+ }
+ URI uri = nic.getBroadcastUri();
+ BroadcastDomainType type = nic.getBroadcastType();
+ if (uri != null && uri.toString().contains("untagged")) {
+ return network.getNetwork();
+ } else if (type == BroadcastDomainType.Vlan) {
+ assert (BroadcastDomainType.getSchemeValue(uri) == BroadcastDomainType.Vlan);
+ long vlan = Long.parseLong(BroadcastDomainType.getValue(uri));
+ return enableVlanNetwork(conn, vlan, network);
+ } else if (type == BroadcastDomainType.Native || type == BroadcastDomainType.LinkLocal) {
+ return network.getNetwork();
+ } else if (type == BroadcastDomainType.Vswitch) {
+ String header = uri.toString().substring(Networks.BroadcastDomainType.Vswitch.scheme().length() + "://".length());
+ if (header.startsWith("vlan")) {
+ _isOvs = true;
+ return setupvSwitchNetwork(conn);
+ } else {
+ return findOrCreateTunnelNetwork(conn, getOvsTunnelNetworkName(uri.getAuthority()));
+ }
+ } else if (type == BroadcastDomainType.Storage) {
+ if (uri == null) {
+ return network.getNetwork();
+ } else {
+ long vlan = Long.parseLong(BroadcastDomainType.getValue(uri));
+ return enableVlanNetwork(conn, vlan, network);
+ }
+ } else if (type == BroadcastDomainType.Lswitch) {
+ // Nicira Logical Switch
+ return network.getNetwork();
+ } else if (type == BroadcastDomainType.Pvlan) {
+ assert BroadcastDomainType.getSchemeValue(uri) == BroadcastDomainType.Pvlan;
+ // should we consider moving this NetUtils method to BroadcastDomainType?
+ long vlan = Long.parseLong(NetUtils.getPrimaryPvlanFromUri(uri));
+ return enableVlanNetwork(conn, vlan, network);
+ }
+
+ throw new CloudRuntimeException("Unable to support this type of network broadcast domain: " + nic.getBroadcastUri());
+ }
+
+ private String getOvsTunnelNetworkName(String broadcastUri) {
+ if (broadcastUri.contains(".")) {
+ String[] parts = broadcastUri.split("\\.");
+ return "OVS-DR-VPC-Bridge"+parts[0];
+ } else {
+ try {
+ return "OVSTunnel" + broadcastUri;
+ } catch (Exception e) {
+ return null;
+ }
+ }
+ }
+
+ protected VIF createVif(Connection conn, String vmName, VM vm, VirtualMachineTO vmSpec, NicTO nic) throws XmlRpcException, XenAPIException {
+ assert (nic.getUuid() != null) : "Nic should have a uuid value";
+
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Creating VIF for " + vmName + " on nic " + nic);
+ }
+ VIF.Record vifr = new VIF.Record();
+ vifr.VM = vm;
+ vifr.device = Integer.toString(nic.getDeviceId());
+ vifr.MAC = nic.getMac();
+
+ // Nicira needs these IDs to find the NIC
+ vifr.otherConfig = new HashMap();
+ vifr.otherConfig.put("nicira-iface-id", nic.getUuid());
+ vifr.otherConfig.put("nicira-vm-id", vm.getUuid(conn));
+ // Provide XAPI with the cloudstack vm and nic uids.
+ vifr.otherConfig.put("cloudstack-nic-id", nic.getUuid());
+ if (vmSpec != null) {
+ vifr.otherConfig.put("cloudstack-vm-id", vmSpec.getUuid());
+ }
+
+ // OVS plugin looks at network UUID in the vif 'otherconfig' details to group VIF's & tunnel ports as part of tier
+ // when bridge is setup for distributed routing
+ vifr.otherConfig.put("cloudstack-network-id", nic.getNetworkUuid());
+
+ vifr.network = getNetwork(conn, nic);
+
+ if (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue() != -1) {
+ vifr.qosAlgorithmType = "ratelimit";
+ vifr.qosAlgorithmParams = new HashMap();
+ // convert mbs to kilobyte per second
+ vifr.qosAlgorithmParams.put("kbps", Integer.toString(nic.getNetworkRateMbps() * 128));
+ }
+
+ vifr.lockingMode = Types.VifLockingMode.NETWORK_DEFAULT;
+ VIF vif = VIF.create(conn, vifr);
+ if (s_logger.isDebugEnabled()) {
+ vifr = vif.getRecord(conn);
+ s_logger.debug("Created a vif " + vifr.uuid + " on " + nic.getDeviceId());
+ }
+
+ return vif;
+ }
+
+ protected void prepareISO(Connection conn, String vmName) throws XmlRpcException, XenAPIException {
+
+ Set vms = VM.getByNameLabel(conn, vmName);
+ if (vms == null || vms.size() != 1) {
+ throw new CloudRuntimeException("There are " + ((vms == null) ? "0" : vms.size()) + " VMs named " + vmName);
+ }
+ VM vm = vms.iterator().next();
+ Set vbds = vm.getVBDs(conn);
+ for (VBD vbd : vbds) {
+ VBD.Record vbdr = vbd.getRecord(conn);
+ if (vbdr.type == Types.VbdType.CD && vbdr.empty == false) {
+ VDI vdi = vbdr.VDI;
+ SR sr = vdi.getSR(conn);
+ Set pbds = sr.getPBDs(conn);
+ if (pbds == null) {
+ throw new CloudRuntimeException("There is no pbd for sr " + sr);
+ }
+ for (PBD pbd : pbds) {
+ PBD.Record pbdr = pbd.getRecord(conn);
+ if (pbdr.host.getUuid(conn).equals(_host.uuid)) {
+ return;
+ }
+ }
+ sr.setShared(conn, true);
+ Host host = Host.getByUuid(conn, _host.uuid);
+ PBD.Record pbdr = pbds.iterator().next().getRecord(conn);
+ pbdr.host = host;
+ pbdr.uuid = "";
+ PBD pbd = PBD.create(conn, pbdr);
+ pbdPlug(conn, pbd, pbd.getUuid(conn));
+ break;
+ }
+ }
+ }
+
+ protected VDI mount(Connection conn, String vmName, DiskTO volume) throws XmlRpcException, XenAPIException {
+ DataTO data = volume.getData();
+ Volume.Type type = volume.getType();
+ if (type == Volume.Type.ISO) {
+ TemplateObjectTO iso = (TemplateObjectTO)data;
+ DataStoreTO store = iso.getDataStore();
+
+ if (store == null) {
+ //It's a fake iso
+ return null;
+ }
+
+ //corer case, xenserver pv driver iso
+ String templateName = iso.getName();
+ if (templateName.startsWith("xs-tools")) {
+ try {
+ Set vdis = VDI.getByNameLabel(conn, templateName);
+ if (vdis.isEmpty()) {
+ throw new CloudRuntimeException("Could not find ISO with URL: " + templateName);
+ }
+ return vdis.iterator().next();
+ } catch (XenAPIException e) {
+ throw new CloudRuntimeException("Unable to get pv iso: " + templateName + " due to " + e.toString());
+ } catch (Exception e) {
+ throw new CloudRuntimeException("Unable to get pv iso: " + templateName + " due to " + e.toString());
+ }
+ }
+
+ if (!(store instanceof NfsTO)) {
+ throw new CloudRuntimeException("only support mount iso on nfs");
+ }
+ NfsTO nfsStore = (NfsTO)store;
+ String isoPath = nfsStore.getUrl() + File.separator + iso.getPath();
+ int index = isoPath.lastIndexOf("/");
+
+ String mountpoint = isoPath.substring(0, index);
+ URI uri;
+ try {
+ uri = new URI(mountpoint);
+ } catch (URISyntaxException e) {
+ throw new CloudRuntimeException("Incorrect uri " + mountpoint, e);
+ }
+ SR isoSr = createIsoSRbyURI(conn, uri, vmName, false);
+
+ String isoname = isoPath.substring(index + 1);
+
+ VDI isoVdi = getVDIbyLocationandSR(conn, isoname, isoSr);
+
+ if (isoVdi == null) {
+ throw new CloudRuntimeException("Unable to find ISO " + isoPath);
+ }
+ return isoVdi;
+ } else {
+ VolumeObjectTO vol = (VolumeObjectTO)data;
+ return VDI.getByUuid(conn, vol.getPath());
+ }
+ }
+
+ protected VBD createVbd(Connection conn, DiskTO volume, String vmName, VM vm, BootloaderType bootLoaderType, VDI vdi) throws XmlRpcException, XenAPIException {
+ Volume.Type type = volume.getType();
+
+ if (vdi == null) {
+ vdi = mount(conn, vmName, volume);
+ }
+
+ if (vdi != null) {
+ if ("detached".equals(vdi.getNameLabel(conn))) {
+ vdi.setNameLabel(conn, vmName + "-DATA");
+ }
+
+ Map smConfig = vdi.getSmConfig(conn);
+ for (String key : smConfig.keySet()) {
+ if (key.startsWith("host_")) {
+ vdi.removeFromSmConfig(conn, key);
+ break;
+ }
+ }
+ }
+ VBD.Record vbdr = new VBD.Record();
+ vbdr.VM = vm;
+ if (vdi != null) {
+ vbdr.VDI = vdi;
+ } else {
+ vbdr.empty = true;
+ }
+ if (type == Volume.Type.ROOT && bootLoaderType == BootloaderType.PyGrub) {
+ vbdr.bootable = true;
+ } else if (type == Volume.Type.ISO && bootLoaderType == BootloaderType.CD) {
+ vbdr.bootable = true;
+ }
+
+ vbdr.userdevice = Long.toString(volume.getDiskSeq());
+ if (volume.getType() == Volume.Type.ISO) {
+ vbdr.mode = Types.VbdMode.RO;
+ vbdr.type = Types.VbdType.CD;
+ } else if (volume.getType() == Volume.Type.ROOT) {
+ vbdr.mode = Types.VbdMode.RW;
+ vbdr.type = Types.VbdType.DISK;
+ vbdr.unpluggable = false;
+ } else {
+ vbdr.mode = Types.VbdMode.RW;
+ vbdr.type = Types.VbdType.DISK;
+ vbdr.unpluggable = true;
+ }
+ VBD vbd = VBD.create(conn, vbdr);
+
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("VBD " + vbd.getUuid(conn) + " created for " + volume);
+ }
+
+ return vbd;
+ }
+
+ public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam) {
+ return dynamicMaxRam;
+ }
+
+ public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam) {
+ return dynamicMinRam;
+ }
+
+ protected HashMap> getGPUGroupDetails(Connection conn) throws XenAPIException, XmlRpcException {
+ return null;
+ }
+
+ protected void createVGPU(Connection conn, StartCommand cmd, VM vm, GPUDeviceTO gpuDevice) throws XenAPIException, XmlRpcException {
+ }
+
+ protected VM createVmFromTemplate(Connection conn, VirtualMachineTO vmSpec, Host host) throws XenAPIException, XmlRpcException {
+ String guestOsTypeName = getGuestOsType(vmSpec.getOs(), vmSpec.getBootloader() == BootloaderType.CD);
+ Set templates = VM.getByNameLabel(conn, guestOsTypeName);
+ assert templates.size() == 1 : "Should only have 1 template but found " + templates.size();
+ VM template = templates.iterator().next();
+
+ VM.Record vmr = template.getRecord(conn);
+ vmr.affinity = host;
+ vmr.otherConfig.remove("disks");
+ vmr.otherConfig.remove("default_template");
+ vmr.otherConfig.remove("mac_seed");
+ vmr.isATemplate = false;
+ vmr.nameLabel = vmSpec.getName();
+ vmr.actionsAfterCrash = Types.OnCrashBehaviour.DESTROY;
+ vmr.actionsAfterShutdown = Types.OnNormalExit.DESTROY;
+
+ if (isDmcEnabled(conn, host) && vmSpec.isEnableDynamicallyScaleVm()) {
+ //scaling is allowed
+ vmr.memoryStaticMin = getStaticMin(vmSpec.getOs(), vmSpec.getBootloader() == BootloaderType.CD, vmSpec.getMinRam(), vmSpec.getMaxRam());
+ vmr.memoryStaticMax = getStaticMax(vmSpec.getOs(), vmSpec.getBootloader() == BootloaderType.CD, vmSpec.getMinRam(), vmSpec.getMaxRam());
+ vmr.memoryDynamicMin = vmSpec.getMinRam();
+ vmr.memoryDynamicMax = vmSpec.getMaxRam();
+ } else {
+ //scaling disallowed, set static memory target
+ if (vmSpec.isEnableDynamicallyScaleVm() && !isDmcEnabled(conn, host)) {
+ s_logger.warn("Host " + host.getHostname(conn) + " does not support dynamic scaling, so the vm " + vmSpec.getName() + " is not dynamically scalable");
+ }
+ vmr.memoryStaticMin = vmSpec.getMinRam();
+ vmr.memoryStaticMax = vmSpec.getMaxRam();
+ vmr.memoryDynamicMin = vmSpec.getMinRam();
+ vmr.memoryDynamicMax = vmSpec.getMaxRam();
+ }
+
+ if (guestOsTypeName.toLowerCase().contains("windows")) {
+ vmr.VCPUsMax = (long)vmSpec.getCpus();
+ } else {
+ // XenServer has a documented limit of 16 vcpus per vm
+ vmr.VCPUsMax = 2L * vmSpec.getCpus();
+ if (vmr.VCPUsMax > 16)
+ {
+ vmr.VCPUsMax = 16L;
+ }
+ }
+
+ vmr.VCPUsAtStartup = (long)vmSpec.getCpus();
+ vmr.consoles.clear();
+
+ VM vm = VM.create(conn, vmr);
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Created VM " + vm.getUuid(conn) + " for " + vmSpec.getName());
+ }
+
+ Map vcpuParams = new HashMap();
+
+ Integer speed = vmSpec.getMinSpeed();
+ if (speed != null) {
+
+ int cpuWeight = _maxWeight; // cpu_weight
+ int utilization = 0; // max CPU cap, default is unlimited
+
+ // weight based allocation, CPU weight is calculated per VCPU
+ cpuWeight = (int)((speed * 0.99) / _host.speed * _maxWeight);
+ if (cpuWeight > _maxWeight) {
+ cpuWeight = _maxWeight;
+ }
+
+ if (vmSpec.getLimitCpuUse()) {
+ // CPU cap is per VM, so need to assign cap based on the number of vcpus
+ utilization = (int)((vmSpec.getMaxSpeed() * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
+ }
+
+ vcpuParams.put("weight", Integer.toString(cpuWeight));
+ vcpuParams.put("cap", Integer.toString(utilization));
+
+ }
+
+ if (vcpuParams.size() > 0) {
+ vm.setVCPUsParams(conn, vcpuParams);
+ }
+
+ String bootArgs = vmSpec.getBootArgs();
+ if (bootArgs != null && bootArgs.length() > 0) {
+ String pvargs = vm.getPVArgs(conn);
+ pvargs = pvargs + vmSpec.getBootArgs().replaceAll(" ", "%");
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("PV args are " + pvargs);
+ }
+ vm.setPVArgs(conn, pvargs);
+ }
+
+ if (!(guestOsTypeName.startsWith("Windows") || guestOsTypeName.startsWith("Citrix") || guestOsTypeName.startsWith("Other"))) {
+ if (vmSpec.getBootloader() == BootloaderType.CD) {
+ DiskTO[] disks = vmSpec.getDisks();
+ for (DiskTO disk : disks) {
+ if (disk.getType() == Volume.Type.ISO) {
+ TemplateObjectTO iso = (TemplateObjectTO)disk.getData();
+ String osType = iso.getGuestOsType();
+ if (osType != null) {
+ String isoGuestOsName = getGuestOsType(osType, vmSpec.getBootloader() == BootloaderType.CD);
+ if (!isoGuestOsName.equals(guestOsTypeName)) {
+ vmSpec.setBootloader(BootloaderType.PyGrub);
+ }
+ }
+ }
+ }
+ }
+ if (vmSpec.getBootloader() == BootloaderType.CD) {
+ vm.setPVBootloader(conn, "eliloader");
+ if (!vm.getOtherConfig(conn).containsKey("install-repository")) {
+ vm.addToOtherConfig(conn, "install-repository", "cdrom");
+ }
+ } else if (vmSpec.getBootloader() == BootloaderType.PyGrub) {
+ vm.setPVBootloader(conn, "pygrub");
+ } else {
+ vm.destroy(conn);
+ throw new CloudRuntimeException("Unable to handle boot loader type: " + vmSpec.getBootloader());
+ }
+ }
+ try {
+ finalizeVmMetaData(vm, conn, vmSpec);
+ } catch (Exception e) {
+ throw new CloudRuntimeException("Unable to finalize VM MetaData: " + vmSpec);
+ }
+ return vm;
+ }
+
+
+ protected void finalizeVmMetaData(VM vm, Connection conn, VirtualMachineTO vmSpec) throws Exception {
+
+ Map details = vmSpec.getDetails();
+ if (details != null) {
+ String platformstring = details.get("platform");
+ if (platformstring != null && !platformstring.isEmpty()) {
+ Map platform = StringUtils.stringToMap(platformstring);
+ vm.setPlatform(conn, platform);
+ } else {
+ String timeoffset = details.get("timeoffset");
+ if (timeoffset != null) {
+ Map platform = vm.getPlatform(conn);
+ platform.put("timeoffset", timeoffset);
+ vm.setPlatform(conn, platform);
+ }
+ String coresPerSocket = details.get("cpu.corespersocket");
+ if (coresPerSocket != null) {
+ Map platform = vm.getPlatform(conn);
+ platform.put("cores-per-socket", coresPerSocket);
+ vm.setPlatform(conn, platform);
+ }
+ }
+ String xentoolsversion = details.get("hypervisortoolsversion");
+ if (xentoolsversion == null || !xentoolsversion.equalsIgnoreCase("xenserver61")) {
+ Map platform = vm.getPlatform(conn);
+ platform.remove("device_id");
+ vm.setPlatform(conn, platform);
+ }
+ }
+ }
+
+ protected String handleVmStartFailure(Connection conn, String vmName, VM vm, String message, Throwable th) {
+ String msg = "Unable to start " + vmName + " due to " + message;
+ s_logger.warn(msg, th);
+
+ if (vm == null) {
+ return msg;
+ }
+
+ try {
+ VM.Record vmr = vm.getRecord(conn);
+ List networks = new ArrayList();
+ for (VIF vif : vmr.VIFs) {
+ try {
+ VIF.Record rec = vif.getRecord(conn);
+ networks.add(rec.network);
+ } catch (Exception e) {
+ s_logger.warn("Unable to cleanup VIF", e);
+ }
+ }
+ if (vmr.powerState == VmPowerState.RUNNING) {
+ try {
+ vm.hardShutdown(conn);
+ } catch (Exception e) {
+ s_logger.warn("VM hardshutdown failed due to ", e);
+ }
+ }
+ if (vm.getPowerState(conn) == VmPowerState.HALTED) {
+ try {
+ vm.destroy(conn);
+ } catch (Exception e) {
+ s_logger.warn("VM destroy failed due to ", e);
+ }
+ }
+ for (VBD vbd : vmr.VBDs) {
+ try {
+ vbd.unplug(conn);
+ vbd.destroy(conn);
+ } catch (Exception e) {
+ s_logger.warn("Unable to clean up VBD due to ", e);
+ }
+ }
+ for (VIF vif : vmr.VIFs) {
+ try {
+ vif.unplug(conn);
+ vif.destroy(conn);
+ } catch (Exception e) {
+ s_logger.warn("Unable to cleanup VIF", e);
+ }
+ }
+ for (Network network : networks) {
+ if (network.getNameLabel(conn).startsWith("VLAN")) {
+ disableVlanNetwork(conn, network);
+ }
+ }
+ } catch (Exception e) {
+ s_logger.warn("VM getRecord failed due to ", e);
+ }
+
+ return msg;
+ }
+
+ protected VBD createPatchVbd(Connection conn, String vmName, VM vm) throws XmlRpcException, XenAPIException {
+
+ if (_host.systemvmisouuid == null) {
+ Set srs = SR.getByNameLabel(conn, "XenServer Tools");
+ if (srs.size() != 1) {
+ throw new CloudRuntimeException("There are " + srs.size() + " SRs with name XenServer Tools");
+ }
+ SR sr = srs.iterator().next();
+ sr.scan(conn);
+
+ SR.Record srr = sr.getRecord(conn);
+
+ if (_host.systemvmisouuid == null) {
+ for (VDI vdi : srr.VDIs) {
+ VDI.Record vdir = vdi.getRecord(conn);
+ if (vdir.nameLabel.contains("systemvm.iso")) {
+ _host.systemvmisouuid = vdir.uuid;
+ break;
+ }
+ }
+ }
+ if (_host.systemvmisouuid == null) {
+ throw new CloudRuntimeException("can not find systemvmiso");
+ }
+ }
+
+ VBD.Record cdromVBDR = new VBD.Record();
+ cdromVBDR.VM = vm;
+ cdromVBDR.empty = true;
+ cdromVBDR.bootable = false;
+ cdromVBDR.userdevice = "3";
+ cdromVBDR.mode = Types.VbdMode.RO;
+ cdromVBDR.type = Types.VbdType.CD;
+ VBD cdromVBD = VBD.create(conn, cdromVBDR);
+ cdromVBD.insert(conn, VDI.getByUuid(conn, _host.systemvmisouuid));
+
+ return cdromVBD;
+ }
+
+ protected void destroyPatchVbd(Connection conn, String vmName) throws XmlRpcException, XenAPIException {
+ try {
+ if (!vmName.startsWith("r-") && !vmName.startsWith("s-") && !vmName.startsWith("v-")) {
+ return;
+ }
+ Set vms = VM.getByNameLabel(conn, vmName);
+ for (VM vm : vms) {
+ Set vbds = vm.getVBDs(conn);
+ for (VBD vbd : vbds) {
+ if (vbd.getType(conn) == Types.VbdType.CD) {
+ vbd.eject(conn);
+ vbd.destroy(conn);
+ break;
+ }
+ }
+ }
+ } catch (Exception e) {
+ s_logger.debug("Cannot destory CD-ROM device for VM " + vmName + " due to " + e.toString(), e);
+ }
+ }
+
+ protected CheckSshAnswer execute(CheckSshCommand cmd) {
+ Connection conn = getConnection();
+ String vmName = cmd.getName();
+ String privateIp = cmd.getIp();
+ int cmdPort = cmd.getPort();
+
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Ping command port, " + privateIp + ":" + cmdPort);
+ }
+
+ try {
+ String result = connect(conn, cmd.getName(), privateIp, cmdPort);
+ if (result != null) {
+ return new CheckSshAnswer(cmd, "Can not ping System vm " + vmName + "due to:" + result);
+ }
+ destroyPatchVbd(conn, vmName);
+ } catch (Exception e) {
+ return new CheckSshAnswer(cmd, e);
+ }
+
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Ping command port succeeded for vm " + vmName);
+ }
+
+ return new CheckSshAnswer(cmd);
+ }
+
+ private HashMap parseDefaultOvsRuleComamnd(String str) {
+ HashMap cmd = new HashMap();
+ String[] sarr = str.split("/");
+ for (int i = 0; i < sarr.length; i++) {
+ String c = sarr[i];
+ c = c.startsWith("/") ? c.substring(1) : c;
+ c = c.endsWith("/") ? c.substring(0, c.length() - 1) : c;
+ String[] p = c.split(";");
+ if (p.length != 2) {
+ continue;
+ }
+ if (p[0].equalsIgnoreCase("vlans")) {
+ p[1] = p[1].replace("@", "[");
+ p[1] = p[1].replace("#", "]");
+ }
+ cmd.put(p[0], p[1]);
+ }
+ return cmd;
+ }
+
+ private void cleanUpTmpDomVif(Connection conn) {
+ List vifs;
+ synchronized (_tmpDom0Vif) {
+ vifs = _tmpDom0Vif;
+ _tmpDom0Vif = new ArrayList();
+ }
+
+ for (VIF v : vifs) {
+ String vifName = "unkown";
+ try {
+ VIF.Record vifr = v.getRecord(conn);
+ Map config = vifr.otherConfig;
+ vifName = config.get("nameLabel");
+ v.destroy(conn);
+ s_logger.debug("Destroy temp dom0 vif" + vifName + " success");
+ } catch (Exception e) {
+ s_logger.warn("Destroy temp dom0 vif " + vifName + "failed", e);
+ }
+ }
+ }
+
+ private Answer execute(PvlanSetupCommand cmd) {
+ Connection conn = getConnection();
+
+ String primaryPvlan = cmd.getPrimary();
+ String isolatedPvlan = cmd.getIsolated();
+ String op = cmd.getOp();
+ String dhcpName = cmd.getDhcpName();
+ String dhcpMac = cmd.getDhcpMac();
+ String dhcpIp = cmd.getDhcpIp();
+ String vmMac = cmd.getVmMac();
+ String networkTag = cmd.getNetworkTag();
+
+ XsLocalNetwork nw = null;
+ String nwNameLabel = null;
+ try {
+ nw = getNativeNetworkForTraffic(conn, TrafficType.Guest, networkTag);
+ nwNameLabel = nw.getNetwork().getNameLabel(conn);
+ } catch (XenAPIException e) {
+ s_logger.warn("Fail to get network", e);
+ return new Answer(cmd, false, e.toString());
+ } catch (XmlRpcException e) {
+ s_logger.warn("Fail to get network", e);
+ return new Answer(cmd, false, e.toString());
+ }
+
+ String result = null;
+ if (cmd.getType() == PvlanSetupCommand.Type.DHCP) {
+ result =
+ callHostPlugin(conn, "ovs-pvlan", "setup-pvlan-dhcp", "op", op, "nw-label", nwNameLabel, "primary-pvlan", primaryPvlan, "isolated-pvlan", isolatedPvlan,
+ "dhcp-name", dhcpName, "dhcp-ip", dhcpIp, "dhcp-mac", dhcpMac);
+ if (result == null || result.isEmpty() || !Boolean.parseBoolean(result)) {
+ s_logger.warn("Failed to program pvlan for dhcp server with mac " + dhcpMac);
+ return new Answer(cmd, false, result);
+ } else {
+ s_logger.info("Programmed pvlan for dhcp server with mac " + dhcpMac);
+ }
+ } else if (cmd.getType() == PvlanSetupCommand.Type.VM) {
+ result =
+ callHostPlugin(conn, "ovs-pvlan", "setup-pvlan-vm", "op", op, "nw-label", nwNameLabel, "primary-pvlan", primaryPvlan, "isolated-pvlan", isolatedPvlan,
+ "vm-mac", vmMac);
+ if (result == null || result.isEmpty() || !Boolean.parseBoolean(result)) {
+ s_logger.warn("Failed to program pvlan for vm with mac " + vmMac);
+ return new Answer(cmd, false, result);
+ } else {
+ s_logger.info("Programmed pvlan for vm with mac " + vmMac);
+ }
+ }
+ return new Answer(cmd, true, result);
+ }
+
+ @Override
+ public StartAnswer execute(StartCommand cmd) {
+ Connection conn = getConnection();
+ VirtualMachineTO vmSpec = cmd.getVirtualMachine();
+ String vmName = vmSpec.getName();
+ State state = State.Stopped;
+ VM vm = null;
+ // if a VDI is created, record its UUID to send back to the CS MS
+ Map iqnToPath = new HashMap();
+ try {
+ Set vms = VM.getByNameLabel(conn, vmName);
+ if (vms != null) {
+ for (VM v : vms) {
+ VM.Record vRec = v.getRecord(conn);
+ if (vRec.powerState == VmPowerState.HALTED) {
+ v.destroy(conn);
+ } else if (vRec.powerState == VmPowerState.RUNNING) {
+ String host = vRec.residentOn.getUuid(conn);
+ String msg = "VM " + vmName + " is runing on host " + host;
+ s_logger.debug(msg);
+ return new StartAnswer(cmd, msg, host);
+ } else {
+ String msg = "There is already a VM having the same name " + vmName + " vm record " + vRec.toString();
+ s_logger.warn(msg);
+ return new StartAnswer(cmd, msg);
+ }
+ }
+ }
+ synchronized (_cluster.intern()) {
+ s_vms.put(_cluster, _name, vmName, State.Starting);
+ }
+ s_logger.debug("1. The VM " + vmName + " is in Starting state.");
+
+ Host host = Host.getByUuid(conn, _host.uuid);
+ vm = createVmFromTemplate(conn, vmSpec, host);
+
+ GPUDeviceTO gpuDevice = vmSpec.getGpuDevice();
+ if (gpuDevice != null) {
+ s_logger.debug("Creating VGPU for of VGPU type: " + gpuDevice.getVgpuType() + " in GPU group "
+ + gpuDevice.getGpuGroup() + " for VM " + vmName );
+ createVGPU(conn, cmd, vm, gpuDevice);
+ }
+
+ for (DiskTO disk : vmSpec.getDisks()) {
+ VDI newVdi = prepareManagedDisk(conn, disk, vmName);
+
+ if (newVdi != null) {
+ String path = newVdi.getUuid(conn);
+
+ iqnToPath.put(disk.getDetails().get(DiskTO.IQN), path);
+ }
+
+ createVbd(conn, disk, vmName, vm, vmSpec.getBootloader(), newVdi);
+ }
+
+ if (vmSpec.getType() != VirtualMachine.Type.User) {
+ createPatchVbd(conn, vmName, vm);
+ }
+
+ for (NicTO nic : vmSpec.getNics()) {
+ createVif(conn, vmName, vm, vmSpec, nic);
+ }
+
+ startVM(conn, host, vm, vmName);
+
+ if (_isOvs) {
+ // TODO(Salvatore-orlando): This code should go
+ for (NicTO nic : vmSpec.getNics()) {
+ if (nic.getBroadcastType() == Networks.BroadcastDomainType.Vswitch) {
+ HashMap args = parseDefaultOvsRuleComamnd(BroadcastDomainType.getValue(nic.getBroadcastUri()));
+ OvsSetTagAndFlowCommand flowCmd =
+ new OvsSetTagAndFlowCommand(args.get("vmName"), args.get("tag"), args.get("vlans"), args.get("seqno"), Long.parseLong(args.get("vmId")));
+ OvsSetTagAndFlowAnswer r = execute(flowCmd);
+ if (!r.getResult()) {
+ s_logger.warn("Failed to set flow for VM " + r.getVmId());
+ } else {
+ s_logger.info("Success to set flow for VM " + r.getVmId());
+ }
+ }
+ }
+ }
+ cleanUpTmpDomVif(conn);
+
+ if (_canBridgeFirewall) {
+ String result = null;
+ if (vmSpec.getType() != VirtualMachine.Type.User) {
+ NicTO[] nics = vmSpec.getNics();
+ boolean secGrpEnabled = false;
+ for (NicTO nic : nics) {
+ if (nic.isSecurityGroupEnabled() ||
+ (nic.getIsolationUri() != null && nic.getIsolationUri().getScheme().equalsIgnoreCase(IsolationType.Ec2.toString()))) {
+ secGrpEnabled = true;
+ break;
+ }
+ }
+ if (secGrpEnabled) {
+ result = callHostPlugin(conn, "vmops", "default_network_rules_systemvm", "vmName", vmName);
+ if (result == null || result.isEmpty() || !Boolean.parseBoolean(result)) {
+ s_logger.warn("Failed to program default network rules for " + vmName);
+ } else {
+ s_logger.info("Programmed default network rules for " + vmName);
+ }
+ }
+
+ } else {
+ //For user vm, program the rules for each nic if the isolation uri scheme is ec2
+ NicTO[] nics = vmSpec.getNics();
+ for (NicTO nic : nics) {
+ if (nic.isSecurityGroupEnabled() || nic.getIsolationUri() != null &&
+ nic.getIsolationUri().getScheme().equalsIgnoreCase(IsolationType.Ec2.toString())) {
+ List nicSecIps = nic.getNicSecIps();
+ String secIpsStr;
+ StringBuilder sb = new StringBuilder();
+ if (nicSecIps != null) {
+ for (String ip : nicSecIps) {
+ sb.append(ip).append(":");
+ }
+ secIpsStr = sb.toString();
+ } else {
+ secIpsStr = "0:";
+ }
+ result =
+ callHostPlugin(conn, "vmops", "default_network_rules", "vmName", vmName, "vmIP", nic.getIp(), "vmMAC", nic.getMac(), "vmID",
+ Long.toString(vmSpec.getId()), "secIps", secIpsStr);
+
+ if (result == null || result.isEmpty() || !Boolean.parseBoolean(result)) {
+ s_logger.warn("Failed to program default network rules for " + vmName + " on nic with ip:" + nic.getIp() + " mac:" + nic.getMac());
+ } else {
+ s_logger.info("Programmed default network rules for " + vmName + " on nic with ip:" + nic.getIp() + " mac:" + nic.getMac());
+ }
+ }
+ }
+ }
+ }
+
+ state = State.Running;
+
+ StartAnswer startAnswer = new StartAnswer(cmd);
+
+ startAnswer.setIqnToPath(iqnToPath);
+
+ return startAnswer;
+ } catch (Exception e) {
+ s_logger.warn("Catch Exception: " + e.getClass().toString() + " due to " + e.toString(), e);
+ String msg = handleVmStartFailure(conn, vmName, vm, "", e);
+
+ StartAnswer startAnswer = new StartAnswer(cmd, msg);
+
+ startAnswer.setIqnToPath(iqnToPath);
+
+ return startAnswer;
+ } finally {
+ synchronized (_cluster.intern()) {
+ if (state != State.Stopped) {
+ s_vms.put(_cluster, _name, vmName, state);
+ s_logger.debug("2. The VM " + vmName + " is in " + state + " state.");
+ } else {
+ s_vms.remove(_cluster, _name, vmName);
+ s_logger.debug("The VM is in stopped state, detected problem during startup : " + vmName);
+ }
+ }
+ }
+ }
+
+ // the idea here is to see if the DiskTO in question is from managed storage and
+ // does not yet have an SR
+ // if no SR, create it and create a VDI in it
+ private VDI prepareManagedDisk(Connection conn, DiskTO disk, String vmName) throws Exception {
+ Map details = disk.getDetails();
+
+ if (details == null) {
+ return null;
+ }
+
+ boolean isManaged = new Boolean(details.get(DiskTO.MANAGED)).booleanValue();
+
+ if (!isManaged) {
+ return null;
+ }
+
+ String iqn = details.get(DiskTO.IQN);
+
+ Set srNameLabels = SR.getByNameLabel(conn, iqn);
+
+ if (srNameLabels.size() != 0) {
+ return null;
+ }
+
+ String vdiNameLabel = vmName + "-DATA";
+
+ return prepareManagedStorage(conn, details, null, vdiNameLabel);
+ }
+
+ protected SR prepareManagedSr(Connection conn, Map details) {
+ String iScsiName = details.get(DiskTO.IQN);
+ String storageHost = details.get(DiskTO.STORAGE_HOST);
+ String chapInitiatorUsername = details.get(DiskTO.CHAP_INITIATOR_USERNAME);
+ String chapInitiatorSecret = details.get(DiskTO.CHAP_INITIATOR_SECRET);
+
+ return getIscsiSR(conn, iScsiName, storageHost, iScsiName, chapInitiatorUsername, chapInitiatorSecret, true);
+ }
+
+ protected VDI prepareManagedStorage(Connection conn, Map details, String path, String vdiNameLabel) throws Exception {
+ SR sr = prepareManagedSr(conn, details);
+
+ VDI vdi = getVDIbyUuid(conn, path, false);
+
+ if (vdi == null) {
+ Long volumeSize = Long.parseLong(details.get(DiskTO.VOLUME_SIZE));
+
+ vdi = createVdi(sr, vdiNameLabel, volumeSize);
+ }
+
+ return vdi;
+ }
+
+ protected Answer execute(ModifySshKeysCommand cmd) {
+ return new Answer(cmd);
+ }
+
+ private boolean doPingTest(Connection conn, final String computingHostIp) {
+ com.trilead.ssh2.Connection sshConnection = new com.trilead.ssh2.Connection(_host.ip, 22);
+ try {
+ sshConnection.connect(null, 60000, 60000);
+ if (!sshConnection.authenticateWithPassword(_username, _password.peek())) {
+ throw new CloudRuntimeException("Unable to authenticate");
+ }
+
+ String cmd = "ping -c 2 " + computingHostIp;
+ if (!SSHCmdHelper.sshExecuteCmd(sshConnection, cmd)) {
+ throw new CloudRuntimeException("Cannot ping host " + computingHostIp + " from host " + _host.ip);
+ }
+ return true;
+ } catch (Exception e) {
+ s_logger.warn("Catch exception " + e.toString(), e);
+ return false;
+ } finally {
+ sshConnection.close();
+ }
+ }
+
+ protected CheckOnHostAnswer execute(CheckOnHostCommand cmd) {
+ return new CheckOnHostAnswer(cmd, null, "Not Implmeneted");
+ }
+
+ private boolean doPingTest(Connection conn, final String domRIp, final String vmIp) {
+ String args = "-i " + domRIp + " -p " + vmIp;
+ String result = callHostPlugin(conn, "vmops", "pingtest", "args", args);
+ if (result == null || result.isEmpty()) {
+ return false;
+ }
+ return true;
+ }
+
+ private Answer execute(PingTestCommand cmd) {
+ Connection conn = getConnection();
+ boolean result = false;
+ final String computingHostIp = cmd.getComputingHostIp();
+
+ if (computingHostIp != null) {
+ result = doPingTest(conn, computingHostIp);
+ } else {
+ result = doPingTest(conn, cmd.getRouterIp(), cmd.getPrivateIp());
+ }
+
+ if (!result) {
+ return new Answer(cmd, false, "PingTestCommand failed");
+ }
+ return new Answer(cmd);
+ }
+
+ protected MaintainAnswer execute(MaintainCommand cmd) {
+ Connection conn = getConnection();
+ try {
+
+ Host host = Host.getByUuid(conn, _host.uuid);
+ // remove all tags cloud stack
+ Host.Record hr = host.getRecord(conn);
+ Iterator it = hr.tags.iterator();
+ while (it.hasNext()) {
+ String tag = it.next();
+ if (tag.contains("cloud")) {
+ it.remove();
+ }
+ }
+ host.setTags(conn, hr.tags);
+ return new MaintainAnswer(cmd);
+ } catch (XenAPIException e) {
+ s_logger.warn("Unable to put server in maintainence mode", e);
+ return new MaintainAnswer(cmd, false, e.getMessage());
+ } catch (XmlRpcException e) {
+ s_logger.warn("Unable to put server in maintainence mode", e);
+ return new MaintainAnswer(cmd, false, e.getMessage());
+ }
+ }
+
+ protected String networkUsage(Connection conn, final String privateIpAddress, final String option, final String vif) {
+ if (option.equals("get")) {
+ return "0:0";
+ }
+ return null;
+ }
+
+ protected ExecutionResult prepareNetworkElementCommand(IpAssocCommand cmd) {
+ Connection conn = getConnection();
+ String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
+ String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
+
+ try {
+ IpAddressTO[] ips = cmd.getIpAddresses();
+ for (IpAddressTO ip : ips) {
+
+ VM router = getVM(conn, routerName);
+
+ NicTO nic = new NicTO();
+ nic.setMac(ip.getVifMacAddress());
+ nic.setType(ip.getTrafficType());
+ if (ip.getBroadcastUri()== null) {
+ nic.setBroadcastType(BroadcastDomainType.Native);
+ } else {
+ URI uri = BroadcastDomainType.fromString(ip.getBroadcastUri());
+ nic.setBroadcastType(BroadcastDomainType.getSchemeValue(uri));
+ nic.setBroadcastUri(uri);
+ }
+ nic.setDeviceId(0);
+ nic.setNetworkRateMbps(ip.getNetworkRate());
+ nic.setName(ip.getNetworkName());
+
+ Network network = getNetwork(conn, nic);
+
+ // Determine the correct VIF on DomR to associate/disassociate the
+ // IP address with
+ VIF correctVif = getCorrectVif(conn, router, network);
+
+ // If we are associating an IP address and DomR doesn't have a VIF
+ // for the specified vlan ID, we need to add a VIF
+ // If we are disassociating the last IP address in the VLAN, we need
+ // to remove a VIF
+ boolean addVif = false;
+ if (ip.isAdd() && correctVif == null) {
+ addVif = true;
+ }
+
+ if (addVif) {
+ // Add a new VIF to DomR
+ String vifDeviceNum = getLowestAvailableVIFDeviceNum(conn, router);
+
+ if (vifDeviceNum == null) {
+ throw new InternalErrorException("There were no more available slots for a new VIF on router: " + router.getNameLabel(conn));
+ }
+
+ nic.setDeviceId(Integer.valueOf(vifDeviceNum));
+
+ correctVif = createVif(conn, routerName, router, null, nic);
+ correctVif.plug(conn);
+ // Add iptables rule for network usage
+ networkUsage(conn, routerIp, "addVif", "eth" + correctVif.getDevice(conn));
+ }
+
+ if (correctVif == null) {
+ throw new InternalErrorException("Failed to find DomR VIF to associate/disassociate IP with.");
+ }
+
+ ip.setNicDevId(Integer.valueOf(correctVif.getDevice(conn)));
+ ip.setNewNic(addVif);
+ }
+ } catch (InternalErrorException e) {
+ s_logger.error("Ip Assoc failure on applying one ip due to exception: ", e);
+ return new ExecutionResult(false, e.getMessage());
+ } catch (Exception e) {
+ return new ExecutionResult(false, e.getMessage());
+ }
+ return new ExecutionResult(true, null);
+ }
+
+ protected ExecutionResult cleanupNetworkElementCommand(IpAssocCommand cmd) {
+ Connection conn = getConnection();
+ String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
+ String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
+ try {
+ IpAddressTO[] ips = cmd.getIpAddresses();
+ int ipsCount = ips.length;
+ for (IpAddressTO ip : ips) {
+
+ VM router = getVM(conn, routerName);
+
+ NicTO nic = new NicTO();
+ nic.setMac(ip.getVifMacAddress());
+ nic.setType(ip.getTrafficType());
+ if (ip.getBroadcastUri()== null) {
+ nic.setBroadcastType(BroadcastDomainType.Native);
+ } else {
+ URI uri = BroadcastDomainType.fromString(ip.getBroadcastUri());
+ nic.setBroadcastType(BroadcastDomainType.getSchemeValue(uri));
+ nic.setBroadcastUri(uri);
+ }
+ nic.setDeviceId(0);
+ nic.setNetworkRateMbps(ip.getNetworkRate());
+ nic.setName(ip.getNetworkName());
+
+ Network network = getNetwork(conn, nic);
+
+ // Determine the correct VIF on DomR to associate/disassociate the
+ // IP address with
+ VIF correctVif = getCorrectVif(conn, router, network);
+
+ // If we are disassociating the last IP address in the VLAN, we need
+ // to remove a VIF
+ boolean removeVif = false;
+
+ //there is only one ip in this public vlan and removing it, so remove the nic
+ if (ipsCount == 1 && !ip.isAdd()) {
+ removeVif = true;
+ }
+
+ if (correctVif == null) {
+ throw new InternalErrorException("Failed to find DomR VIF to associate/disassociate IP with.");
+ }
+
+ if (removeVif) {
+ network = correctVif.getNetwork(conn);
+
+ // Mark this vif to be removed from network usage
+ networkUsage(conn, routerIp, "deleteVif", "eth" + correctVif.getDevice(conn));
+
+ // Remove the VIF from DomR
+ correctVif.unplug(conn);
+ correctVif.destroy(conn);
+
+ // Disable the VLAN network if necessary
+ disableVlanNetwork(conn, network);
+ }
+ }
+ } catch (InternalErrorException e) {
+ s_logger.error("Ip Assoc failure on applying one ip due to exception: ", e);
+ return new ExecutionResult(false, e.getMessage());
+ } catch (Exception e) {
+ return new ExecutionResult(false, e.getMessage());
+ }
+ return new ExecutionResult(true, null);
+ }
+
+ protected GetVncPortAnswer execute(GetVncPortCommand cmd) {
+ Connection conn = getConnection();
+ try {
+ Set vms = VM.getByNameLabel(conn, cmd.getName());
+ if (vms.size() == 1) {
+ String consoleurl;
+ consoleurl = "consoleurl=" + getVncUrl(conn, vms.iterator().next()) + "&" + "sessionref=" + conn.getSessionReference();
+ return new GetVncPortAnswer(cmd, consoleurl, -1);
+ } else {
+ return new GetVncPortAnswer(cmd, "There are " + vms.size() + " VMs named " + cmd.getName());
+ }
+ } catch (Exception e) {
+ String msg = "Unable to get vnc port due to " + e.toString();
+ s_logger.warn(msg, e);
+ return new GetVncPortAnswer(cmd, msg);
+ }
+ }
+
+ protected Storage.StorageResourceType getStorageResourceType() {
+ return Storage.StorageResourceType.STORAGE_POOL;
+ }
+
+ protected CheckHealthAnswer execute(CheckHealthCommand cmd) {
+ boolean result = pingXAPI();
+ return new CheckHealthAnswer(cmd, result);
+ }
+
+ protected long[] getNetworkStats(Connection conn, String privateIP) {
+ String result = networkUsage(conn, privateIP, "get", null);
+ long[] stats = new long[2];
+ if (result != null) {
+ String[] splitResult = result.split(":");
+ int i = 0;
+ while (i < splitResult.length - 1) {
+ stats[0] += (new Long(splitResult[i++])).longValue();
+ stats[1] += (new Long(splitResult[i++])).longValue();
+ }
+ }
+ return stats;
+ }
+
+ /**
+ * This is the method called for getting the HOST stats
+ *
+ * @param cmd
+ * @return
+ */
+ protected GetHostStatsAnswer execute(GetHostStatsCommand cmd) {
+ Connection conn = getConnection();
+ try {
+ HostStatsEntry hostStats = getHostStats(conn, cmd, cmd.getHostGuid(), cmd.getHostId());
+ return new GetHostStatsAnswer(cmd, hostStats);
+ } catch (Exception e) {
+ String msg = "Unable to get Host stats" + e.toString();
+ s_logger.warn(msg, e);
+ return new GetHostStatsAnswer(cmd, null);
+ }
+ }
+
+ protected HostStatsEntry getHostStats(Connection conn, GetHostStatsCommand cmd, String hostGuid, long hostId) {
+
+ HostStatsEntry hostStats = new HostStatsEntry(hostId, 0, 0, 0, "host", 0, 0, 0, 0);
+ Object[] rrdData = getRRDData(conn, 1); // call rrd method with 1 for host
+
+ if (rrdData == null) {
+ return null;
+ }
+
+ Integer numRows = (Integer)rrdData[0];
+ Integer numColumns = (Integer)rrdData[1];
+ Node legend = (Node)rrdData[2];
+ Node dataNode = (Node)rrdData[3];
+
+ NodeList legendChildren = legend.getChildNodes();
+ for (int col = 0; col < numColumns; col++) {
+
+ if (legendChildren == null || legendChildren.item(col) == null) {
+ continue;
+ }
+
+ String columnMetadata = getXMLNodeValue(legendChildren.item(col));
+
+ if (columnMetadata == null) {
+ continue;
+ }
+
+ String[] columnMetadataList = columnMetadata.split(":");
+
+ if (columnMetadataList.length != 4) {
+ continue;
+ }
+
+ String type = columnMetadataList[1];
+ String param = columnMetadataList[3];
+
+ if (type.equalsIgnoreCase("host")) {
+
+ if (param.contains("pif_eth0_rx")) {
+ hostStats.setNetworkReadKBs(getDataAverage(dataNode, col, numRows));
+ }
+
+ if (param.contains("pif_eth0_tx")) {
+ hostStats.setNetworkWriteKBs(getDataAverage(dataNode, col, numRows));
+ }
+
+ if (param.contains("memory_total_kib")) {
+ hostStats.setTotalMemoryKBs(getDataAverage(dataNode, col, numRows));
+ }
+
+ if (param.contains("memory_free_kib")) {
+ hostStats.setFreeMemoryKBs(getDataAverage(dataNode, col, numRows));
+ }
+
+ if (param.contains("cpu")) {
+ // hostStats.setNumCpus(hostStats.getNumCpus() + 1);
+ hostStats.setCpuUtilization(hostStats.getCpuUtilization() + getDataAverage(dataNode, col, numRows));
+ }
+
+ /*
+ if (param.contains("loadavg")) {
+ hostStats.setAverageLoad((hostStats.getAverageLoad() + getDataAverage(dataNode, col, numRows)));
+ }
+ */
+ }
+ }
+
+ // add the host cpu utilization
+ /*
+ if (hostStats.getNumCpus() != 0) {
+ hostStats.setCpuUtilization(hostStats.getCpuUtilization() / hostStats.getNumCpus());
+ s_logger.debug("Host cpu utilization " + hostStats.getCpuUtilization());
+ }
+ */
+
+ return hostStats;
+ }
+
+ protected GetVmStatsAnswer execute(GetVmStatsCommand cmd) {
+ Connection conn = getConnection();
+ List vmNames = cmd.getVmNames();
+ HashMap vmStatsNameMap = new HashMap();
+ if (vmNames.size() == 0) {
+ return new GetVmStatsAnswer(cmd, vmStatsNameMap);
+ }
+ try {
+
+ // Determine the UUIDs of the requested VMs
+ List vmUUIDs = new ArrayList();
+
+ for (String vmName : vmNames) {
+ VM vm = getVM(conn, vmName);
+ vmUUIDs.add(vm.getUuid(conn));
+ }
+
+ HashMap vmStatsUUIDMap = getVmStats(conn, cmd, vmUUIDs, cmd.getHostGuid());
+ if (vmStatsUUIDMap == null) {
+ return new GetVmStatsAnswer(cmd, vmStatsNameMap);
+ }
+
+ for (String vmUUID : vmStatsUUIDMap.keySet()) {
+ vmStatsNameMap.put(vmNames.get(vmUUIDs.indexOf(vmUUID)), vmStatsUUIDMap.get(vmUUID));
+ }
+
+ return new GetVmStatsAnswer(cmd, vmStatsNameMap);
+ } catch (XenAPIException e) {
+ String msg = "Unable to get VM stats" + e.toString();
+ s_logger.warn(msg, e);
+ return new GetVmStatsAnswer(cmd, vmStatsNameMap);
+ } catch (XmlRpcException e) {
+ String msg = "Unable to get VM stats" + e.getMessage();
+ s_logger.warn(msg, e);
+ return new GetVmStatsAnswer(cmd, vmStatsNameMap);
+ }
+ }
+
+ protected HashMap getVmStats(Connection conn, GetVmStatsCommand cmd, List vmUUIDs, String hostGuid) {
+ HashMap vmResponseMap = new HashMap();
+
+ for (String vmUUID : vmUUIDs) {
+ vmResponseMap.put(vmUUID, new VmStatsEntry(0, 0, 0, 0, "vm"));
+ }
+
+ Object[] rrdData = getRRDData(conn, 2); // call rrddata with 2 for vm
+
+ if (rrdData == null) {
+ return null;
+ }
+
+ Integer numRows = (Integer)rrdData[0];
+ Integer numColumns = (Integer)rrdData[1];
+ Node legend = (Node)rrdData[2];
+ Node dataNode = (Node)rrdData[3];
+
+ NodeList legendChildren = legend.getChildNodes();
+ for (int col = 0; col < numColumns; col++) {
+
+ if (legendChildren == null || legendChildren.item(col) == null) {
+ continue;
+ }
+
+ String columnMetadata = getXMLNodeValue(legendChildren.item(col));
+
+ if (columnMetadata == null) {
+ continue;
+ }
+
+ String[] columnMetadataList = columnMetadata.split(":");
+
+ if (columnMetadataList.length != 4) {
+ continue;
+ }
+
+ String type = columnMetadataList[1];
+ String uuid = columnMetadataList[2];
+ String param = columnMetadataList[3];
+
+ if (type.equals("vm") && vmResponseMap.keySet().contains(uuid)) {
+ VmStatsEntry vmStatsAnswer = vmResponseMap.get(uuid);
+
+ vmStatsAnswer.setEntityType("vm");
+
+ if (param.contains("cpu")) {
+ vmStatsAnswer.setNumCPUs(vmStatsAnswer.getNumCPUs() + 1);
+ vmStatsAnswer.setCPUUtilization(((vmStatsAnswer.getCPUUtilization() + getDataAverage(dataNode, col, numRows))));
+ } else if (param.matches("vif_\\d_rx")) {
+ vmStatsAnswer.setNetworkReadKBs(vmStatsAnswer.getNetworkReadKBs() + (getDataAverage(dataNode, col, numRows) / (8 * 2)));
+ } else if (param.matches("vif_\\d_tx")) {
+ vmStatsAnswer.setNetworkWriteKBs(vmStatsAnswer.getNetworkWriteKBs() + (getDataAverage(dataNode, col, numRows) / (8 * 2)));
+ }
+ }
+
+ }
+
+ for (String vmUUID : vmResponseMap.keySet()) {
+ VmStatsEntry vmStatsAnswer = vmResponseMap.get(vmUUID);
+
+ if (vmStatsAnswer.getNumCPUs() != 0) {
+ vmStatsAnswer.setCPUUtilization(vmStatsAnswer.getCPUUtilization() / vmStatsAnswer.getNumCPUs());
+ }
+
+ vmStatsAnswer.setCPUUtilization(vmStatsAnswer.getCPUUtilization() * 100);
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Vm cpu utilization " + vmStatsAnswer.getCPUUtilization());
+ }
+ }
+
+ try {
+ for (String vmUUID : vmUUIDs) {
+ VM vm = VM.getByUuid(conn, vmUUID);
+ VmStatsEntry stats = vmResponseMap.get(vmUUID);
+ double diskReadKBs = 0;
+ double diskWriteKBs = 0;
+ for (VBD vbd : vm.getVBDs(conn)) {
+ VBDMetrics vbdmetrics = vbd.getMetrics(conn);
+ if (!isRefNull(vbdmetrics)) {
+ try {
+ diskReadKBs += vbdmetrics.getIoReadKbs(conn);
+ diskWriteKBs += vbdmetrics.getIoWriteKbs(conn);
+ } catch (Types.HandleInvalid e) {
+ s_logger.debug("vbdmetrics doesn't exist ");
+ }
+ }
+ }
+ if (stats == null) {
+ stats = new VmStatsEntry();
+ }
+ stats.setDiskReadKBs(diskReadKBs);
+ stats.setDiskWriteKBs(diskWriteKBs);
+ vmResponseMap.put(vmUUID, stats);
+ }
+ } catch (Exception e) {
+ s_logger.warn("Error while collecting disk stats from : ", e);
+ return null;
+ }
+
+ return vmResponseMap;
+ }
+
+ protected GetVmDiskStatsAnswer execute(GetVmDiskStatsCommand cmd) {
+ return new GetVmDiskStatsAnswer(cmd, null, null, null);
+ }
+
+
+ protected Document getStatsRawXML(Connection conn, boolean host) {
+ Date currentDate = new Date();
+ String urlStr = "http://" + _host.ip + "/rrd_updates?";
+ urlStr += "session_id=" + conn.getSessionReference();
+ urlStr += "&host=" + (host ? "true" : "false");
+ urlStr += "&cf=" + _consolidationFunction;
+ urlStr += "&interval=" + _pollingIntervalInSeconds;
+ urlStr += "&start=" + (currentDate.getTime() / 1000 - 1000 - 100);
+
+ URL url;
+ BufferedReader in = null;
+ try {
+ url = new URL(urlStr);
+ url.openConnection();
+ URLConnection uc = url.openConnection();
+ in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
+ InputSource statsSource = new InputSource(in);
+ return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(statsSource);
+ } catch (MalformedURLException e) {
+ s_logger.warn("Malformed URL? come on...." + urlStr);
+ return null;
+ } catch (IOException e) {
+ s_logger.warn("Problems getting stats using " + urlStr, e);
+ return null;
+ } catch (SAXException e) {
+ s_logger.warn("Problems getting stats using " + urlStr, e);
+ return null;
+ } catch (ParserConfigurationException e) {
+ s_logger.warn("Problems getting stats using " + urlStr, e);
+ return null;
+ } finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch (IOException e) {
+ s_logger.warn("Unable to close the buffer ", e);
+ }
+ }
+ }
+ }
+
+
+
+ protected Object[] getRRDData(Connection conn, int flag) {
+
+ /*
+ * Note: 1 => called from host, hence host stats 2 => called from vm, hence vm stats
+ */
+ Document doc = null;
+
+ try {
+ doc = getStatsRawXML(conn, flag == 1 ? true : false);
+ } catch (Exception e1) {
+ s_logger.warn("Error whilst collecting raw stats from plugin: ", e1);
+ return null;
+ }
+
+ if (doc == null) { //stats are null when the host plugin call fails (host down state)
+ return null;
+ }
+
+ NodeList firstLevelChildren = doc.getChildNodes();
+ NodeList secondLevelChildren = (firstLevelChildren.item(0)).getChildNodes();
+ Node metaNode = secondLevelChildren.item(0);
+ Node dataNode = secondLevelChildren.item(1);
+
+ Integer numRows = 0;
+ Integer numColumns = 0;
+ Node legend = null;
+ NodeList metaNodeChildren = metaNode.getChildNodes();
+ for (int i = 0; i < metaNodeChildren.getLength(); i++) {
+ Node n = metaNodeChildren.item(i);
+ if (n.getNodeName().equals("rows")) {
+ numRows = Integer.valueOf(getXMLNodeValue(n));
+ } else if (n.getNodeName().equals("columns")) {
+ numColumns = Integer.valueOf(getXMLNodeValue(n));
+ } else if (n.getNodeName().equals("legend")) {
+ legend = n;
+ }
+ }
+
+ return new Object[] { numRows, numColumns, legend, dataNode };
+ }
+
+ protected String getXMLNodeValue(Node n) {
+ return n.getChildNodes().item(0).getNodeValue();
+ }
+
+ protected double getDataAverage(Node dataNode, int col, int numRows) {
+ double value = 0;
+ double dummy = 0;
+ int numRowsUsed = 0;
+ for (int row = 0; row < numRows; row++) {
+ Node data = dataNode.getChildNodes().item(numRows - 1 - row).getChildNodes().item(col + 1);
+ Double currentDataAsDouble = Double.valueOf(getXMLNodeValue(data));
+ if (!currentDataAsDouble.equals(Double.NaN)) {
+ numRowsUsed += 1;
+ value += currentDataAsDouble;
+ }
+ }
+
+ if (numRowsUsed == 0) {
+ if ((!Double.isInfinite(value)) && (!Double.isNaN(value))) {
+ return value;
+ } else {
+ s_logger.warn("Found an invalid value (infinity/NaN) in getDataAverage(), numRows=0");
+ return dummy;
+ }
+ } else {
+ if ((!Double.isInfinite(value / numRowsUsed)) && (!Double.isNaN(value / numRowsUsed))) {
+ return (value / numRowsUsed);
+ } else {
+ s_logger.warn("Found an invalid value (infinity/NaN) in getDataAverage(), numRows>0");
+ return dummy;
+ }
+ }
+
+ }
+
+ protected State convertToState(Types.VmPowerState ps) {
+ final State state = s_statesTable.get(ps);
+ return state == null ? State.Unknown : state;
+ }
+
+ private static PowerState convertPowerState(Types.VmPowerState powerState) {
+ return s_powerStatesTable.get(powerState);
+ }
+
+ protected HashMap getHostVmStateReport(Connection conn) {
+
+ // TODO : new VM sync model does not require a cluster-scope report, we need to optimize
+ // the report accordingly
+ final HashMap vmStates = new HashMap();
+ Map vm_map = null;
+ for (int i = 0; i < 2; i++) {
+ try {
+ vm_map = VM.getAllRecords(conn); //USE THIS TO GET ALL VMS FROM A CLUSTER
+ break;
+ } catch (final Throwable e) {
+ s_logger.warn("Unable to get vms", e);
+ }
+ try {
+ Thread.sleep(1000);
+ } catch (final InterruptedException ex) {
+
+ }
+ }
+
+ if (vm_map == null) {
+ return vmStates;
+ }
+ for (VM.Record record : vm_map.values()) {
+ if (record.isControlDomain || record.isASnapshot || record.isATemplate) {
+ continue; // Skip DOM0
+ }
+
+ VmPowerState ps = record.powerState;
+ Host host = record.residentOn;
+ String host_uuid = null;
+ if (!isRefNull(host)) {
+ try {
+ host_uuid = host.getUuid(conn);
+ } catch (BadServerResponse e) {
+ s_logger.error("Failed to get host uuid for host " + host.toWireString(), e);
+ } catch (XenAPIException e) {
+ s_logger.error("Failed to get host uuid for host " + host.toWireString(), e);
+ } catch (XmlRpcException e) {
+ s_logger.error("Failed to get host uuid for host " + host.toWireString(), e);
+ }
+
+ if (host_uuid.equalsIgnoreCase(_host.uuid)) {
+ vmStates.put(
+ record.nameLabel,
+ new HostVmStateReportEntry(convertPowerState(ps), host_uuid)
+ );
+ }
+ }
+ }
+
+ return vmStates;
+ }
+
+ // TODO vmsync {
+ protected HashMap> getAllVms(Connection conn) {
+ final HashMap> vmStates = new HashMap>();
+ Map vm_map = null;
+ for (int i = 0; i < 2; i++) {
+ try {
+ vm_map = VM.getAllRecords(conn); //USE THIS TO GET ALL VMS FROM A CLUSTER
+ break;
+ } catch (final Throwable e) {
+ s_logger.warn("Unable to get vms", e);
+ }
+ try {
+ Thread.sleep(1000);
+ } catch (final InterruptedException ex) {
+
+ }
+ }
+
+ if (vm_map == null) {
+ return null;
+ }
+ for (VM.Record record : vm_map.values()) {
+ if (record.isControlDomain || record.isASnapshot || record.isATemplate) {
+ continue; // Skip DOM0
+ }
+
+ VmPowerState ps = record.powerState;
+ final State state = convertToState(ps);
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace("VM " + record.nameLabel + ": powerstate = " + ps + "; vm state=" + state.toString());
+ }
+ Host host = record.residentOn;
+ String host_uuid = null;
+ if (!isRefNull(host)) {
+ try {
+ host_uuid = host.getUuid(conn);
+ } catch (BadServerResponse e) {
+ s_logger.error("Failed to get host uuid for host " + host.toWireString(), e);
+ } catch (XenAPIException e) {
+ s_logger.error("Failed to get host uuid for host " + host.toWireString(), e);
+ } catch (XmlRpcException e) {
+ s_logger.error("Failed to get host uuid for host " + host.toWireString(), e);
+ }
+ vmStates.put(record.nameLabel, new Pair(host_uuid, state));
+ }
+ }
+
+ return vmStates;
+ }
+
+ // TODO vmsync }
+
+ protected State getVmState(Connection conn, final String vmName) {
+ int retry = 3;
+ while (retry-- > 0) {
+ try {
+ Set vms = VM.getByNameLabel(conn, vmName);
+ for (final VM vm : vms) {
+ return convertToState(vm.getPowerState(conn));
+ }
+ } catch (final BadServerResponse e) {
+ // There is a race condition within xenserver such that if a vm is
+ // deleted and we
+ // happen to ask for it, it throws this stupid response. So
+ // if this happens,
+ // we take a nap and try again which then avoids the race
+ // condition because
+ // the vm's information is now cleaned up by xenserver. The error
+ // is as follows
+ // com.xensource.xenapi.Types$BadServerResponse
+ // [HANDLE_INVALID, VM,
+ // 3dde93f9-c1df-55a7-2cde-55e1dce431ab]
+ s_logger.info("Unable to get a vm PowerState due to " + e.toString() + ". We are retrying. Count: " + retry);
+ try {
+ Thread.sleep(3000);
+ } catch (final InterruptedException ex) {
+
+ }
+ } catch (XenAPIException e) {
+ String msg = "Unable to get a vm PowerState due to " + e.toString();
+ s_logger.warn(msg, e);
+ break;
+ } catch (final XmlRpcException e) {
+ String msg = "Unable to get a vm PowerState due to " + e.getMessage();
+ s_logger.warn(msg, e);
+ break;
+ }
+ }
+
+ return State.Stopped;
+ }
+
+ protected CheckVirtualMachineAnswer execute(final CheckVirtualMachineCommand cmd) {
+ Connection conn = getConnection();
+ final String vmName = cmd.getVmName();
+ final State state = getVmState(conn, vmName);
+ Integer vncPort = null;
+ if (state == State.Running) {
+ synchronized (_cluster.intern()) {
+ s_vms.put(_cluster, _name, vmName, State.Running);
+ }
+ s_logger.debug("3. The VM " + vmName + " is in Running state");
+ }
+
+ return new CheckVirtualMachineAnswer(cmd, state, vncPort);
+ }
+
+ protected PrepareForMigrationAnswer execute(PrepareForMigrationCommand cmd) {
+ Connection conn = getConnection();
+
+ VirtualMachineTO vm = cmd.getVirtualMachine();
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Preparing host for migrating " + vm);
+ }
+
+ NicTO[] nics = vm.getNics();
+ try {
+ prepareISO(conn, vm.getName());
+
+ for (NicTO nic : nics) {
+ getNetwork(conn, nic);
+ }
+ synchronized (_cluster.intern()) {
+ s_vms.put(_cluster, _name, vm.getName(), State.Migrating);
+ }
+ s_logger.debug("4. The VM " + vm.getName() + " is in Migrating state");
+
+ return new PrepareForMigrationAnswer(cmd);
+ } catch (Exception e) {
+ s_logger.warn("Catch Exception " + e.getClass().getName() + " prepare for migration failed due to " + e.toString(), e);
+ return new PrepareForMigrationAnswer(cmd, e);
+ }
+ }
+
+ String upgradeSnapshot(Connection conn, String templatePath, String snapshotPath) {
+ String results = callHostPluginAsync(conn, "vmopspremium", "upgrade_snapshot", 2 * 60 * 60, "templatePath", templatePath, "snapshotPath", snapshotPath);
+
+ if (results == null || results.isEmpty()) {
+ String msg = "upgrade_snapshot return null";
+ s_logger.warn(msg);
+ throw new CloudRuntimeException(msg);
+ }
+ String[] tmp = results.split("#");
+ String status = tmp[0];
+ if (status.equals("0")) {
+ return results;
+ } else {
+ s_logger.warn(results);
+ throw new CloudRuntimeException(results);
+ }
+ }
+
+ String createTemplateFromSnapshot(Connection conn, String templatePath, String snapshotPath, int wait) {
+ String tmpltLocalDir = UUID.randomUUID().toString();
+ String results =
+ callHostPluginAsync(conn, "vmopspremium", "create_privatetemplate_from_snapshot", wait, "templatePath", templatePath, "snapshotPath", snapshotPath,
+ "tmpltLocalDir", tmpltLocalDir);
+ String errMsg = null;
+ if (results == null || results.isEmpty()) {
+ errMsg = "create_privatetemplate_from_snapshot return null";
+ } else {
+ String[] tmp = results.split("#");
+ String status = tmp[0];
+ if (status.equals("0")) {
+ return results;
+ } else {
+ errMsg = "create_privatetemplate_from_snapshot failed due to " + tmp[1];
+ }
+ }
+ String source = "cloud_mount/" + tmpltLocalDir;
+ killCopyProcess(conn, source);
+ s_logger.warn(errMsg);
+ throw new CloudRuntimeException(errMsg);
+ }
+
+ boolean killCopyProcess(Connection conn, String nameLabel) {
+ String results = callHostPluginAsync(conn, "vmops", "kill_copy_process", 60, "namelabel", nameLabel);
+ String errMsg = null;
+ if (results == null || results.equals("false")) {
+ errMsg = "kill_copy_process failed";
+ s_logger.warn(errMsg);
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ void destroyVDIbyNameLabel(Connection conn, String nameLabel) {
+ try {
+ Set vdis = VDI.getByNameLabel(conn, nameLabel);
+ if (vdis.size() != 1) {
+ s_logger.warn("destoryVDIbyNameLabel failed due to there are " + vdis.size() + " VDIs with name " + nameLabel);
+ return;
+ }
+ for (VDI vdi : vdis) {
+ try {
+ vdi.destroy(conn);
+ } catch (Exception e) {
+ }
+ }
+ } catch (Exception e) {
+ }
+ }
+
+ String copy_vhd_from_secondarystorage(Connection conn, String mountpoint, String sruuid, int wait) {
+ String nameLabel = "cloud-" + UUID.randomUUID().toString();
+ String results =
+ callHostPluginAsync(conn, "vmopspremium", "copy_vhd_from_secondarystorage", wait, "mountpoint", mountpoint, "sruuid", sruuid, "namelabel", nameLabel);
+ String errMsg = null;
+ if (results == null || results.isEmpty()) {
+ errMsg = "copy_vhd_from_secondarystorage return null";
+ } else {
+ String[] tmp = results.split("#");
+ String status = tmp[0];
+ if (status.equals("0")) {
+ return tmp[1];
+ } else {
+ errMsg = tmp[1];
+ }
+ }
+ String source = mountpoint.substring(mountpoint.lastIndexOf('/') + 1);
+ if (killCopyProcess(conn, source)) {
+ destroyVDIbyNameLabel(conn, nameLabel);
+ }
+ s_logger.warn(errMsg);
+ throw new CloudRuntimeException(errMsg);
+ }
+
+ public PrimaryStorageDownloadAnswer execute(final PrimaryStorageDownloadCommand cmd) {
+ String tmplturl = cmd.getUrl();
+ String poolName = cmd.getPoolUuid();
+ int wait = cmd.getWait();
+ try {
+ URI uri = new URI(tmplturl);
+ String tmplpath = uri.getHost() + ":" + uri.getPath();
+ Connection conn = getConnection();
+ SR poolsr = null;
+ Set srs = SR.getByNameLabel(conn, poolName);
+ if (srs.size() != 1) {
+ String msg = "There are " + srs.size() + " SRs with same name: " + poolName;
+ s_logger.warn(msg);
+ return new PrimaryStorageDownloadAnswer(msg);
+ } else {
+ poolsr = srs.iterator().next();
+ }
+ String pUuid = poolsr.getUuid(conn);
+ boolean isISCSI = IsISCSI(poolsr.getType(conn));
+ String uuid = copy_vhd_from_secondarystorage(conn, tmplpath, pUuid, wait);
+ VDI tmpl = getVDIbyUuid(conn, uuid);
+ VDI snapshotvdi = tmpl.snapshot(conn, new HashMap());
+ String snapshotUuid = snapshotvdi.getUuid(conn);
+ snapshotvdi.setNameLabel(conn, "Template " + cmd.getName());
+ String parentuuid = getVhdParent(conn, pUuid, snapshotUuid, isISCSI);
+ VDI parent = getVDIbyUuid(conn, parentuuid);
+ Long phySize = parent.getPhysicalUtilisation(conn);
+ tmpl.destroy(conn);
+ poolsr.scan(conn);
+ try {
+ Thread.sleep(5000);
+ } catch (Exception e) {
+ }
+ return new PrimaryStorageDownloadAnswer(snapshotvdi.getUuid(conn), phySize);
+ } catch (Exception e) {
+ String msg = "Catch Exception " + e.getClass().getName() + " on host:" + _host.uuid + " for template: " + tmplturl + " due to " + e.toString();
+ s_logger.warn(msg, e);
+ return new PrimaryStorageDownloadAnswer(msg);
+ }
+ }
+
+ protected String removeSRSync(Connection conn, SR sr) {
+ if (sr == null) {
+ return null;
+ }
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug(logX(sr, "Removing SR"));
+ }
+ long waittime = 0;
+ try {
+ Set vdis = sr.getVDIs(conn);
+ for (VDI vdi : vdis) {
+ Map currentOperation = vdi.getCurrentOperations(conn);
+ if (currentOperation == null || currentOperation.size() == 0) {
+ continue;
+ }
+ if (waittime >= 1800000) {
+ String msg = "This template is being used, try late time";
+ s_logger.warn(msg);
+ return msg;
+ }
+ waittime += 30000;
+ try {
+ Thread.sleep(30000);
+ } catch (final InterruptedException ex) {
+ }
+ }
+ removeSR(conn, sr);
+ return null;
+ } catch (XenAPIException e) {
+ s_logger.warn(logX(sr, "Unable to get current opertions " + e.toString()), e);
+ } catch (XmlRpcException e) {
+ s_logger.warn(logX(sr, "Unable to get current opertions " + e.getMessage()), e);
+ }
+ String msg = "Remove SR failed";
+ s_logger.warn(msg);
+ return msg;
+
+ }
+
+ protected void removeSR(Connection conn, SR sr) {
+ if (sr == null) {
+ return;
+ }
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug(logX(sr, "Removing SR"));
+ }
+
+ for (int i = 0; i < 2; i++) {
+ try {
+ Set vdis = sr.getVDIs(conn);
+ for (VDI vdi : vdis) {
+ vdi.forget(conn);
+ }
+ Set pbds = sr.getPBDs(conn);
+ for (PBD pbd : pbds) {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug(logX(pbd, "Unplugging pbd"));
+ }
+ if (pbd.getCurrentlyAttached(conn)) {
+ pbd.unplug(conn);
+ }
+ pbd.destroy(conn);
+ }
+
+ pbds = sr.getPBDs(conn);
+ if (pbds.size() == 0) {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug(logX(sr, "Forgetting"));
+ }
+ sr.forget(conn);
+ return;
+ }
+
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug(logX(sr, "There are still pbd attached"));
+ if (s_logger.isTraceEnabled()) {
+ for (PBD pbd : pbds) {
+ s_logger.trace(logX(pbd, " Still attached"));
+ }
+ }
+ }
+ } catch (XenAPIException e) {
+ s_logger.debug(logX(sr, "Catch XenAPIException: " + e.toString()));
+ } catch (XmlRpcException e) {
+ s_logger.debug(logX(sr, "Catch Exception: " + e.getMessage()));
+ }
+ }
+ s_logger.warn(logX(sr, "Unable to remove SR"));
+ }
+
+ protected MigrateAnswer execute(final MigrateCommand cmd) {
+ Connection conn = getConnection();
+ final String vmName = cmd.getVmName();
+ State state = null;
+
+ state = s_vms.getState(_cluster, vmName);
+
+ synchronized (_cluster.intern()) {
+ s_vms.put(_cluster, _name, vmName, State.Stopping);
+ }
+ s_logger.debug("5. The VM " + vmName + " is in Stopping state");
+ try {
+ Set vms = VM.getByNameLabel(conn, vmName);
+
+ String ipaddr = cmd.getDestinationIp();
+
+ Set hosts = Host.getAll(conn);
+ Host dsthost = null;
+ for (Host host : hosts) {
+ if (host.getAddress(conn).equals(ipaddr)) {
+ dsthost = host;
+ break;
+ }
+ }
+ if (dsthost == null) {
+ String msg = "Migration failed due to unable to find host " + ipaddr + " in XenServer pool " + _host.pool;
+ s_logger.warn(msg);
+ return new MigrateAnswer(cmd, false, msg, null);
+ }
+ for (VM vm : vms) {
+ Set vbds = vm.getVBDs(conn);
+ for (VBD vbd : vbds) {
+ VBD.Record vbdRec = vbd.getRecord(conn);
+ if (vbdRec.type.equals(Types.VbdType.CD) && !vbdRec.empty) {
+ vbd.eject(conn);
+ break;
+ }
+ }
+ migrateVM(conn, dsthost, vm, vmName);
+ vm.setAffinity(conn, dsthost);
+ state = State.Stopping;
+ }
+ return new MigrateAnswer(cmd, true, "migration succeeded", null);
+ } catch (Exception e) {
+ String msg = "Catch Exception " + e.getClass().getName() + ": Migration failed due to " + e.toString();
+ s_logger.warn(msg, e);
+ return new MigrateAnswer(cmd, false, msg, null);
+ } finally {
+ synchronized (_cluster.intern()) {
+ s_vms.put(_cluster, _name, vmName, state);
+ }
+ s_logger.debug("6. The VM " + vmName + " is in " + state + " state");
+ }
+
+ }
+
+ protected State getRealPowerState(Connection conn, String label) {
+ int i = 0;
+ s_logger.trace("Checking on the HALTED State");
+ for (; i < 20; i++) {
+ try {
+ Set vms = VM.getByNameLabel(conn, label);
+ if (vms == null || vms.size() == 0) {
+ continue;
+ }
+
+ VM vm = vms.iterator().next();
+
+ VmPowerState vps = vm.getPowerState(conn);
+ if (vps != null && vps != VmPowerState.HALTED && vps != VmPowerState.UNRECOGNIZED) {
+ return convertToState(vps);
+ }
+ } catch (XenAPIException e) {
+ String msg = "Unable to get real power state due to " + e.toString();
+ s_logger.warn(msg, e);
+ } catch (XmlRpcException e) {
+ String msg = "Unable to get real power state due to " + e.getMessage();
+ s_logger.warn(msg, e);
+ }
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+ }
+ return State.Stopped;
+ }
+
+ protected Pair getControlDomain(Connection conn) throws XenAPIException, XmlRpcException {
+ Host host = Host.getByUuid(conn, _host.uuid);
+ Set vms = null;
+ vms = host.getResidentVMs(conn);
+ for (VM vm : vms) {
+ if (vm.getIsControlDomain(conn)) {
+ return new Pair(vm, vm.getRecord(conn));
+ }
+ }
+
+ throw new CloudRuntimeException("Com'on no control domain? What the crap?!#@!##$@");
+ }
+
+ protected void umountSnapshotDir(Connection conn, Long dcId) {
+ try {
+ callHostPlugin(conn, "vmopsSnapshot", "unmountSnapshotsDir", "dcId", dcId.toString());
+ } catch (Exception e) {
+ s_logger.debug("Failed to umount snapshot dir",e);
+ }
+ }
+
+ protected ReadyAnswer execute(ReadyCommand cmd) {
+ Connection conn = getConnection();
+ Long dcId = cmd.getDataCenterId();
+ // Ignore the result of the callHostPlugin. Even if unmounting the
+ // snapshots dir fails, let Ready command
+ // succeed.
+ umountSnapshotDir(conn, dcId);
+
+ setupLinkLocalNetwork(conn);
+ // try to destroy CD-ROM device for all system VMs on this host
+ try {
+ Host host = Host.getByUuid(conn, _host.uuid);
+ Set vms = host.getResidentVMs(conn);
+ for (VM vm : vms) {
+ destroyPatchVbd(conn, vm.getNameLabel(conn));
+ }
+ } catch (Exception e) {
+ }
+ try {
+ boolean result = cleanupHaltedVms(conn);
+ if (!result) {
+ return new ReadyAnswer(cmd, "Unable to cleanup halted vms");
+ }
+ } catch (XenAPIException e) {
+ s_logger.warn("Unable to cleanup halted vms", e);
+ return new ReadyAnswer(cmd, "Unable to cleanup halted vms");
+ } catch (XmlRpcException e) {
+ s_logger.warn("Unable to cleanup halted vms", e);
+ return new ReadyAnswer(cmd, "Unable to cleanup halted vms");
+ }
+
+ return new ReadyAnswer(cmd);
+ }
+
+ protected String getVncUrl(Connection conn, VM vm) {
+ VM.Record record;
+ Console c;
+ try {
+ record = vm.getRecord(conn);
+ Set consoles = record.consoles;
+
+ if (consoles.isEmpty()) {
+ s_logger.warn("There are no Consoles available to the vm : " + record.nameDescription);
+ return null;
+ }
+ Iterator i = consoles.iterator();
+ while (i.hasNext()) {
+ c = i.next();
+ if (c.getProtocol(conn) == Types.ConsoleProtocol.RFB)
+ return c.getLocation(conn);
+ }
+ } catch (XenAPIException e) {
+ String msg = "Unable to get console url due to " + e.toString();
+ s_logger.warn(msg, e);
+ return null;
+ } catch (XmlRpcException e) {
+ String msg = "Unable to get console url due to " + e.getMessage();
+ s_logger.warn(msg, e);
+ return null;
+ }
+ return null;
+ }
+
+ @Override
+ public RebootAnswer execute(RebootCommand cmd) {
+ Connection conn = getConnection();
+ synchronized (_cluster.intern()) {
+ s_vms.put(_cluster, _name, cmd.getVmName(), State.Starting);
+ }
+ s_logger.debug("7. The VM " + cmd.getVmName() + " is in Starting state");
+ try {
+ Set vms = null;
+ try {
+ vms = VM.getByNameLabel(conn, cmd.getVmName());
+ } catch (XenAPIException e0) {
+ s_logger.debug("getByNameLabel failed " + e0.toString());
+ return new RebootAnswer(cmd, "getByNameLabel failed " + e0.toString(), false);
+ } catch (Exception e0) {
+ s_logger.debug("getByNameLabel failed " + e0.getMessage());
+ return new RebootAnswer(cmd, "getByNameLabel failed", false);
+ }
+ for (VM vm : vms) {
+ try {
+ rebootVM(conn, vm, vm.getNameLabel(conn));
+ } catch (Exception e) {
+ String msg = e.toString();
+ s_logger.warn(msg, e);
+ return new RebootAnswer(cmd, msg, false);
+ }
+ }
+ return new RebootAnswer(cmd, "reboot succeeded", true);
+ } finally {
+ synchronized (_cluster.intern()) {
+ s_vms.put(_cluster, _name, cmd.getVmName(), State.Running);
+ }
+ s_logger.debug("8. The VM " + cmd.getVmName() + " is in Running state");
+ }
+ }
+
+ protected Answer execute(RebootRouterCommand cmd) {
+ Connection conn = getConnection();
+ RebootAnswer answer = execute((RebootCommand)cmd);
+ if (answer.getResult()) {
+ String cnct = connect(conn, cmd.getVmName(), cmd.getPrivateIpAddress());
+ networkUsage(conn, cmd.getPrivateIpAddress(), "create", null);
+ if (cnct == null) {
+ return answer;
+ } else {
+ return new Answer(cmd, false, cnct);
+ }
+ }
+ return answer;
+ }
+
+ protected void startvmfailhandle(Connection conn, VM vm, List> mounts) {
+ if (vm != null) {
+ try {
+
+ if (vm.getPowerState(conn) == VmPowerState.RUNNING) {
+ try {
+ vm.hardShutdown(conn);
+ } catch (Exception e) {
+ String msg = "VM hardshutdown failed due to " + e.toString();
+ s_logger.warn(msg, e);
+ }
+ }
+ if (vm.getPowerState(conn) == VmPowerState.HALTED) {
+ try {
+ vm.destroy(conn);
+ } catch (Exception e) {
+ String msg = "VM destroy failed due to " + e.toString();
+ s_logger.warn(msg, e);
+ }
+ }
+ } catch (Exception e) {
+ String msg = "VM getPowerState failed due to " + e.toString();
+ s_logger.warn(msg, e);
+ }
+ }
+ if (mounts != null) {
+ for (Ternary mount : mounts) {
+ VDI vdi = mount.second();
+ Set vbds = null;
+ try {
+ vbds = vdi.getVBDs(conn);
+ } catch (Exception e) {
+ String msg = "VDI getVBDS failed due to " + e.toString();
+ s_logger.warn(msg, e);
+ continue;
+ }
+ for (VBD vbd : vbds) {
+ try {
+ vbd.unplug(conn);
+ vbd.destroy(conn);
+ } catch (Exception e) {
+ String msg = "VBD destroy failed due to " + e.toString();
+ s_logger.warn(msg, e);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * WARN: static-min <= dynamic-min <= dynamic-max <= static-max
+ * @see XcpServerResource#setMemory(com.xensource.xenapi.Connection, com.xensource.xenapi.VM, long, long)
+ * @param conn
+ * @param vm
+ * @param minMemsize
+ * @param maxMemsize
+ * @throws XmlRpcException
+ * @throws XenAPIException
+ */
+ protected void setMemory(Connection conn, VM vm, long minMemsize, long maxMemsize) throws XmlRpcException, XenAPIException {
+ vm.setMemoryLimits(conn, mem_128m, maxMemsize, minMemsize, maxMemsize);
+ }
+
+ /**
+ * When Dynamic Memory Control (DMC) is enabled -
+ * xenserver allows scaling the guest memory while the guest is running
+ *
+ * By default this is disallowed, override the specific xenserver resource
+ * if this is enabled
+ */
+ protected boolean isDmcEnabled(Connection conn, Host host) throws XenAPIException, XmlRpcException {
+ return false;
+ }
+
+ protected void waitForTask(Connection c, Task task, long pollInterval, long timeout) throws XenAPIException, XmlRpcException {
+ long beginTime = System.currentTimeMillis();
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace("Task " + task.getNameLabel(c) + " (" + task.getUuid(c) + ") sent to " + c.getSessionReference() + " is pending completion with a " + timeout +
+ "ms timeout");
+ }
+ while (task.getStatus(c) == Types.TaskStatusType.PENDING) {
+ try {
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace("Task " + task.getNameLabel(c) + " (" + task.getUuid(c) + ") is pending, sleeping for " + pollInterval + "ms");
+ }
+ Thread.sleep(pollInterval);
+ } catch (InterruptedException e) {
+ }
+ if (System.currentTimeMillis() - beginTime > timeout) {
+ String msg = "Async " + timeout / 1000 + " seconds timeout for task " + task.toString();
+ s_logger.warn(msg);
+ task.cancel(c);
+ throw new Types.BadAsyncResult(msg);
+ }
+ }
+ }
+
+ protected void checkForSuccess(Connection c, Task task) throws XenAPIException, XmlRpcException {
+ if (task.getStatus(c) == Types.TaskStatusType.SUCCESS) {
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace("Task " + task.getNameLabel(c) + " (" + task.getUuid(c) + ") completed");
+ }
+ return;
+ } else {
+ String msg = "Task failed! Task record: " + task.getRecord(c);
+ s_logger.warn(msg);
+ task.cancel(c);
+ throw new Types.BadAsyncResult(msg);
+ }
+ }
+
+ void rebootVM(Connection conn, VM vm, String vmName) throws XmlRpcException {
+ Task task = null;
+ try {
+ task = vm.cleanRebootAsync(conn);
+ try {
+ //poll every 1 seconds , timeout after 10 minutes
+ waitForTask(conn, task, 1000, 10 * 60 * 1000);
+ checkForSuccess(conn, task);
+ } catch (Types.HandleInvalid e) {
+ if (vm.getPowerState(conn) == Types.VmPowerState.RUNNING) {
+ task = null;
+ return;
+ }
+ throw new CloudRuntimeException("Reboot VM catch HandleInvalid and VM is not in RUNNING state");
+ }
+ } catch (XenAPIException e) {
+ s_logger.debug("Unable to Clean Reboot VM(" + vmName + ") on host(" + _host.uuid + ") due to " + e.toString() + ", try hard reboot");
+ try {
+ vm.hardReboot(conn);
+ } catch (Exception e1) {
+ String msg = "Unable to hard Reboot VM(" + vmName + ") on host(" + _host.uuid + ") due to " + e.toString();
+ s_logger.warn(msg, e1);
+ throw new CloudRuntimeException(msg);
+ }
+ } finally {
+ if (task != null) {
+ try {
+ task.destroy(conn);
+ } catch (Exception e1) {
+ s_logger.debug("unable to destroy task(" + task.toString() + ") on host(" + _host.uuid + ") due to " + e1.toString());
+ }
+ }
+ }
+ }
+
+ void forceShutdownVM(Connection conn, VM vm) {
+ try {
+ Long domId = vm.getDomid(conn);
+ callHostPlugin(conn, "vmopspremium", "forceShutdownVM", "domId", domId.toString());
+ vm.powerStateReset(conn);
+ vm.destroy(conn);
+ } catch (Exception e) {
+ String msg = "forceShutdown failed due to " + e.toString();
+ s_logger.warn(msg, e);
+ throw new CloudRuntimeException(msg);
+ }
+ }
+
+ void shutdownVM(Connection conn, VM vm, String vmName) throws XmlRpcException {
+ Task task = null;
+ try {
+ task = vm.cleanShutdownAsync(conn);
+ try {
+ //poll every 1 seconds , timeout after 10 minutes
+ waitForTask(conn, task, 1000, 10 * 60 * 1000);
+ checkForSuccess(conn, task);
+ } catch (Types.HandleInvalid e) {
+ if (vm.getPowerState(conn) == Types.VmPowerState.HALTED) {
+ task = null;
+ return;
+ }
+ throw new CloudRuntimeException("Shutdown VM catch HandleInvalid and VM is not in HALTED state");
+ }
+ } catch (XenAPIException e) {
+ s_logger.debug("Unable to cleanShutdown VM(" + vmName + ") on host(" + _host.uuid + ") due to " + e.toString());
+ try {
+ Types.VmPowerState state = vm.getPowerState(conn);
+ if (state == Types.VmPowerState.RUNNING) {
+ try {
+ vm.hardShutdown(conn);
+ } catch (Exception e1) {
+ s_logger.debug("Unable to hardShutdown VM(" + vmName + ") on host(" + _host.uuid + ") due to " + e.toString());
+ state = vm.getPowerState(conn);
+ if (state == Types.VmPowerState.RUNNING) {
+ forceShutdownVM(conn, vm);
+ }
+ return;
+ }
+ } else if (state == Types.VmPowerState.HALTED) {
+ return;
+ } else {
+ String msg = "After cleanShutdown the VM status is " + state.toString() + ", that is not expected";
+ s_logger.warn(msg);
+ throw new CloudRuntimeException(msg);
+ }
+ } catch (Exception e1) {
+ String msg = "Unable to hardShutdown VM(" + vmName + ") on host(" + _host.uuid + ") due to " + e.toString();
+ s_logger.warn(msg, e1);
+ throw new CloudRuntimeException(msg);
+ }
+ } finally {
+ if (task != null) {
+ try {
+ task.destroy(conn);
+ } catch (Exception e1) {
+ s_logger.debug("unable to destroy task(" + task.toString() + ") on host(" + _host.uuid + ") due to " + e1.toString());
+ }
+ }
+ }
+ }
+
+ void startVM(Connection conn, Host host, VM vm, String vmName) throws XmlRpcException {
+ Task task = null;
+ try {
+ task = vm.startOnAsync(conn, host, false, true);
+ try {
+ //poll every 1 seconds , timeout after 10 minutes
+ waitForTask(conn, task, 1000, 10 * 60 * 1000);
+ checkForSuccess(conn, task);
+ } catch (Types.HandleInvalid e) {
+ if (vm.getPowerState(conn) == Types.VmPowerState.RUNNING) {
+ s_logger.debug("VM " + vmName + " is in Running status");
+ task = null;
+ return;
+ }
+ throw new CloudRuntimeException("Start VM " + vmName + " catch HandleInvalid and VM is not in RUNNING state");
+ } catch (Types.BadAsyncResult e) {
+ if (vm.getPowerState(conn) == Types.VmPowerState.RUNNING) {
+ s_logger.debug("VM " + vmName + " is in Running status");
+ task = null;
+ return;
+ }
+ throw new CloudRuntimeException("Start VM " + vmName + " catch BadAsyncResult and VM is not in RUNNING state");
+ }
+ } catch (XenAPIException e) {
+ String msg = "Unable to start VM(" + vmName + ") on host(" + _host.uuid + ") due to " + e.toString();
+ s_logger.warn(msg, e);
+ throw new CloudRuntimeException(msg);
+ } finally {
+ if (task != null) {
+ try {
+ task.destroy(conn);
+ } catch (Exception e1) {
+ s_logger.debug("unable to destroy task(" + task.toString() + ") on host(" + _host.uuid + ") due to " + e1.toString());
+ }
+ }
+ }
+ }
+
+ private void migrateVM(Connection conn, Host destHost, VM vm, String vmName) throws XmlRpcException {
+ Task task = null;
+ try {
+ Map other = new HashMap();
+ other.put("live", "true");
+ task = vm.poolMigrateAsync(conn, destHost, other);
+ try {
+ // poll every 1 seconds
+ long timeout = (_migratewait) * 1000L;
+ waitForTask(conn, task, 1000, timeout);
+ checkForSuccess(conn, task);
+ } catch (Types.HandleInvalid e) {
+ if (vm.getResidentOn(conn).equals(destHost)) {
+ task = null;
+ return;
+ }
+ throw new CloudRuntimeException("migrate VM catch HandleInvalid and VM is not running on dest host");
+ }
+ } catch (XenAPIException e) {
+ String msg = "Unable to migrate VM(" + vmName + ") from host(" + _host.uuid + ") due to " + e.toString();
+ s_logger.warn(msg, e);
+ throw new CloudRuntimeException(msg);
+ } finally {
+ if (task != null) {
+ try {
+ task.destroy(conn);
+ } catch (Exception e1) {
+ s_logger.debug("unable to destroy task(" + task.toString() + ") on host(" + _host.uuid + ") due to " + e1.toString());
+ }
+ }
+ }
+ }
+
+ protected VDI cloudVDIcopy(Connection conn, VDI vdi, SR sr, int wait) throws XenAPIException, XmlRpcException {
+ Task task = null;
+ if (wait == 0) {
+ wait = 2 * 60 * 60;
+ }
+ try {
+ task = vdi.copyAsync(conn, sr);
+ // poll every 1 seconds , timeout after 2 hours
+ waitForTask(conn, task, 1000, wait * 1000);
+ checkForSuccess(conn, task);
+ VDI dvdi = Types.toVDI(task, conn);
+ return dvdi;
+ } finally {
+ if (task != null) {
+ try {
+ task.destroy(conn);
+ } catch (Exception e1) {
+ s_logger.warn("unable to destroy task(" + task.toString() + ") on host(" + _host.uuid + ") due to ", e1);
+ }
+ }
+ }
+ }
+
+ protected String callHostPluginAsync(Connection conn, String plugin, String cmd, int wait, String... params) {
+ int timeout = wait * 1000;
+ Map args = new HashMap();
+ Task task = null;
+ try {
+ for (int i = 0; i < params.length; i += 2) {
+ args.put(params[i], params[i + 1]);
+ }
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace("callHostPlugin executing for command " + cmd + " with " + getArgsString(args));
+ }
+ Host host = Host.getByUuid(conn, _host.uuid);
+ task = host.callPluginAsync(conn, plugin, cmd, args);
+ // poll every 1 seconds
+ waitForTask(conn, task, 1000, timeout);
+ checkForSuccess(conn, task);
+ String result = task.getResult(conn);
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace("callHostPlugin Result: " + result);
+ }
+ return result.replace("", "").replace("", "").replace("\n", "");
+ } catch (Types.HandleInvalid e) {
+ s_logger.warn("callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to HandleInvalid clazz:" + e.clazz + ", handle:" +
+ e.handle);
+ } catch (XenAPIException e) {
+ s_logger.warn("callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to " + e.toString(), e);
+ } catch (XmlRpcException e) {
+ s_logger.warn("callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to " + e.getMessage(), e);
+ } finally {
+ if (task != null) {
+ try {
+ task.destroy(conn);
+ } catch (Exception e1) {
+ s_logger.warn("unable to destroy task(" + task.toString() + ") on host(" + _host.uuid + ") due to ", e1);
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public StopAnswer execute(StopCommand cmd) {
+ String vmName = cmd.getVmName();
+ String platformstring = null;
+ try {
+ Connection conn = getConnection();
+ Set vms = VM.getByNameLabel(conn, vmName);
+ // stop vm which is running on this host or is in halted state
+ Iterator iter = vms.iterator();
+ while (iter.hasNext()) {
+ VM vm = iter.next();
+ VM.Record vmr = vm.getRecord(conn);
+ if (vmr.powerState != VmPowerState.RUNNING) {
+ continue;
+ }
+ if (isRefNull(vmr.residentOn)) {
+ continue;
+ }
+ if (vmr.residentOn.getUuid(conn).equals(_host.uuid)) {
+ continue;
+ }
+ iter.remove();
+ }
+
+ if (vms.size() == 0) {
+ synchronized (_cluster.intern()) {
+ s_logger.info("VM does not exist on XenServer" + _host.uuid);
+ s_vms.remove(_cluster, _name, vmName);
+ }
+ return new StopAnswer(cmd, "VM does not exist", true);
+ }
+ for (VM vm : vms) {
+ VM.Record vmr = vm.getRecord(conn);
+ platformstring = StringUtils.mapToString(vmr.platform);
+ if (vmr.isControlDomain) {
+ String msg = "Tring to Shutdown control domain";
+ s_logger.warn(msg);
+ return new StopAnswer(cmd, msg, false);
+ }
+
+ if (vmr.powerState == VmPowerState.RUNNING && !isRefNull(vmr.residentOn) && !vmr.residentOn.getUuid(conn).equals(_host.uuid)) {
+ String msg = "Stop Vm " + vmName + " failed due to this vm is not running on this host: " + _host.uuid + " but host:" + vmr.residentOn.getUuid(conn);
+ s_logger.warn(msg);
+ return new StopAnswer(cmd, msg, platformstring, false);
+ }
+
+ State state = s_vms.getState(_cluster, vmName);
+
+ synchronized (_cluster.intern()) {
+ s_vms.put(_cluster, _name, vmName, State.Stopping);
+ }
+ s_logger.debug("9. The VM " + vmName + " is in Stopping state");
+
+ try {
+ if (vmr.powerState == VmPowerState.RUNNING) {
+ /* when stop a vm, set affinity to current xenserver */
+ vm.setAffinity(conn, vm.getResidentOn(conn));
+
+ if (_canBridgeFirewall) {
+ String result = callHostPlugin(conn, "vmops", "destroy_network_rules_for_vm", "vmName", cmd.getVmName());
+ if (result == null || result.isEmpty() || !Boolean.parseBoolean(result)) {
+ s_logger.warn("Failed to remove network rules for vm " + cmd.getVmName());
+ } else {
+ s_logger.info("Removed network rules for vm " + cmd.getVmName());
+ }
+ }
+ shutdownVM(conn, vm, vmName);
+ }
+ } catch (Exception e) {
+ String msg = "Catch exception " + e.getClass().getName() + " when stop VM:" + cmd.getVmName() + " due to " + e.toString();
+ s_logger.debug(msg);
+ return new StopAnswer(cmd, msg, platformstring, false);
+ } finally {
+
+ try {
+ if (vm.getPowerState(conn) == VmPowerState.HALTED) {
+ Set vGPUs = null;
+ // Get updated GPU details
+ try {
+ vGPUs = vm.getVGPUs(conn);
+ } catch (XenAPIException e2) {
+ s_logger.debug("VM " + vmName + " does not have GPU support.");
+ }
+ if (vGPUs != null && !vGPUs.isEmpty()) {
+ HashMap> groupDetails = getGPUGroupDetails(conn);
+ cmd.setGpuDevice(new GPUDeviceTO(null, null, groupDetails));
+ }
+
+ Set vifs = vm.getVIFs(conn);
+ List networks = new ArrayList();
+ for (VIF vif : vifs) {
+ networks.add(vif.getNetwork(conn));
+ }
+ vm.destroy(conn);
+ state = State.Stopped;
+ SR sr = getISOSRbyVmName(conn, cmd.getVmName());
+ removeSR(conn, sr);
+ // Disable any VLAN networks that aren't used
+ // anymore
+ for (Network network : networks) {
+ try {
+ if (network.getNameLabel(conn).startsWith("VLAN")) {
+ disableVlanNetwork(conn, network);
+ }
+ } catch (Exception e) {
+ // network might be destroyed by other host
+ }
+ }
+ return new StopAnswer(cmd, "Stop VM " + vmName + " Succeed", platformstring, true);
+ }
+ } catch (Exception e) {
+ String msg = "VM destroy failed in Stop " + vmName + " Command due to " + e.getMessage();
+ s_logger.warn(msg, e);
+ } finally {
+ synchronized (_cluster.intern()) {
+ s_vms.put(_cluster, _name, vmName, state);
+ }
+ s_logger.debug("10. The VM " + vmName + " is in " + state + " state");
+ }
+ }
+ }
+
+ } catch (Exception e) {
+ String msg = "Stop Vm " + vmName + " fail due to " + e.toString();
+ s_logger.warn(msg, e);
+ return new StopAnswer(cmd, msg, platformstring, false);
+ }
+ return new StopAnswer(cmd, "Stop VM failed", platformstring, false);
+ }
+
+ private List getVdis(Connection conn, VM vm) {
+ List vdis = new ArrayList();
+ try {
+ Set vbds = vm.getVBDs(conn);
+ for (VBD vbd : vbds) {
+ vdis.add(vbd.getVDI(conn));
+ }
+ } catch (XenAPIException e) {
+ String msg = "getVdis can not get VPD due to " + e.toString();
+ s_logger.warn(msg, e);
+ } catch (XmlRpcException e) {
+ String msg = "getVdis can not get VPD due to " + e.getMessage();
+ s_logger.warn(msg, e);
+ }
+ return vdis;
+ }
+
+ protected String connect(Connection conn, final String vmName, final String ipAddress, final int port) {
+ for (int i = 0; i <= _retry; i++) {
+ try {
+ Set vms = VM.getByNameLabel(conn, vmName);
+ if (vms.size() < 1) {
+ String msg = "VM " + vmName + " is not running";
+ s_logger.warn(msg);
+ return msg;
+ }
+ } catch (Exception e) {
+ String msg = "VM.getByNameLabel " + vmName + " failed due to " + e.toString();
+ s_logger.warn(msg, e);
+ return msg;
+ }
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Trying to connect to " + ipAddress + " attempt " + i + " of " + _retry);
+ }
+ if (pingdomr(conn, ipAddress, Integer.toString(port))) {
+ return null;
+ }
+ try {
+ Thread.sleep(_sleep);
+ } catch (final InterruptedException e) {
+ }
+ }
+ String msg = "Timeout, Unable to logon to " + ipAddress;
+ s_logger.debug(msg);
+
+ return msg;
+ }
+
+ protected String connect(Connection conn, final String vmname, final String ipAddress) {
+ return connect(conn, vmname, ipAddress, 3922);
+ }
+
+ protected boolean isDeviceUsed(Connection conn, VM vm, Long deviceId) {
+ // Figure out the disk number to attach the VM to
+
+ String msg = null;
+ try {
+ Set allowedVBDDevices = vm.getAllowedVBDDevices(conn);
+ if (allowedVBDDevices.contains(deviceId.toString())) {
+ return false;
+ }
+ return true;
+ } catch (XmlRpcException e) {
+ msg = "Catch XmlRpcException due to: " + e.getMessage();
+ s_logger.warn(msg, e);
+ } catch (XenAPIException e) {
+ msg = "Catch XenAPIException due to: " + e.toString();
+ s_logger.warn(msg, e);
+ }
+ throw new CloudRuntimeException("When check deviceId " + msg);
+ }
+
+ protected String getUnusedDeviceNum(Connection conn, VM vm) {
+ // Figure out the disk number to attach the VM to
+ try {
+ Set allowedVBDDevices = vm.getAllowedVBDDevices(conn);
+ if (allowedVBDDevices.size() == 0) {
+ throw new CloudRuntimeException("Could not find an available slot in VM with name: " + vm.getNameLabel(conn) + " to attach a new disk.");
+ }
+ return allowedVBDDevices.iterator().next();
+ } catch (XmlRpcException e) {
+ String msg = "Catch XmlRpcException due to: " + e.getMessage();
+ s_logger.warn(msg, e);
+ } catch (XenAPIException e) {
+ String msg = "Catch XenAPIException due to: " + e.toString();
+ s_logger.warn(msg, e);
+ }
+ throw new CloudRuntimeException("Could not find an available slot in VM with name to attach a new disk.");
+ }
+
+ protected String callHostPlugin(Connection conn, String plugin, String cmd, String... params) {
+ Map args = new HashMap();
+ String msg;
+ try {
+ for (int i = 0; i < params.length; i += 2) {
+ args.put(params[i], params[i + 1]);
+ }
+
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace("callHostPlugin executing for command " + cmd + " with " + getArgsString(args));
+ }
+ Host host = Host.getByUuid(conn, _host.uuid);
+ String result = host.callPlugin(conn, plugin, cmd, args);
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace("callHostPlugin Result: " + result);
+ }
+ return result.replace("\n", "");
+ } catch (XenAPIException e) {
+ msg = "callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to " + e.toString();
+ s_logger.warn(msg);
+ } catch (XmlRpcException e) {
+ msg = "callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to " + e.getMessage();
+ s_logger.debug(msg);
+ }
+ throw new CloudRuntimeException(msg);
+ }
+
+ protected String getArgsString(Map args) {
+ StringBuilder argString = new StringBuilder();
+ for (Map.Entry arg : args.entrySet()) {
+ argString.append(arg.getKey() + ": " + arg.getValue() + ", ");
+ }
+ return argString.toString();
+ }
+
+ protected boolean setIptables(Connection conn) {
+ String result = callHostPlugin(conn, "vmops", "setIptables");
+ if (result == null || result.isEmpty()) {
+ return false;
+ }
+ return true;
+ }
+
+ protected XsLocalNetwork getManagementNetwork(Connection conn) throws XmlRpcException, XenAPIException {
+ PIF mgmtPif = null;
+ PIF.Record mgmtPifRec = null;
+ Host host = Host.getByUuid(conn, _host.uuid);
+ Set hostPifs = host.getPIFs(conn);
+ for (PIF pif : hostPifs) {
+ PIF.Record rec = pif.getRecord(conn);
+ if (rec.management) {
+ if (rec.VLAN != null && rec.VLAN != -1) {
+ String msg =
+ new StringBuilder("Unsupported configuration. Management network is on a VLAN. host=").append(_host.uuid)
+ .append("; pif=")
+ .append(rec.uuid)
+ .append("; vlan=")
+ .append(rec.VLAN)
+ .toString();
+ s_logger.warn(msg);
+ throw new CloudRuntimeException(msg);
+ }
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Management network is on pif=" + rec.uuid);
+ }
+ mgmtPif = pif;
+ mgmtPifRec = rec;
+ break;
+ }
+ }
+ if (mgmtPif == null) {
+ String msg = "Unable to find management network for " + _host.uuid;
+ s_logger.warn(msg);
+ throw new CloudRuntimeException(msg);
+ }
+ Bond bond = mgmtPifRec.bondSlaveOf;
+ if (!isRefNull(bond)) {
+ String msg =
+ "Management interface is on slave(" + mgmtPifRec.uuid + ") of bond(" + bond.getUuid(conn) + ") on host(" + _host.uuid +
+ "), please move management interface to bond!";
+ s_logger.warn(msg);
+ throw new CloudRuntimeException(msg);
+ }
+ Network nk = mgmtPifRec.network;
+ Network.Record nkRec = nk.getRecord(conn);
+ return new XsLocalNetwork(nk, nkRec, mgmtPif, mgmtPifRec);
+ }
+
+ protected VIF getCorrectVif(Connection conn, VM router, Network network) throws XmlRpcException, XenAPIException {
+ Set routerVIFs = router.getVIFs(conn);
+ for (VIF vif : routerVIFs) {
+ Network vifNetwork = vif.getNetwork(conn);
+ if (vifNetwork.getUuid(conn).equals(network.getUuid(conn))) {
+ return vif;
+ }
+ }
+
+ return null;
+ }
+
+ protected VIF getCorrectVif(Connection conn, VM router, IpAddressTO ip) throws XmlRpcException, XenAPIException {
+ NicTO nic = new NicTO();
+ nic.setType(ip.getTrafficType());
+ nic.setName(ip.getNetworkName());
+ if (ip.getBroadcastUri() == null) {
+ nic.setBroadcastType(BroadcastDomainType.Native);
+ } else {
+ URI uri = BroadcastDomainType.fromString(ip.getBroadcastUri());
+ nic.setBroadcastType(BroadcastDomainType.getSchemeValue(uri));
+ nic.setBroadcastUri(uri);
+ }
+ Network network = getNetwork(conn, nic);
+ // Determine the correct VIF on DomR to associate/disassociate the
+ // IP address with
+ Set routerVIFs = router.getVIFs(conn);
+ for (VIF vif : routerVIFs) {
+ Network vifNetwork = vif.getNetwork(conn);
+ if (vifNetwork.getUuid(conn).equals(network.getUuid(conn))) {
+ return vif;
+ }
+ }
+ return null;
+ }
+
+ protected VIF getVifByMac(Connection conn, VM router, String mac) throws XmlRpcException, XenAPIException {
+ Set routerVIFs = router.getVIFs(conn);
+ mac = mac.trim();
+ for (VIF vif : routerVIFs) {
+ String lmac = vif.getMAC(conn);
+ if (lmac.trim().equals(mac)) {
+ return vif;
+ }
+ }
+ return null;
+ }
+
+ protected String getLowestAvailableVIFDeviceNum(Connection conn, VM vm) {
+ String vmName = "";
+ try {
+ vmName = vm.getNameLabel(conn);
+ List usedDeviceNums = new ArrayList();
+ Set vifs = vm.getVIFs(conn);
+ Iterator vifIter = vifs.iterator();
+ while (vifIter.hasNext()) {
+ VIF vif = vifIter.next();
+ try {
+ usedDeviceNums.add(Integer.valueOf(vif.getDevice(conn)));
+ } catch (NumberFormatException e) {
+ String msg = "Obtained an invalid value for an allocated VIF device number for VM: " + vmName;
+ s_logger.debug(msg, e);
+ throw new CloudRuntimeException(msg);
+ }
+ }
+
+ for (Integer i = 0; i < _maxNics; i++) {
+ if (!usedDeviceNums.contains(i)) {
+ s_logger.debug("Lowest available Vif device number: " + i + " for VM: " + vmName);
+ return i.toString();
+ }
+ }
+ } catch (XmlRpcException e) {
+ String msg = "Caught XmlRpcException: " + e.getMessage();
+ s_logger.warn(msg, e);
+ } catch (XenAPIException e) {
+ String msg = "Caught XenAPIException: " + e.toString();
+ s_logger.warn(msg, e);
+ }
+
+ throw new CloudRuntimeException("Could not find available VIF slot in VM with name: " + vmName);
+ }
+
+ protected VDI mount(Connection conn, StoragePoolType poolType, String volumeFolder, String volumePath) {
+ return getVDIbyUuid(conn, volumePath);
+ }
+
+ /**
+ * getNetworkByName() retrieves what the server thinks is the actual
+ * network used by the XenServer host. This method should always be
+ * used to talk to retrieve a network by the name. The reason is
+ * because of the problems in using the name label as the way to find
+ * the Network.
+ *
+ * To see how we are working around these problems, take a look at
+ * enableVlanNetwork(). The following description assumes you have looked
+ * at the description on that method.
+ *
+ * In order to understand this, we have to see what type of networks are
+ * within a XenServer that's under CloudStack control.
+ *
+ * - Native Networks: these are networks that are untagged on the
+ * XenServer and are used to crate VLAN networks on. These are
+ * created by the user and is assumed to be one per cluster.
+ * - VLAN Networks: these are dynamically created by CloudStack and can
+ * have problems with duplicated names.
+ * - LinkLocal Networks: these are dynamically created by CloudStack and
+ * can also have problems with duplicated names but these don't have
+ * actual PIFs.
+ *
+ * In order to speed to retrieval of a network, we do the following:
+ * - We retrieve by the name. If only one network is retrieved, we
+ * assume we retrieved the right network.
+ * - If more than one network is retrieved, we check to see which one
+ * has the pif for the local host and use that.
+ * - If a pif is not found, then we look at the tags and find the
+ * one with the lowest timestamp. (See enableVlanNetwork())
+ *
+ * @param conn Xapi connection
+ * @param name name of the network
+ * @return XsNic an object that contains network, network record, pif, and pif record.
+ * @throws XenAPIException
+ * @throws XmlRpcException
+ *
+ * @see CitrixResourceBase#enableVlanNetwork
+ */
+ protected XsLocalNetwork getNetworkByName(Connection conn, String name) throws XenAPIException, XmlRpcException {
+ Set networks = Network.getByNameLabel(conn, name);
+ if (networks.size() == 1) {
+ return new XsLocalNetwork(networks.iterator().next(), null, null, null);
+ }
+
+ if (networks.size() == 0) {
+ return null;
+ }
+
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Found more than one network with the name " + name);
+ }
+ Network earliestNetwork = null;
+ Network.Record earliestNetworkRecord = null;
+ long earliestTimestamp = Long.MAX_VALUE;
+ int earliestRandom = Integer.MAX_VALUE;
+ for (Network network : networks) {
+ XsLocalNetwork nic = new XsLocalNetwork(network);
+
+ if (nic.getPif(conn) != null) {
+ return nic;
+ }
+
+ Network.Record record = network.getRecord(conn);
+ if (record.tags != null) {
+ for (String tag : record.tags) {
+ Pair stamp = parseTimestamp(tag);
+ if (stamp == null) {
+ continue;
+ }
+
+ if (stamp.first() < earliestTimestamp || (stamp.first() == earliestTimestamp && stamp.second() < earliestRandom)) {
+ earliestTimestamp = stamp.first();
+ earliestRandom = stamp.second();
+ earliestNetwork = network;
+ earliestNetworkRecord = record;
+ }
+ }
+ }
+ }
+
+ return earliestNetwork != null ? new XsLocalNetwork(earliestNetwork, earliestNetworkRecord, null, null) : null;
+ }
+
+ protected String generateTimeStamp() {
+ return new StringBuilder("CsCreateTime-").append(System.currentTimeMillis()).append("-").append(Rand.nextInt(Integer.MAX_VALUE)).toString();
+ }
+
+ protected Pair parseTimestamp(String timeStampStr) {
+ String[] tokens = timeStampStr.split("-");
+ if (tokens.length != 3) {
+ s_logger.debug("timeStamp in network has wrong pattern: " + timeStampStr);
+ return null;
+ }
+ if (!tokens[0].equals("CsCreateTime")) {
+ s_logger.debug("timeStamp in network doesn't start with CsCreateTime: " + timeStampStr);
+ return null;
+ }
+ return new Pair(Long.parseLong(tokens[1]), Integer.parseInt(tokens[2]));
+ }
+
+ /**
+ * enableVlanNetwork creates a Network object, Vlan object, and thereby
+ * a tagged PIF object in Xapi.
+ *
+ * In XenServer, VLAN is added by
+ * - Create a network, which is unique cluster wide.
+ * - Find the PIF that you want to create the VLAN on.
+ * - Create a VLAN using the network and the PIF. As a result of this
+ * operation, a tagged PIF object is also created.
+ *
+ * Here is a list of problems with clustered Xapi implementation that
+ * we are trying to circumvent.
+ * - There can be multiple Networks with the same name-label so searching
+ * using name-label is not unique.
+ * - There are no other ways to search for Networks other than listing
+ * all of them which is not efficient in our implementation because
+ * we can have over 4000 VLAN networks.
+ * - In a clustered situation, it's possible for both hosts to detect
+ * that the Network is missing and both creates it. This causes a
+ * lot of problems as one host may be using one Network and another
+ * may be using a different network for their VMs. This causes
+ * problems in migration because the VMs are logically attached
+ * to different networks in Xapi's database but in reality, they
+ * are attached to the same network.
+ *
+ * To work around these problems, we do the following.
+ *
+ * - When creating the VLAN network, we name it as VLAN-UUID of the
+ * Network it is created on-VLAN Tag. Because VLAN tags is unique with
+ * one particular network, this is a unique name-label to quickly
+ * retrieve the the VLAN network with when we need it again.
+ * - When we create the VLAN network, we add a timestamp and a random
+ * number as a tag into the network. Then instead of creating
+ * VLAN on that network, we actually retrieve the Network again
+ * and this time uses the VLAN network with lowest timestamp or
+ * lowest random number as the VLAN network. This allows VLAN creation
+ * to happen on multiple hosts concurrently but even if two VLAN
+ * networks were created with the same name, only one of them is used.
+ *
+ * One cavaet about this approach is that it relies on the timestamp to
+ * be relatively accurate among different hosts.
+ *
+ * @param conn Xapi Connection
+ * @param tag VLAN tag
+ * @param network network on this host to create the VLAN on.
+ * @return VLAN Network created.
+ * @throws XenAPIException
+ * @throws XmlRpcException
+ */
+ protected Network enableVlanNetwork(Connection conn, long tag, XsLocalNetwork network) throws XenAPIException, XmlRpcException {
+ Network vlanNetwork = null;
+ String oldName = "VLAN" + Long.toString(tag);
+ String newName = "VLAN-" + network.getNetworkRecord(conn).uuid + "-" + tag;
+ XsLocalNetwork vlanNic = getNetworkByName(conn, newName);
+ if (vlanNic == null) {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Couldn't find vlan network with the new name so trying old name: " + oldName);
+ }
+ vlanNic = getNetworkByName(conn, oldName);
+ if (vlanNic != null) {
+ s_logger.info("Renaming VLAN with old name " + oldName + " to " + newName);
+ vlanNic.getNetwork().setNameLabel(conn, newName);
+ }
+ }
+ if (vlanNic == null) { // Can't find it, then create it.
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Creating VLAN network for " + tag + " on host " + _host.ip);
+ }
+ Network.Record nwr = new Network.Record();
+ nwr.nameLabel = newName;
+ nwr.tags = new HashSet();
+ nwr.tags.add(generateTimeStamp());
+ vlanNetwork = Network.create(conn, nwr);
+ vlanNic = getNetworkByName(conn, newName);
+ }
+
+ PIF nPif = network.getPif(conn);
+ PIF.Record nPifr = network.getPifRecord(conn);
+
+ vlanNetwork = vlanNic.getNetwork();
+ if (vlanNic.getPif(conn) != null) {
+ return vlanNetwork;
+ }
+
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Creating VLAN " + tag + " on host " + _host.ip + " on device " + nPifr.device);
+ }
+ VLAN vlan = VLAN.create(conn, nPif, tag, vlanNetwork);
+ VLAN.Record vlanr = vlan.getRecord(conn);
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("VLAN is created for " + tag + ". The uuid is " + vlanr.uuid);
+ }
+
+ return vlanNetwork;
+ }
+
+ protected void disableVlanNetwork(Connection conn, Network network) {
+ }
+
+ protected SR getLocalLVMSR(Connection conn) {
+ try {
+ Map map = SR.getAllRecords(conn);
+ for (Map.Entry entry : map.entrySet()) {
+ SR.Record srRec = entry.getValue();
+ if (SRType.LVM.equals(srRec.type)) {
+ Set pbds = srRec.PBDs;
+ if (pbds == null) {
+ continue;
+ }
+ for (PBD pbd : pbds) {
+ Host host = pbd.getHost(conn);
+ if (!isRefNull(host) && host.getUuid(conn).equals(_host.uuid)) {
+ if (!pbd.getCurrentlyAttached(conn)) {
+ pbd.plug(conn);
+ }
+ SR sr = entry.getKey();
+ sr.scan(conn);
+ return sr;
+ }
+ }
+ }
+ }
+ } catch (XenAPIException e) {
+ String msg = "Unable to get local LVMSR in host:" + _host.uuid + e.toString();
+ s_logger.warn(msg);
+ } catch (XmlRpcException e) {
+ String msg = "Unable to get local LVMSR in host:" + _host.uuid + e.getCause();
+ s_logger.warn(msg);
+ }
+ return null;
+ }
+
+ protected SR getLocalEXTSR(Connection conn) {
+ try {
+ Map map = SR.getAllRecords(conn);
+ for (Map.Entry entry : map.entrySet()) {
+ SR.Record srRec = entry.getValue();
+ if (SRType.FILE.equals(srRec.type) || SRType.EXT.equals(srRec.type)) {
+ Set pbds = srRec.PBDs;
+ if (pbds == null) {
+ continue;
+ }
+ for (PBD pbd : pbds) {
+ Host host = pbd.getHost(conn);
+ if (!isRefNull(host) && host.getUuid(conn).equals(_host.uuid)) {
+ if (!pbd.getCurrentlyAttached(conn)) {
+ pbd.plug(conn);
+ }
+ SR sr = entry.getKey();
+ sr.scan(conn);
+ return sr;
+ }
+ }
+ }
+ }
+ } catch (XenAPIException e) {
+ String msg = "Unable to get local EXTSR in host:" + _host.uuid + e.toString();
+ s_logger.warn(msg);
+ } catch (XmlRpcException e) {
+ String msg = "Unable to get local EXTSR in host:" + _host.uuid + e.getCause();
+ s_logger.warn(msg);
+ }
+ return null;
+ }
+
+ protected StartupStorageCommand initializeLocalSR(Connection conn) {
+ SR lvmsr = getLocalLVMSR(conn);
+ if (lvmsr != null) {
+ try {
+ _host.localSRuuid = lvmsr.getUuid(conn);
+
+ String lvmuuid = lvmsr.getUuid(conn);
+ long cap = lvmsr.getPhysicalSize(conn);
+ if (cap > 0) {
+ long avail = cap - lvmsr.getPhysicalUtilisation(conn);
+ lvmsr.setNameLabel(conn, lvmuuid);
+ String name = "Cloud Stack Local LVM Storage Pool for " + _host.uuid;
+ lvmsr.setNameDescription(conn, name);
+ Host host = Host.getByUuid(conn, _host.uuid);
+ String address = host.getAddress(conn);
+ StoragePoolInfo pInfo = new StoragePoolInfo(lvmuuid, address, SRType.LVM.toString(), SRType.LVM.toString(), StoragePoolType.LVM, cap, avail);
+ StartupStorageCommand cmd = new StartupStorageCommand();
+ cmd.setPoolInfo(pInfo);
+ cmd.setGuid(_host.uuid);
+ cmd.setDataCenter(Long.toString(_dcId));
+ cmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL);
+ return cmd;
+ }
+ } catch (XenAPIException e) {
+ String msg = "build local LVM info err in host:" + _host.uuid + e.toString();
+ s_logger.warn(msg);
+ } catch (XmlRpcException e) {
+ String msg = "build local LVM info err in host:" + _host.uuid + e.getMessage();
+ s_logger.warn(msg);
+ }
+ }
+
+ SR extsr = getLocalEXTSR(conn);
+ if (extsr != null) {
+ try {
+ String extuuid = extsr.getUuid(conn);
+ _host.localSRuuid = extuuid;
+ long cap = extsr.getPhysicalSize(conn);
+ if (cap > 0) {
+ long avail = cap - extsr.getPhysicalUtilisation(conn);
+ extsr.setNameLabel(conn, extuuid);
+ String name = "Cloud Stack Local EXT Storage Pool for " + _host.uuid;
+ extsr.setNameDescription(conn, name);
+ Host host = Host.getByUuid(conn, _host.uuid);
+ String address = host.getAddress(conn);
+ StoragePoolInfo pInfo = new StoragePoolInfo(extuuid, address, SRType.EXT.toString(), SRType.EXT.toString(), StoragePoolType.EXT, cap, avail);
+ StartupStorageCommand cmd = new StartupStorageCommand();
+ cmd.setPoolInfo(pInfo);
+ cmd.setGuid(_host.uuid);
+ cmd.setDataCenter(Long.toString(_dcId));
+ cmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL);
+ return cmd;
+ }
+ } catch (XenAPIException e) {
+ String msg = "build local EXT info err in host:" + _host.uuid + e.toString();
+ s_logger.warn(msg);
+ } catch (XmlRpcException e) {
+ String msg = "build local EXT info err in host:" + _host.uuid + e.getMessage();
+ s_logger.warn(msg);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public PingCommand getCurrentStatus(long id) {
+ try {
+ if (!pingXAPI()) {
+ Thread.sleep(1000);
+ if (!pingXAPI()) {
+ s_logger.warn(" can not ping xenserver " + _host.uuid);
+ return null;
+ }
+ }
+ Connection conn = getConnection();
+ if (!_canBridgeFirewall && !_isOvs) {
+ return new PingRoutingCommand(getType(), id, null, getHostVmStateReport(conn));
+ } else if (_isOvs) {
+ List> ovsStates = ovsFullSyncStates();
+ return new PingRoutingWithOvsCommand(getType(), id, null, getHostVmStateReport(conn), ovsStates);
+ } else {
+ HashMap> nwGrpStates = syncNetworkGroups(conn, id);
+ return new PingRoutingWithNwGroupsCommand(getType(), id, null, getHostVmStateReport(conn), nwGrpStates);
+ }
+ } catch (Exception e) {
+ s_logger.warn("Unable to get current status", e);
+ return null;
+ }
+ }
+
+ private HashMap> syncNetworkGroups(Connection conn, long id) {
+ HashMap> states = new HashMap>();
+
+ String result = callHostPlugin(conn, "vmops", "get_rule_logs_for_vms", "host_uuid", _host.uuid);
+ s_logger.trace("syncNetworkGroups: id=" + id + " got: " + result);
+ String[] rulelogs = result != null ? result.split(";") : new String[0];
+ for (String rulesforvm : rulelogs) {
+ String[] log = rulesforvm.split(",");
+ if (log.length != 6) {
+ continue;
+ }
+ //output = ','.join([vmName, vmID, vmIP, domID, signature, seqno])
+ try {
+ states.put(log[0], new Pair(Long.parseLong(log[1]), Long.parseLong(log[5])));
+ } catch (NumberFormatException nfe) {
+ states.put(log[0], new Pair(-1L, -1L));
+ }
+ }
+ return states;
+ }
+
+ @Override
+ public Type getType() {
+ return com.cloud.host.Host.Type.Routing;
+ }
+
+ protected boolean getHostInfo(Connection conn) throws IllegalArgumentException {
+ try {
+ Host myself = Host.getByUuid(conn, _host.uuid);
+ Set hcs = null;
+ for (int i = 0; i < 10; i++) {
+ hcs = myself.getHostCPUs(conn);
+ _host.cpus = hcs.size();
+ if (_host.cpus > 0) {
+ break;
+ }
+ Thread.sleep(5000);
+ }
+ if (_host.cpus <= 0) {
+ throw new CloudRuntimeException("Cannot get the numbers of cpu from XenServer host " + _host.ip);
+ }
+ Map cpuInfo = myself.getCpuInfo(conn);
+ if (cpuInfo.get("socket_count") != null) {
+ _host.cpuSockets = Integer.parseInt(cpuInfo.get("socket_count"));
+ }
+ for (final HostCpu hc : hcs) {
+ _host.speed = hc.getSpeed(conn).intValue();
+ break;
+ }
+ Host.Record hr = myself.getRecord(conn);
+ _host.productVersion = hr.softwareVersion.get("product_version");
+ if (_host.productVersion == null) {
+ _host.productVersion = hr.softwareVersion.get("platform_version");
+ } else {
+ _host.productVersion = _host.productVersion.trim();
+ }
+
+ XsLocalNetwork privateNic = getManagementNetwork(conn);
+ _privateNetworkName = privateNic.getNetworkRecord(conn).nameLabel;
+ _host.privatePif = privateNic.getPifRecord(conn).uuid;
+ _host.privateNetwork = privateNic.getNetworkRecord(conn).uuid;
+ _host.systemvmisouuid = null;
+
+ XsLocalNetwork guestNic = null;
+ if (_guestNetworkName != null && !_guestNetworkName.equals(_privateNetworkName)) {
+ guestNic = getNetworkByName(conn, _guestNetworkName);
+ if (guestNic == null) {
+ s_logger.warn("Unable to find guest network " + _guestNetworkName);
+ throw new IllegalArgumentException("Unable to find guest network " + _guestNetworkName + " for host " + _host.ip);
+ }
+ } else {
+ guestNic = privateNic;
+ _guestNetworkName = _privateNetworkName;
+ }
+ _host.guestNetwork = guestNic.getNetworkRecord(conn).uuid;
+ _host.guestPif = guestNic.getPifRecord(conn).uuid;
+
+ XsLocalNetwork publicNic = null;
+ if (_publicNetworkName != null && !_publicNetworkName.equals(_guestNetworkName)) {
+ publicNic = getNetworkByName(conn, _publicNetworkName);
+ if (publicNic == null) {
+ s_logger.warn("Unable to find public network " + _publicNetworkName + " for host " + _host.ip);
+ throw new IllegalArgumentException("Unable to find public network " + _publicNetworkName + " for host " + _host.ip);
+ }
+ } else {
+ publicNic = guestNic;
+ _publicNetworkName = _guestNetworkName;
+ }
+ _host.publicPif = publicNic.getPifRecord(conn).uuid;
+ _host.publicNetwork = publicNic.getNetworkRecord(conn).uuid;
+ if (_storageNetworkName1 == null) {
+ _storageNetworkName1 = _guestNetworkName;
+ }
+ XsLocalNetwork storageNic1 = null;
+ storageNic1 = getNetworkByName(conn, _storageNetworkName1);
+ if (storageNic1 == null) {
+ s_logger.warn("Unable to find storage network " + _storageNetworkName1 + " for host " + _host.ip);
+ throw new IllegalArgumentException("Unable to find storage network " + _storageNetworkName1 + " for host " + _host.ip);
+ } else {
+ _host.storageNetwork1 = storageNic1.getNetworkRecord(conn).uuid;
+ _host.storagePif1 = storageNic1.getPifRecord(conn).uuid;
+ }
+
+ XsLocalNetwork storageNic2 = null;
+ if (_storageNetworkName2 != null) {
+ storageNic2 = getNetworkByName(conn, _storageNetworkName2);
+ _host.storageNetwork2 = storageNic2.getNetworkRecord(conn).uuid;
+ _host.storagePif2 = storageNic2.getPifRecord(conn).uuid;
+ }
+
+ s_logger.info("Private Network is " + _privateNetworkName + " for host " + _host.ip);
+ s_logger.info("Guest Network is " + _guestNetworkName + " for host " + _host.ip);
+ s_logger.info("Public Network is " + _publicNetworkName + " for host " + _host.ip);
+
+ return true;
+ } catch (XenAPIException e) {
+ s_logger.warn("Unable to get host information for " + _host.ip, e);
+ return false;
+ } catch (Exception e) {
+ s_logger.warn("Unable to get host information for " + _host.ip, e);
+ return false;
+ }
+ }
+
+ protected void plugDom0Vif(Connection conn, VIF dom0Vif) throws XmlRpcException, XenAPIException {
+ if (dom0Vif != null) {
+ dom0Vif.plug(conn);
+ }
+ }
+
+ private void setupLinkLocalNetwork(Connection conn) {
+ try {
+ Network.Record rec = new Network.Record();
+ Set networks = Network.getByNameLabel(conn, _linkLocalPrivateNetworkName);
+ Network linkLocal = null;
+
+ if (networks.size() == 0) {
+ rec.nameDescription = "link local network used by system vms";
+ rec.nameLabel = _linkLocalPrivateNetworkName;
+ Map configs = new HashMap();
+ configs.put("ip_begin", NetUtils.getLinkLocalGateway());
+ configs.put("ip_end", NetUtils.getLinkLocalIpEnd());
+ configs.put("netmask", NetUtils.getLinkLocalNetMask());
+ rec.otherConfig = configs;
+ linkLocal = Network.create(conn, rec);
+
+ } else {
+ linkLocal = networks.iterator().next();
+ }
+
+ /* Make sure there is a physical bridge on this network */
+ VIF dom0vif = null;
+ Pair vm = getControlDomain(conn);
+ VM dom0 = vm.first();
+ Set vifs = dom0.getVIFs(conn);
+ if (vifs.size() != 0) {
+ for (VIF vif : vifs) {
+ Map otherConfig = vif.getOtherConfig(conn);
+ if (otherConfig != null) {
+ String nameLabel = otherConfig.get("nameLabel");
+ if ((nameLabel != null) && nameLabel.equalsIgnoreCase("link_local_network_vif")) {
+ dom0vif = vif;
+ }
+ }
+ }
+ }
+
+ /* create temp VIF0 */
+ if (dom0vif == null) {
+ s_logger.debug("Can't find a vif on dom0 for link local, creating a new one");
+ VIF.Record vifr = new VIF.Record();
+ vifr.VM = dom0;
+ vifr.device = getLowestAvailableVIFDeviceNum(conn, dom0);
+ if (vifr.device == null) {
+ s_logger.debug("Failed to create link local network, no vif available");
+ return;
+ }
+ Map config = new HashMap();
+ config.put("nameLabel", "link_local_network_vif");
+ vifr.otherConfig = config;
+ vifr.MAC = "FE:FF:FF:FF:FF:FF";
+ vifr.network = linkLocal;
+ vifr.lockingMode = Types.VifLockingMode.NETWORK_DEFAULT;
+ dom0vif = VIF.create(conn, vifr);
+ plugDom0Vif(conn, dom0vif);
+ } else {
+ s_logger.debug("already have a vif on dom0 for link local network");
+ if (!dom0vif.getCurrentlyAttached(conn)) {
+ plugDom0Vif(conn, dom0vif);
+ }
+ }
+
+ String brName = linkLocal.getBridge(conn);
+ callHostPlugin(conn, "vmops", "setLinkLocalIP", "brName", brName);
+ _host.linkLocalNetwork = linkLocal.getUuid(conn);
+
+ } catch (XenAPIException e) {
+ s_logger.warn("Unable to create local link network", e);
+ throw new CloudRuntimeException("Unable to create local link network due to " + e.toString(), e);
+ } catch (XmlRpcException e) {
+ s_logger.warn("Unable to create local link network", e);
+ throw new CloudRuntimeException("Unable to create local link network due to " + e.toString(), e);
+ }
+ }
+
+ protected boolean transferManagementNetwork(Connection conn, Host host, PIF src, PIF.Record spr, PIF dest) throws XmlRpcException, XenAPIException {
+ dest.reconfigureIp(conn, spr.ipConfigurationMode, spr.IP, spr.netmask, spr.gateway, spr.DNS);
+ Host.managementReconfigure(conn, dest);
+ String hostUuid = null;
+ int count = 0;
+ while (count < 10) {
+ try {
+ Thread.sleep(10000);
+ hostUuid = host.getUuid(conn);
+ if (hostUuid != null) {
+ break;
+ }
+ } catch (XmlRpcException e) {
+ s_logger.debug("Waiting for host to come back: " + e.getMessage());
+ } catch (XenAPIException e) {
+ s_logger.debug("Waiting for host to come back: " + e.getMessage());
+ } catch (InterruptedException e) {
+ s_logger.debug("Gotta run");
+ return false;
+ }
+ }
+ if (hostUuid == null) {
+ s_logger.warn("Unable to transfer the management network from " + spr.uuid);
+ return false;
+ }
+
+ src.reconfigureIp(conn, Types.IpConfigurationMode.NONE, null, null, null, null);
+ return true;
+ }
+
+ @Override
+ public StartupCommand[] initialize() throws IllegalArgumentException {
+ Connection conn = getConnection();
+ if (!getHostInfo(conn)) {
+ s_logger.warn("Unable to get host information for " + _host.ip);
+ return null;
+ }
+ StartupRoutingCommand cmd = new StartupRoutingCommand();
+ fillHostInfo(conn, cmd);
+ cmd.setHypervisorType(HypervisorType.XenServer);
+ cmd.setCluster(_cluster);
+ cmd.setPoolSync(false);
+ cmd.setHostVmStateReport(getHostVmStateReport(conn));
+
+ Pool pool;
+ try {
+ pool = Pool.getByUuid(conn, _host.pool);
+ Pool.Record poolr = pool.getRecord(conn);
+
+ Host.Record hostr = poolr.master.getRecord(conn);
+ if (_host.uuid.equals(hostr.uuid)) {
+ HashMap> allStates = fullClusterSync(conn);
+ cmd.setClusterVMStateChanges(allStates);
+ }
+ } catch (Throwable e) {
+ s_logger.warn("Check for master failed, failing the FULL Cluster sync command");
+ }
+
+ StartupStorageCommand sscmd = initializeLocalSR(conn);
+ if (sscmd != null) {
+ return new StartupCommand[] {cmd, sscmd};
+ }
+ return new StartupCommand[] {cmd};
+ }
+
+ private void cleanupTemplateSR(Connection conn) {
+ Set pbds = null;
+ try {
+ Host host = Host.getByUuid(conn, _host.uuid);
+ pbds = host.getPBDs(conn);
+ } catch (XenAPIException e) {
+ s_logger.warn("Unable to get the SRs " + e.toString(), e);
+ throw new CloudRuntimeException("Unable to get SRs " + e.toString(), e);
+ } catch (Exception e) {
+ throw new CloudRuntimeException("Unable to get SRs " + e.getMessage(), e);
+ }
+ for (PBD pbd : pbds) {
+ SR sr = null;
+ SR.Record srRec = null;
+ try {
+ sr = pbd.getSR(conn);
+ srRec = sr.getRecord(conn);
+ } catch (Exception e) {
+ s_logger.warn("pbd.getSR get Exception due to ", e);
+ continue;
+ }
+ String type = srRec.type;
+ if (srRec.shared) {
+ continue;
+ }
+ if (SRType.NFS.equals(type) || (SRType.ISO.equals(type) && srRec.nameDescription.contains("template"))) {
+ try {
+ pbd.unplug(conn);
+ pbd.destroy(conn);
+ sr.forget(conn);
+ } catch (Exception e) {
+ s_logger.warn("forget SR catch Exception due to ", e);
+ }
+ }
+ }
+ }
+
+ protected boolean launchHeartBeat(Connection conn) {
+ String result = callHostPluginPremium(conn, "heartbeat", "host", _host.uuid, "interval", Integer
+ .toString(_heartbeatInterval));
+ if (result == null || !result.contains("> DONE <")) {
+ s_logger.warn("Unable to launch the heartbeat process on " + _host.ip);
+ return false;
+ }
+ return true;
+ }
+
+ protected SetupAnswer execute(SetupCommand cmd) {
+ Connection conn = getConnection();
+ setupServer(conn);
+ try {
+ if (!setIptables(conn)) {
+ s_logger.warn("set xenserver Iptable failed");
+ return null;
+ }
+
+ if (_securityGroupEnabled) {
+ _canBridgeFirewall = can_bridge_firewall(conn);
+ if (!_canBridgeFirewall) {
+ String msg = "Failed to configure brige firewall";
+ s_logger.warn(msg);
+ s_logger.warn("Check host " + _host.ip +" for CSP is installed or not and check network mode for bridge");
+ return new SetupAnswer(cmd, msg);
+ }
+
+ }
+
+
+ boolean r = launchHeartBeat(conn);
+ if (!r) {
+ return null;
+ }
+ cleanupTemplateSR(conn);
+ Host host = Host.getByUuid(conn, _host.uuid);
+ try {
+ if (cmd.useMultipath()) {
+ // the config value is set to true
+ host.addToOtherConfig(conn, "multipathing", "true");
+ host.addToOtherConfig(conn, "multipathhandle", "dmp");
+ }
+
+ } catch (Types.MapDuplicateKey e) {
+ s_logger.debug("multipath is already set");
+ }
+
+ if (cmd.needSetup() ) {
+ String result = callHostPlugin(conn, "vmops", "setup_iscsi", "uuid", _host.uuid);
+
+ if (!result.contains("> DONE <")) {
+ s_logger.warn("Unable to setup iscsi: " + result);
+ return new SetupAnswer(cmd, result);
+ }
+
+ Pair mgmtPif = null;
+ Set hostPifs = host.getPIFs(conn);
+ for (PIF pif : hostPifs) {
+ PIF.Record rec = pif.getRecord(conn);
+ if (rec.management) {
+ if (rec.VLAN != null && rec.VLAN != -1) {
+ String msg =
+ new StringBuilder("Unsupported configuration. Management network is on a VLAN. host=").append(_host.uuid)
+ .append("; pif=")
+ .append(rec.uuid)
+ .append("; vlan=")
+ .append(rec.VLAN)
+ .toString();
+ s_logger.warn(msg);
+ return new SetupAnswer(cmd, msg);
+ }
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Management network is on pif=" + rec.uuid);
+ }
+ mgmtPif = new Pair(pif, rec);
+ break;
+ }
+ }
+
+ if (mgmtPif == null) {
+ String msg = "Unable to find management network for " + _host.uuid;
+ s_logger.warn(msg);
+ return new SetupAnswer(cmd, msg);
+ }
+
+ Map networks = Network.getAllRecords(conn);
+ for (Network.Record network : networks.values()) {
+ if (network.nameLabel.equals("cloud-private")) {
+ for (PIF pif : network.PIFs) {
+ PIF.Record pr = pif.getRecord(conn);
+ if (_host.uuid.equals(pr.host.getUuid(conn))) {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("Found a network called cloud-private. host=" + _host.uuid + "; Network=" + network.uuid + "; pif=" + pr.uuid);
+ }
+ if (pr.VLAN != null && pr.VLAN != -1) {
+ String msg =
+ new StringBuilder("Unsupported configuration. Network cloud-private is on a VLAN. Network=").append(network.uuid)
+ .append(" ; pif=")
+ .append(pr.uuid)
+ .toString();
+ s_logger.warn(msg);
+ return new SetupAnswer(cmd, msg);
+ }
+ if (!pr.management && pr.bondMasterOf != null && pr.bondMasterOf.size() > 0) {
+ if (pr.bondMasterOf.size() > 1) {
+ String msg =
+ new StringBuilder("Unsupported configuration. Network cloud-private has more than one bond. Network=").append(network.uuid)
+ .append("; pif=")
+ .append(pr.uuid)
+ .toString();
+ s_logger.warn(msg);
+ return new SetupAnswer(cmd, msg);
+ }
+ Bond bond = pr.bondMasterOf.iterator().next();
+ Set slaves = bond.getSlaves(conn);
+ for (PIF slave : slaves) {
+ PIF.Record spr = slave.getRecord(conn);
+ if (spr.management) {
+ if (!transferManagementNetwork(conn, host, slave, spr, pif)) {
+ String msg =
+ new StringBuilder("Unable to transfer management network. slave=" + spr.uuid + "; master=" + pr.uuid + "; host=" +
+ _host.uuid).toString();
+ s_logger.warn(msg);
+ return new SetupAnswer(cmd, msg);
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return new SetupAnswer(cmd, false);
+
+ } catch (XmlRpcException e) {
+ s_logger.warn("Unable to setup", e);
+ return new SetupAnswer(cmd, e.getMessage());
+ } catch (XenAPIException e) {
+ s_logger.warn("Unable to setup", e);
+ return new SetupAnswer(cmd, e.getMessage());
+ } catch (Exception e) {
+ s_logger.warn("Unable to setup", e);
+ return new SetupAnswer(cmd, e.getMessage());
+ }
+ }
+
+ /* return : if setup is needed */
+ protected boolean setupServer(Connection conn) {
+ String packageVersion = CitrixResourceBase.class.getPackage().getImplementationVersion();
+ String version = this.getClass().getName() + "-" + (packageVersion == null ? Long.toString(System.currentTimeMillis()) : packageVersion);
+
+ try {
+ Host host = Host.getByUuid(conn, _host.uuid);
+ /* enable host in case it is disabled somehow */
+ host.enable(conn);
+ /* push patches to XenServer */
+ Host.Record hr = host.getRecord(conn);
+
+ Iterator it = hr.tags.iterator();
+
+ while (it.hasNext()) {
+ String tag = it.next();
+ if (tag.startsWith("vmops-version-")) {
+ if (tag.contains(version)) {
+ s_logger.info(logX(host, "Host " + hr.address + " is already setup."));
+ return false;
+ } else {
+ it.remove();
+ }
+ }
+ }
+
+ com.trilead.ssh2.Connection sshConnection = new com.trilead.ssh2.Connection(hr.address, 22);
+ try {
+ sshConnection.connect(null, 60000, 60000);
+ if (!sshConnection.authenticateWithPassword(_username, _password.peek())) {
+ throw new CloudRuntimeException("Unable to authenticate");
+ }
+
+ com.trilead.ssh2.Session session = sshConnection.openSession();
+
+ String cmd = "mkdir -p /opt/cloud/bin /var/log/cloud";
+ if (!SSHCmdHelper.sshExecuteCmd(sshConnection, cmd)) {
+ throw new CloudRuntimeException("Cannot create directory /opt/cloud/bin on XenServer hosts");
+ }
+
+ SCPClient scp = new SCPClient(sshConnection);
+
+ List files = getPatchFiles();
+ if (files == null || files.isEmpty()) {
+ throw new CloudRuntimeException("Can not find patch file");
+ }
+ for (File file : files) {
+ String path = file.getParentFile().getAbsolutePath() + "/";
+ Properties props = new Properties();
+ props.load(new FileInputStream(file));
+
+ for (Map.Entry