incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: Windows 8 and Windows 2012 support for VmWare hypervisor.
Date Wed, 23 Jan 2013 19:49:31 GMT
Updated Branches:
  refs/heads/vim_win8 [created] 78d778fd0


Windows 8 and Windows 2012 support for VmWare hypervisor.

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

Branch: refs/heads/vim_win8
Commit: 78d778fd041618be1b7df0d73590774529572851
Parents: 485761f
Author: Min Chen <min.chen@citrix.com>
Authored: Wed Jan 23 11:48:43 2013 -0800
Committer: Min Chen <min.chen@citrix.com>
Committed: Wed Jan 23 11:48:43 2013 -0800

----------------------------------------------------------------------
 .../hypervisor/vmware/resource/VmwareResource.java |  306 +++++++-------
 setup/db/db/schema-40to410.sql                     |    9 +
 setup/db/templates.sql                             |    9 +
 .../vmware/util/VmwareGuestOsMapper.java           |  287 +++++++-------
 4 files changed, 317 insertions(+), 294 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/78d778fd/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index dd917f7..3cb1e25 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -11,7 +11,7 @@
 // Unless required by applicable law or agreed to in writing,
 // software distributed under the License is distributed on an
 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the 
+// KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
 package com.cloud.hypervisor.vmware.resource;
@@ -257,8 +257,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
     protected String _name;
 
     protected final long _ops_timeout = 900000; 		// 15 minutes time out to time
-    protected final int _shutdown_waitMs = 300000;		// wait up to 5 minutes for shutdown 
-    
+    protected final int _shutdown_waitMs = 300000;		// wait up to 5 minutes for shutdown
+
     // out an operation
     protected final int _retry = 24;
     protected final int _sleep = 10000;
@@ -279,14 +279,14 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
     protected String _guestNetworkVSwitchName;
     protected VirtualSwitchType _vSwitchType = VirtualSwitchType.StandardVirtualSwitch;
     protected boolean _nexusVSwitch = false;
-    
+
     protected float _cpuOverprovisioningFactor = 1;
     protected boolean _reserveCpu = false;
-    
+
     protected float _memOverprovisioningFactor = 1;
     protected boolean _reserveMem = false;
     protected boolean _recycleHungWorker = false;
-    protected DiskControllerType _rootDiskController = DiskControllerType.ide;    
+    protected DiskControllerType _rootDiskController = DiskControllerType.ide;
 
     protected ManagedObjectReference _morHyperHost;
     protected VmwareContext _serviceContext;
@@ -315,7 +315,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
     public Answer executeRequest(Command cmd) {
     	if(s_logger.isTraceEnabled())
     		s_logger.trace("Begin executeRequest(), cmd: " + cmd.getClass().getSimpleName());
-    	
+
         Answer answer = null;
         NDC.push(_hostName != null ? _hostName : _guid + "(" + ComponentLocator.class.getPackage().getImplementationVersion() + ")");
         try {
@@ -483,10 +483,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
     	if(s_logger.isTraceEnabled())
     		s_logger.trace("End executeRequest(), cmd: " + cmd.getClass().getSimpleName());
-        
+
         return answer;
     }
-    
+
     protected Answer execute(CheckNetworkCommand cmd) {
         if (s_logger.isInfoEnabled()) {
             s_logger.info("Executing resource CheckNetworkCommand " + _gson.toJson(cmd));
@@ -495,7 +495,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         // TODO setup portgroup for private network needs to be done here now
         return new CheckNetworkAnswer(cmd, true , "Network Setup check by names is done");
     }
-    
+
     protected Answer execute(NetworkUsageCommand cmd) {
     	if ( cmd.isForVpc() ) {
             return VPCNetworkUsage(cmd);
@@ -547,7 +547,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
     		if (!resultPair.first()) {
                 throw new Exception(" vpc network usage plugin call failed ");
     		}
-    		
+
     		if (option.equals("get") || option.equals("vpn")) {
                 String result =  resultPair.second();
                 if (result == null || result.isEmpty()) {
@@ -566,7 +566,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             }
             return new NetworkUsageAnswer(cmd, "success", 0L, 0L);
         } catch (Throwable e) {
-    		s_logger.error("Unable to execute NetworkUsage command on DomR (" + privateIp + "), domR may not be ready yet. failure due to " 
+    		s_logger.error("Unable to execute NetworkUsage command on DomR (" + privateIp + "), domR may not be ready yet. failure due to "
     				+ VmwareHelper.getExceptionMessage(e), e);
     	}
     	return new NetworkUsageAnswer(cmd, "success", 0L, 0L);
@@ -581,7 +581,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         String args = "";
         String[] results = new String[cmd.getRules().length];
         int i = 0;
-        
+
         boolean endResult = true;
         for (PortForwardingRuleTO rule : cmd.getRules()) {
             args += rule.revoked() ? " -D " : " -A ";
@@ -614,7 +614,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         return new SetPortForwardingRulesAnswer(cmd, results, endResult);
     }
-    
+
     protected SetFirewallRulesAnswer execute(SetFirewallRulesCommand cmd) {
 		String controlIp = getRouterSshControlIp(cmd);
 		String[] results = new String[cmd.getRules().length];
@@ -649,9 +649,9 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 	            for (int i=0; i < results.length; i++) {
 	                results[i] = "Failed";
 	            }
-	            
+
 	            return new SetFirewallRulesAnswer(cmd, false, results);
-			} 
+			}
 		} catch (Throwable e) {
 			s_logger.error("SetFirewallRulesCommand(args: " + args
 					+ ") failed on setting one rule due to "
@@ -661,11 +661,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                 results[i] = "Failed";
             }
 			return new SetFirewallRulesAnswer(cmd, false, results);
-		} 
+		}
 
 		return new SetFirewallRulesAnswer(cmd, true, results);
-    }	
-    
+    }
+
     protected Answer execute(SetStaticNatRulesCommand cmd) {
         if (s_logger.isInfoEnabled()) {
             s_logger.info("Executing resource SetFirewallRuleCommand: " + _gson.toJson(cmd));
@@ -681,11 +681,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
             args += " -l " + rule.getSrcIp();
             args += " -r " + rule.getDstIp();
-            
+
             if (rule.getProtocol() != null) {
                 args += " -P " + rule.getProtocol().toLowerCase();
             }
-            
+
             args += " -d " + rule.getStringSrcPortRange();
             args += " -G ";
 
@@ -719,7 +719,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
         String controlIp = getRouterSshControlIp(cmd);
-        
+
         assert(controlIp != null);
 
         LoadBalancerConfigurator cfgtr = new HAProxyConfigurator();
@@ -771,7 +771,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
                     args += " -s " + sb.toString();
                 }
-                
+
                 Pair<Boolean, String> result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null, "scp " + tmpCfgFilePath + " /etc/haproxy/haproxy.cfg.new");
 
                 if (!result.first()) {
@@ -1421,7 +1421,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         args += " -c ";
         args += "eth" + publicNicInfo.first();
-        
+
         args += " -g ";
         args += vlanGateway;
 
@@ -1438,7 +1438,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         }
 
         if (removeVif) {
-        	
+
         	String nicMasksStr = vmMo.getCustomFieldValue(CustomFieldConstants.CLOUD_NIC_MASK);
         	int nicMasks = Integer.parseInt(nicMasksStr);
         	nicMasks &= ~(1 << publicNicInfo.first().intValue());
@@ -1463,7 +1463,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
     private void plugPublicNic(VirtualMachineMO vmMo, final String vlanId, final String vifMacAddress) throws Exception {
         // TODO : probably need to set traffic shaping
         Pair<ManagedObjectReference, String> networkInfo = null;
-        
+
         if (!_nexusVSwitch) {
             networkInfo = HypervisorHostHelper.prepareNetwork(this._publicNetworkVSwitchName, "cloud.public",
                     vmMo.getRunningHost(), vlanId, null, null, this._ops_timeout, true);
@@ -1495,29 +1495,29 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             deviceConfigSpecArray[0] = new VirtualDeviceConfigSpec();
             deviceConfigSpecArray[0].setDevice(device);
             deviceConfigSpecArray[0].setOperation(VirtualDeviceConfigSpecOperation.edit);
-            
+
             vmConfigSpec.setDeviceChange(deviceConfigSpecArray);
             if(!vmMo.configureVm(vmConfigSpec)) {
                 throw new Exception("Failed to configure devices when plugPublicNic");
             }
         } catch(Exception e) {
-        
+
         	// restore allocation mask in case of exceptions
         	String nicMasksStr = vmMo.getCustomFieldValue(CustomFieldConstants.CLOUD_NIC_MASK);
         	int nicMasks = Integer.parseInt(nicMasksStr);
         	nicMasks &= ~(1 << nicIndex);
         	vmMo.setCustomFieldValue(CustomFieldConstants.CLOUD_NIC_MASK, String.valueOf(nicMasks));
-        	
+
         	throw e;
         }
     }
-    
+
     private int allocPublicNicIndex(VirtualMachineMO vmMo) throws Exception {
     	String nicMasksStr = vmMo.getCustomFieldValue(CustomFieldConstants.CLOUD_NIC_MASK);
     	if(nicMasksStr == null || nicMasksStr.isEmpty()) {
     		throw new Exception("Could not find NIC allocation info");
     	}
-    	
+
     	int nicMasks = Integer.parseInt(nicMasksStr);
     	VirtualDevice[] nicDevices = vmMo.getNicDevices();
     	for(int i = 3; i < nicDevices.length; i++) {
@@ -1527,7 +1527,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
     			return i;
     		}
     	}
-    	
+
     	throw new Exception("Could not allocate a free public NIC");
     }
 
@@ -1583,7 +1583,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
     protected Answer execute(SavePasswordCommand cmd) {
         if (s_logger.isInfoEnabled()) {
-            s_logger.info("Executing resource SavePasswordCommand. vmName: " + cmd.getVmName() + ", vmIp: " + cmd.getVmIpAddress() + ", password: " 
+            s_logger.info("Executing resource SavePasswordCommand. vmName: " + cmd.getVmName() + ", vmIp: " + cmd.getVmIpAddress() + ", password: "
             	+ StringUtils.getMaskedPasswordForDisplay(cmd.getPassword()));
         }
 
@@ -1597,7 +1597,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("Run command on domain router " + controlIp + ", /root/savepassword.sh " + args + " -p " + StringUtils.getMaskedPasswordForDisplay(cmd.getPassword()));
         }
-        
+
         args += " -p " + password;
 
 
@@ -1632,11 +1632,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         String args = " " + cmd.getVmMac();
         args += " " + cmd.getVmIpAddress();
         args += " " + cmd.getVmName();
-        
+
         if (cmd.getDefaultRouter() != null) {
             args += " " + cmd.getDefaultRouter();
         }
-        
+
         if (cmd.getDefaultDns() != null) {
             args += " " + cmd.getDefaultDns();
         }
@@ -1644,7 +1644,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         if (cmd.getStaticRoutes() != null) {
             args +=  " " + cmd.getStaticRoutes();
         }
-        
+
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /root/edithosts.sh " + args);
         }
@@ -1673,7 +1673,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         return new Answer(cmd);
     }
-    
+
     protected CheckS2SVpnConnectionsAnswer execute(CheckS2SVpnConnectionsCommand cmd) {
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("Executing resource CheckS2SVpnConnectionsCommand: " + _gson.toJson(cmd));
@@ -1736,7 +1736,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         }
         return new CheckRouterAnswer(cmd, result.second(), true);
     }
-    
+
     protected Answer execute(GetDomRVersionCmd cmd) {
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("Executing resource GetDomRVersionCmd: " + _gson.toJson(cmd));
@@ -1770,7 +1770,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         }
         return new GetDomRVersionAnswer(cmd, result.second(), lines[0], lines[1]);
     }
-    
+
     protected Answer execute(BumpUpPriorityCommand cmd) {
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("Executing resource BumpUpPriorityCommand: " + _gson.toJson(cmd));
@@ -1811,7 +1811,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         String routerPrivateIpAddress = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
         String controlIp = getRouterSshControlIp(cmd);
-        
+
         String vmIpAddress = cmd.getVmIpAddress();
         List<String[]> vmData = cmd.getVmData();
         String[] vmDataArgs = new String[vmData.size() * 2 + 4];
@@ -1937,7 +1937,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         VirtualMachineTO vmSpec = cmd.getVirtualMachine();
         String vmName = vmSpec.getName();
-        
+
         State state = State.Stopped;
         VmwareContext context = getServiceContext();
         try {
@@ -1951,7 +1951,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             VirtualEthernetCardType nicDeviceType = VirtualEthernetCardType.valueOf(vmSpec.getDetails().get(VmDetailConstants.NIC_ADAPTER));
             if(s_logger.isDebugEnabled())
             	s_logger.debug("VM " + vmName + " will be started with NIC device type: " + nicDeviceType);
-            
+
             VmwareHypervisorHost hyperHost = getHyperHost(context);
             VolumeTO[] disks = validateDisks(vmSpec.getDisks());
             assert (disks.length > 0);
@@ -1997,9 +1997,9 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                     }
 
                     assert (vmSpec.getSpeed() != null) && (rootDiskDataStoreDetails != null);
-                    if (!hyperHost.createBlankVm(vmName, vmSpec.getCpus(), vmSpec.getSpeed().intValue(), 
+                    if (!hyperHost.createBlankVm(vmName, vmSpec.getCpus(), vmSpec.getSpeed().intValue(),
                     		getReserveCpuMHz(vmSpec.getSpeed().intValue()), vmSpec.getLimitCpuUse(), ramMb, getReserveMemMB(ramMb),
-                    	translateGuestOsIdentifier(vmSpec.getArch(), vmSpec.getOs()).toString(), rootDiskDataStoreDetails.first(), false)) {
+                    	translateGuestOsIdentifier(vmSpec.getArch(), vmSpec.getOs()), rootDiskDataStoreDetails.first(), false)) {
                         throw new Exception("Failed to create VM. vmName: " + vmName);
                     }
                 }
@@ -2029,10 +2029,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
             VirtualMachineConfigSpec vmConfigSpec = new VirtualMachineConfigSpec();
             int ramMb = (int) (vmSpec.getMinRam() / (1024 * 1024));
-            VmwareHelper.setBasicVmConfig(vmConfigSpec, vmSpec.getCpus(), vmSpec.getSpeed().intValue(), 
+            VmwareHelper.setBasicVmConfig(vmConfigSpec, vmSpec.getCpus(), vmSpec.getSpeed().intValue(),
             	getReserveCpuMHz(vmSpec.getSpeed().intValue()), ramMb, getReserveMemMB(ramMb),
         		translateGuestOsIdentifier(vmSpec.getArch(), vmSpec.getOs()).toString(), vmSpec.getLimitCpuUse());
-            
+
             VirtualDeviceConfigSpec[] deviceConfigSpecArray = new VirtualDeviceConfigSpec[totalChangeDevices];
             int i = 0;
             int ideControllerKey = vmMo.getIDEDeviceControllerKey();
@@ -2049,7 +2049,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                     throw new Exception(msg);
                 }
                 mgr.prepareSecondaryStorageStore(secStoreUrl);
-                
+
                 ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnHost(secStoreUrl);
                 if (morSecDs == null) {
                     String msg = "Failed to prepare secondary storage on host, secondary store url: " + secStoreUrl;
@@ -2058,7 +2058,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                 DatastoreMO secDsMo = new DatastoreMO(hyperHost.getContext(), morSecDs);
 
                 deviceConfigSpecArray[i] = new VirtualDeviceConfigSpec();
-                Pair<VirtualDevice, Boolean> isoInfo = VmwareHelper.prepareIsoDevice(vmMo, String.format("[%s] systemvm/%s", secDsMo.getName(), mgr.getSystemVMIsoFileNameOnDatastore()), 
+                Pair<VirtualDevice, Boolean> isoInfo = VmwareHelper.prepareIsoDevice(vmMo, String.format("[%s] systemvm/%s", secDsMo.getName(), mgr.getSystemVMIsoFileNameOnDatastore()),
                 	secDsMo.getMor(), true, true, i, i + 1);
                 deviceConfigSpecArray[i].setDevice(isoInfo.first());
                 if (isoInfo.second()) {
@@ -2097,12 +2097,12 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                     if (isoInfo.second()) {
                     	if(s_logger.isDebugEnabled())
                     		s_logger.debug("Prepare ISO volume at existing device " + _gson.toJson(isoInfo.first()));
-                    	
+
                         deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.add);
                     } else {
                     	if(s_logger.isDebugEnabled())
                     		s_logger.debug("Prepare ISO volume at existing device " + _gson.toJson(isoInfo.first()));
-                    	
+
                         deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.edit);
                     }
                 }
@@ -2159,7 +2159,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
                 	if(s_logger.isDebugEnabled())
                 		s_logger.debug("Prepare volume at new device " + _gson.toJson(device));
-                    
+
                     i++;
                 }
             }
@@ -2183,18 +2183,18 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                     s_logger.info("Preparing NIC device on network " + networkInfo.second());
                     nic = VmwareHelper.prepareNicDevice(vmMo, networkInfo.first(), nicDeviceType, networkInfo.second(), nicTo.getMac(), i, i + 1, true, true);
                 }
-                
+
                 deviceConfigSpecArray[i] = new VirtualDeviceConfigSpec();
                 deviceConfigSpecArray[i].setDevice(nic);
                 deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.add);
-                
+
             	if(s_logger.isDebugEnabled())
             		s_logger.debug("Prepare NIC at new device " + _gson.toJson(deviceConfigSpecArray[i]));
- 
+
             	// this is really a hacking for DomR, upon DomR startup, we will reset all the NIC allocation after eth3
                 if(nicCount < 3)
                 	nicMask |= (1 << nicCount);
-                
+
                 i++;
                 nicCount++;
             }
@@ -2202,13 +2202,13 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             vmConfigSpec.setDeviceChange(deviceConfigSpecArray);
 
             // pass boot arguments through machine.id & perform customized options to VMX
-    
+
             Map<String, String> vmDetailOptions = validateVmDetails(vmSpec.getDetails());
             OptionValue[] extraOptions = new OptionValue[2 + vmDetailOptions.size()];
             extraOptions[0] = new OptionValue();
             extraOptions[0].setKey("machine.id");
             extraOptions[0].setValue(vmSpec.getBootArgs());
-            
+
             extraOptions[1] = new OptionValue();
             extraOptions[1].setKey("devices.hotplug");
             extraOptions[1].setValue("true");
@@ -2220,7 +2220,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             	extraOptions[j].setValue(entry.getValue());
             	j++;
             }
-            
+
             String keyboardLayout = null;
             if(vmSpec.getDetails() != null)
             	keyboardLayout = vmSpec.getDetails().get(VmDetailConstants.KEYBOARD);
@@ -2229,7 +2229,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             if (!vmMo.configureVm(vmConfigSpec)) {
                 throw new Exception("Failed to configure VM before start. vmName: " + vmName);
             }
-            
+
             vmMo.setCustomFieldValue(CustomFieldConstants.CLOUD_NIC_MASK, String.valueOf(nicMask));
 
             if (!vmMo.powerOn()) {
@@ -2257,10 +2257,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             }
         }
     }
-    
+
     private Map<String, String> validateVmDetails(Map<String, String> vmDetails) {
     	Map<String, String> validatedDetails = new HashMap<String, String>();
-    	
+
     	if(vmDetails != null && vmDetails.size() > 0) {
     		for(Map.Entry<String, String> entry : vmDetails.entrySet()) {
     			if("machine.id".equalsIgnoreCase(entry.getKey()))
@@ -2286,18 +2286,18 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
     	if(this._reserveCpu) {
     		return (int)(cpuMHz / this._cpuOverprovisioningFactor);
     	}
-    	
+
     	return 0;
     }
-    
+
     private int getReserveMemMB(int memMB) {
     	if(this._reserveMem) {
     		return (int)(memMB / this._memOverprovisioningFactor);
     	}
-    	
+
     	return 0;
     }
-    
+
     private NicTO[] sortNicsByDeviceId(NicTO[] nics) {
 
         List<NicTO> listForSort = new ArrayList<NicTO>();
@@ -2320,7 +2320,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         return listForSort.toArray(new NicTO[0]);
     }
-    
+
     private VolumeTO[] sortVolumesByDeviceId(VolumeTO[] volumes) {
 
         List<VolumeTO> listForSort = new ArrayList<VolumeTO>();
@@ -2384,38 +2384,38 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
     }
 
     private Pair<ManagedObjectReference, String> prepareNetworkFromNicInfo(HostMO hostMo, NicTO nicTo) throws Exception {
-        
+
         Pair<String, String> switchName =  getTargetSwitch(nicTo);
         String namePrefix = getNetworkNamePrefix(nicTo);
         Pair<ManagedObjectReference, String> networkInfo = null;
 
         s_logger.info("Prepare network on vSwitch: " + switchName + " with name prefix: " + namePrefix);
-        
+
         if(!_nexusVSwitch) {
-        	networkInfo = HypervisorHostHelper.prepareNetwork(switchName.first(), namePrefix, hostMo, getVlanInfo(nicTo, switchName.second()), 
-                    nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout, 
+        	networkInfo = HypervisorHostHelper.prepareNetwork(switchName.first(), namePrefix, hostMo, getVlanInfo(nicTo, switchName.second()),
+                    nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout,
                     !namePrefix.startsWith("cloud.private"));
         }
         else {
-        	networkInfo = HypervisorHostHelper.prepareNetwork(switchName.first(), namePrefix, hostMo, getVlanInfo(nicTo, switchName.second()), 
+        	networkInfo = HypervisorHostHelper.prepareNetwork(switchName.first(), namePrefix, hostMo, getVlanInfo(nicTo, switchName.second()),
                     nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout);
         }
-        	
+
         return networkInfo;
     }
-    
+
     // return Pair<switch name, vlan tagging>
     private Pair<String, String> getTargetSwitch(NicTO nicTo) throws Exception {
         if(nicTo.getName() != null && !nicTo.getName().isEmpty()) {
         	String[] tokens = nicTo.getName().split(",");
-        	
+
         	if(tokens.length == 2) {
         		return new Pair<String, String>(tokens[0], tokens[1]);
         	} else {
         		return new Pair<String, String>(nicTo.getName(), Vlan.UNTAGGED);
         	}
         }
-        
+
         if (nicTo.getType() == Networks.TrafficType.Guest) {
             return new Pair<String, String>(this._guestNetworkVSwitchName, Vlan.UNTAGGED);
         } else if (nicTo.getType() == Networks.TrafficType.Control || nicTo.getType() == Networks.TrafficType.Management) {
@@ -2430,7 +2430,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             throw new Exception("Unsupported traffic type: " + nicTo.getType().toString());
         }
     }
-    
+
     private String getNetworkNamePrefix(NicTO nicTo) throws Exception {
         if (nicTo.getType() == Networks.TrafficType.Guest) {
             return "cloud.guest";
@@ -2583,7 +2583,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         if (s_logger.isInfoEnabled()) {
             s_logger.info("Executing resource ReadyCommand: " + _gson.toJson(cmd));
         }
-        
+
         try {
         	VmwareContext context = getServiceContext();
         	VmwareHypervisorHost hyperHost = getHyperHost(context);
@@ -2605,7 +2605,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         VmwareContext context = getServiceContext();
         VmwareHypervisorHost hyperHost = getHyperHost(context);
-        
+
         HostStatsEntry hostStats = new HostStatsEntry(cmd.getHostId(), 0, 0, 0, "host", 0, 0, 0, 0);
         Answer answer = new GetHostStatsAnswer(cmd, hostStats);
         try {
@@ -2712,9 +2712,9 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
                 try {
                     vmMo.setCustomFieldValue(CustomFieldConstants.CLOUD_NIC_MASK, "0");
-                	
+
                     if (getVmState(vmMo) != State.Stopped) {
-                        
+
                         // before we stop VM, remove all possible snapshots on the VM to let
                         // disk chain be collapsed
                         s_logger.info("Remove all snapshot before stopping VM " + cmd.getVmName());
@@ -2896,7 +2896,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                 throw new Exception(msg);
             }
             mgr.prepareSecondaryStorageStore(secStoreUrl);
-            
+
             ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnHost(secStoreUrl);
             if (morSecDs == null) {
                 String msg = "Failed to prepare secondary storage on host, secondary store url: " + secStoreUrl;
@@ -2974,9 +2974,9 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
     }
 
     private VmwareHypervisorHost getTargetHyperHost(DatacenterMO dcMo, String destIp) throws Exception {
-    	
+
         VmwareManager mgr = dcMo.getContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
-    	
+
         ObjectContent[] ocs = dcMo.getHostPropertiesOnDatacenterHostFolder(new String[] { "name", "parent" });
         if (ocs != null && ocs.length > 0) {
             for (ObjectContent oc : ocs) {
@@ -3011,7 +3011,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             ManagedObjectReference morDatastore = null;
             morDatastore = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, pool.getUuid());
             if(morDatastore == null)
-	            morDatastore = hyperHost.mountDatastore(pool.getType() == StoragePoolType.VMFS, pool.getHost(), 
+	            morDatastore = hyperHost.mountDatastore(pool.getType() == StoragePoolType.VMFS, pool.getHost(),
 	                pool.getPort(), pool.getPath(), pool.getUuid().replace("-", ""));
 
             assert (morDatastore != null);
@@ -3042,7 +3042,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         try {
         	// We will leave datastore cleanup management to vCenter. Since for cluster VMFS datastore, it will always
         	// be mounted by vCenter.
-        	
+
             // VmwareHypervisorHost hyperHost = this.getHyperHost(getServiceContext());
             // hyperHost.unmountDatastore(pool.getUuid());
             Answer answer = new Answer(cmd, true, "success");
@@ -3416,7 +3416,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                     throw new Exception("Unable to find VM in vSphere, vm: " + cmd.getName());
                 }
             }
-            
+
             Pair<String, Integer> portInfo = vmMo.getVncPort(mgr.getManagementPortGroupByHost((HostMO)hyperHost));
 
             if (s_logger.isTraceEnabled()) {
@@ -3463,7 +3463,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             if(result.first())
         return new Answer(cmd);
         } catch (Exception e) {
-            s_logger.error("Unable to execute ping command on DomR (" + controlIp + "), domR may not be ready yet. failure due to " 
+            s_logger.error("Unable to execute ping command on DomR (" + controlIp + "), domR may not be ready yet. failure due to "
                     + VmwareHelper.getExceptionMessage(e), e);
         }
         return new Answer(cmd,false,"PingTestCommand failed");
@@ -3524,11 +3524,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         /*
          * DestroyCommand content example
-         * 
+         *
          * {"volume": {"id":5,"name":"Volume1", "mountPoint":"/export/home/kelven/vmware-test/primary",
          * "path":"6bb8762f-c34c-453c-8e03-26cc246ceec4", "size":0,"type":"DATADISK","resourceType":
          * "STORAGE_POOL","storagePoolType":"NetworkFilesystem", "poolId":0,"deviceId":0 } }
-         * 
+         *
          * {"volume": {"id":1, "name":"i-2-1-KY-ROOT", "mountPoint":"/export/home/kelven/vmware-test/primary",
          * "path":"i-2-1-KY-ROOT","size":0,"type":"ROOT", "resourceType":"STORAGE_POOL", "storagePoolType":"NetworkFilesystem",
          * "poolId":0,"deviceId":0 } }
@@ -3551,7 +3551,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             ManagedObjectReference morDc = hyperHost.getHyperHostDatacenter();
             ManagedObjectReference morCluster = hyperHost.getHyperHostCluster();
             ClusterMO clusterMo = new ClusterMO(context, morCluster);
-            
+
             if (cmd.getVolume().getType() == Volume.Type.ROOT) {
                 String vmName = cmd.getVmName();
                 if (vmName != null) {
@@ -3563,13 +3563,13 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
                         HostMO hostMo = vmMo.getRunningHost();
                         List<NetworkDetails> networks = vmMo.getNetworksWithDetails();
-                        
+
                         // tear down all devices first before we destroy the VM to avoid accidently delete disk backing files
                         if (getVmState(vmMo) != State.Stopped)
                         	vmMo.safePowerOff(_shutdown_waitMs);
                         vmMo.tearDownDevices(new Class<?>[] { VirtualDisk.class, VirtualEthernetCard.class });
                         vmMo.destroy();
-                        
+
                         for (NetworkDetails netDetails : networks) {
                             if (netDetails.getGCTag() != null && netDetails.getGCTag().equalsIgnoreCase("true")) {
                                 if (netDetails.getVMMorsOnNetwork() == null || netDetails.getVMMorsOnNetwork().length == 1) {
@@ -3577,12 +3577,12 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                                 }
                             }
                         }
-                    } 
-                    
+                    }
+
                     if (s_logger.isInfoEnabled())
                         s_logger.info("Destroy volume by original name: " + cmd.getVolume().getPath() + ".vmdk");
                     dsMo.deleteFile(cmd.getVolume().getPath() + ".vmdk", morDc, true);
-                    
+
                     // root volume may be created via linked-clone, delete the delta disk as well
                     if (s_logger.isInfoEnabled())
                     	s_logger.info("Destroy volume by derived name: " + cmd.getVolume().getPath() + "-delta.vmdk");
@@ -3599,7 +3599,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                 if (vmMo != null) {
                     if (s_logger.isInfoEnabled())
                         s_logger.info("Destroy template volume " + cmd.getVolume().getPath());
-                	
+
                 	vmMo.destroy();
                     return new Answer(cmd, true, "Success");
                 }
@@ -3622,7 +3622,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                         s_logger.info("Empty disk chain info, fall back to try to delete by original backing file name");
                     }
                     dsMo.deleteFile(cmd.getVolume().getPath() + ".vmdk", morDc, true);
-                    
+
                     if (s_logger.isInfoEnabled()) {
                     	s_logger.info("Destroy volume by derived name: " + cmd.getVolume().getPath() + "-flat.vmdk");
                     }
@@ -3633,7 +3633,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                     s_logger.info("Destroy volume by original name: " + cmd.getVolume().getPath() + ".vmdk");
                 }
                 dsMo.deleteFile(cmd.getVolume().getPath() + ".vmdk", morDc, true);
-                
+
                 if (s_logger.isInfoEnabled()) {
                 	s_logger.info("Destroy volume by derived name: " + cmd.getVolume().getPath() + "-flat.vmdk");
                 }
@@ -3660,7 +3660,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
          * NetworkMO(hostMo.getContext(), netDetails.getNetworkMor()); ManagedObjectReference[] vms =
          * networkMo.getVMsOnNetwork(); if(vms == null || vms.length == 0) { if(s_logger.isInfoEnabled()) {
          * s_logger.info("Cleanup network as it is currently not in use: " + netDetails.getName()); }
-         * 
+         *
          * hostMo.deletePortGroup(netDetails.getName()); } } } catch(Throwable e) {
          * s_logger.warn("Unable to cleanup network due to exception, skip for next time"); }
          */
@@ -3744,7 +3744,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                         s_logger.warn("Template host in vSphere is not in connected state, request template reload");
                         return new CreateAnswer(cmd, "Template host in vSphere is not in connected state, request template reload", true);
                     }
-                    
+
                     ManagedObjectReference morPool = hyperHost.getHyperHostOwnerResourcePool();
                     ManagedObjectReference morCluster = hyperHost.getHyperHostCluster();
                     ManagedObjectReference morBaseSnapshot = vmTemplate.getSnapshotMor("cloud.template.base");
@@ -3773,7 +3773,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                     dsMo.moveDatastoreFile(String.format("[%s] %s/%s.vmdk", dsMo.getName(), vmdkName, vmdkName),
                         dcMo.getMor(), dsMo.getMor(),
                         String.format("[%s] %s.vmdk", dsMo.getName(), vmdkName), dcMo.getMor(), true);
-                    
+
                     dsMo.moveDatastoreFile(String.format("[%s] %s/%s-delta.vmdk", dsMo.getName(), vmdkName, vmdkName),
                             dcMo.getMor(), dsMo.getMor(),
                             String.format("[%s] %s-delta.vmdk", dsMo.getName(), vmdkName), dcMo.getMor(), true);
@@ -3879,13 +3879,13 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             VmwareContext context = getServiceContext();
             VmwareHypervisorHost hyperHost = getHyperHost(context);
             VmwareManager mgr = hyperHost.getContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
-            
+
             if(hyperHost.isHyperHostConnected()) {
                 mgr.gcLeftOverVMs(context);
-                
+
                 if(_recycleHungWorker) {
                     s_logger.info("Scan hung worker VM to recycle");
-                    
+
                     // GC worker that has been running for too long
                     ObjectContent[] ocs = hyperHost.getVmPropertiesOnHyperHost(
                             new String[] {"name", "config.template", "runtime.powerState", "runtime.bootTime"});
@@ -3897,7 +3897,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                                 boolean template = false;
                                 VirtualMachinePowerState powerState = VirtualMachinePowerState.poweredOff;
                                 GregorianCalendar bootTime = null;
-                                
+
                                 for(DynamicProperty prop : props) {
                                     if(prop.getName().equals("name"))
                                         name = prop.getVal().toString();
@@ -3905,22 +3905,22 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                                         template = (Boolean)prop.getVal();
                                     else if(prop.getName().equals("runtime.powerState"))
                                         powerState = (VirtualMachinePowerState)prop.getVal();
-                                    else if(prop.getName().equals("runtime.bootTime")) 
+                                    else if(prop.getName().equals("runtime.bootTime"))
                                         bootTime = (GregorianCalendar)prop.getVal();
                                 }
-                                
+
                                 if(!template && name.matches("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")) {
                                     boolean recycle = false;
-    
+
                                     // recycle stopped worker VM and VM that has been running for too long (hard-coded 10 hours for now)
                                     if(powerState == VirtualMachinePowerState.poweredOff)
                                         recycle = true;
                                     else if(bootTime != null && (new Date().getTime() - bootTime.getTimeInMillis() > 10*3600*1000))
                                         recycle = true;
-                                    
+
                                     if(recycle) {
                                         s_logger.info("Recycle pending worker VM: " + name);
-                                        
+
                                         VirtualMachineMO vmMo = new VirtualMachineMO(hyperHost.getContext(), oc.getObj());
                                         vmMo.powerOff();
                                         vmMo.destroy();
@@ -3961,17 +3961,17 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             	s_logger.info("Host " + hyperHost.getHyperHostName() + " is not in connected state");
             	return null;
             }
-            
+
             AboutInfo aboutInfo = ((HostMO)hyperHost).getHostAboutInfo();
             hostApiVersion = aboutInfo.getApiVersion();
-            
+
         } catch (Exception e) {
             String msg = "VmwareResource intialize() failed due to : " + VmwareHelper.getExceptionMessage(e);
             s_logger.error(msg);
             invalidateServiceContext();
             return null;
         }
-    	
+
         StartupRoutingCommand cmd = new StartupRoutingCommand();
         fillHostInfo(cmd);
 
@@ -4097,10 +4097,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         try {
             VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext());
-            
+
             assert(hyperHost instanceof HostMO);
             VmwareManager mgr = hyperHost.getContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
-                        
+
             VmwareHypervisorHostNetworkSummary summary = hyperHost.getHyperHostNetworkSummary(mgr.getManagementPortGroupByHost((HostMO)hyperHost));
             if (summary == null) {
                 throw new Exception("No ESX(i) host found");
@@ -4200,7 +4200,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                         if (s_logger.isDebugEnabled()) {
                             s_logger.debug("VM " + vm + " is now missing from host report but we detected that it might be migrated to other host by vCenter");
                         }
-                        
+
                         if(oldState != State.Starting && oldState != State.Migrating) {
                             s_logger.debug("VM " + vm + " is now missing from host report and VM is not at starting/migrating state, remove it from host VM-sync map, oldState: " + oldState);
                         	_vms.remove(vm);
@@ -4247,22 +4247,22 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         return hyperHost.findVmOnPeerHyperHost(vmName) != null;
     }
 
-    protected OptionValue[] configureVnc(OptionValue[] optionsToMerge, VmwareHypervisorHost hyperHost, String vmName, 
+    protected OptionValue[] configureVnc(OptionValue[] optionsToMerge, VmwareHypervisorHost hyperHost, String vmName,
     	String vncPassword, String keyboardLayout) throws Exception {
-    	
+
         VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(vmName);
 
         VmwareManager mgr = hyperHost.getContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
         if(!mgr.beginExclusiveOperation(600))
         	throw new Exception("Unable to begin exclusive operation, lock time out");
-        
+
         try {
 	        int maxVncPorts = 64;
 	        int vncPort = 0;
 	        Random random = new Random();
-	
+
 	        HostMO vmOwnerHost = vmMo.getRunningHost();
-	
+
 	        ManagedObjectReference morParent = vmOwnerHost.getParentMor();
 	        HashMap<String, Integer> portInfo;
 	        if(morParent.getType().equalsIgnoreCase("ClusterComputeResource")) {
@@ -4271,7 +4271,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 	        } else {
 	        	portInfo = vmOwnerHost.getVmVncPortsOnHost();
 	        }
-	        
+
 	        // allocate first at 5900 - 5964 range
 	        Collection<Integer> existingPorts = portInfo.values();
 	        int val = random.nextInt(maxVncPorts);
@@ -4281,10 +4281,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 	                vncPort = 5900 + val;
 	                break;
 	            }
-	
+
 	            val = (++val) % maxVncPorts;
 	        } while (val != startVal);
-	        
+
 	        if(vncPort == 0) {
 	            s_logger.info("we've run out of range for ports between 5900-5964 for the cluster, we will try port range at 59000-60000");
 
@@ -4297,19 +4297,19 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 	                    vncPort = additionalRange.first() + val;
 	                    break;
 	                }
-	
+
 	                val = (++val) % maxVncPorts;
 	            } while (val != startVal);
 	        }
-	
+
 	        if (vncPort == 0) {
 	            throw new Exception("Unable to find an available VNC port on host");
 	        }
-	
+
 	        if (s_logger.isInfoEnabled()) {
 	            s_logger.info("Configure VNC port for VM " + vmName + ", port: " + vncPort + ", host: " + vmOwnerHost.getHyperHostName());
 	        }
-	
+
 	        return VmwareHelper.composeVncOptions(optionsToMerge, true, vncPassword, vncPort, keyboardLayout);
         } finally {
         	try {
@@ -4321,21 +4321,21 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         }
     }
 
-    private VirtualMachineGuestOsIdentifier translateGuestOsIdentifier(String cpuArchitecture, String cloudGuestOs) {
+    private String translateGuestOsIdentifier(String cpuArchitecture, String cloudGuestOs) {
         if (cpuArchitecture == null) {
             s_logger.warn("CPU arch is not set, default to i386. guest os: " + cloudGuestOs);
             cpuArchitecture = "i386";
         }
 
-        VirtualMachineGuestOsIdentifier identifier = VmwareGuestOsMapper.getGuestOsIdentifier(cloudGuestOs);
+        String identifier = VmwareGuestOsMapper.getGuestOsIdentifier(cloudGuestOs);
         if (identifier != null) {
             return identifier;
         }
 
         if (cpuArchitecture.equalsIgnoreCase("x86_64")) {
-            return VirtualMachineGuestOsIdentifier.otherGuest64;
+            return VirtualMachineGuestOsIdentifier.otherGuest64.toString();
         }
-        return VirtualMachineGuestOsIdentifier.otherGuest;
+        return VirtualMachineGuestOsIdentifier.otherGuest.toString();
     }
 
     private void prepareNetworkForVmTargetHost(HostMO hostMo, VirtualMachineMO vmMo) throws Exception {
@@ -4404,7 +4404,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             }
         }
     }
-    
+
     private HashMap<String, State> getVmStates() throws Exception {
         VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext());
         ObjectContent[] ocs = hyperHost.getVmPropertiesOnHyperHost(new String[] { "name", "runtime.powerState", "config.template" });
@@ -4451,7 +4451,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         PerfCounterInfo[] cInfo = (PerfCounterInfo[]) getServiceContext().getServiceUtil().getDynamicProperty(perfMgr, "perfCounter");
         for(int i=0; i<cInfo.length; ++i) {
-            if ("net".equalsIgnoreCase(cInfo[i].getGroupInfo().getKey())) { 
+            if ("net".equalsIgnoreCase(cInfo[i].getGroupInfo().getKey())) {
                 if ("transmitted".equalsIgnoreCase(cInfo[i].getNameInfo().getKey())) {
                     txPerfCounterInfo = cInfo[i];
                 }
@@ -4488,11 +4488,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                     assert(vmMor!=null);
 
                     ArrayList vmNetworkMetrics = new ArrayList();
-                    // get all the metrics from the available sample period 
+                    // get all the metrics from the available sample period
                     PerfMetricId[] perfMetrics = service.queryAvailablePerfMetric(perfMgr, vmMor, null, null, null);
                     if(perfMetrics != null) {
                        for(int index=0; index < perfMetrics.length; ++index) {
-                           if ( ((rxPerfCounterInfo != null) && (perfMetrics[index].getCounterId() == rxPerfCounterInfo.getKey())) || 
+                           if ( ((rxPerfCounterInfo != null) && (perfMetrics[index].getCounterId() == rxPerfCounterInfo.getKey())) ||
                                    ((txPerfCounterInfo != null) && (perfMetrics[index].getCounterId() == txPerfCounterInfo.getKey())) ) {
                                vmNetworkMetrics.add(perfMetrics[index]);
                           }
@@ -4533,8 +4533,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                 }
             }
         }
-        return vmResponseMap;    	
-    }    
+        return vmResponseMap;
+    }
 
     protected String networkUsage(final String privateIpAddress, final String option, final String ethName) {
         String args = null;
@@ -4567,7 +4567,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
             return result.second();
         } catch (Throwable e) {
-            s_logger.error("Unable to execute NetworkUsage command on DomR (" + privateIpAddress + "), domR may not be ready yet. failure due to " 
+            s_logger.error("Unable to execute NetworkUsage command on DomR (" + privateIpAddress + "), domR may not be ready yet. failure due to "
                 + VmwareHelper.getExceptionMessage(e), e);
         }
 
@@ -4658,7 +4658,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         ComputeResourceSummary hardwareSummary = hyperHost.getHyperHostHardwareSummary();
         if(hardwareSummary == null)
         	return null;
-        
+
         HostStatsEntry entry = new HostStatsEntry();
 
         entry.setEntityType("host");
@@ -4669,19 +4669,19 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         return entry;
     }
-    
+
     private static String getRouterSshControlIp(NetworkElementCommand cmd) {
     	String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
     	String routerGuestIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP);
     	String zoneNetworkType = cmd.getAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE);
-    	
+
     	if(routerGuestIp != null && zoneNetworkType != null && NetworkType.valueOf(zoneNetworkType) == NetworkType.Basic) {
     		if(s_logger.isDebugEnabled())
     			s_logger.debug("In Basic zone mode, use router's guest IP for SSH control. guest IP : " + routerGuestIp);
-    		
+
     		return routerGuestIp;
     	}
-    	
+
 		if(s_logger.isDebugEnabled())
 			s_logger.debug("Use router's private IP for SSH control. IP : " + routerIp);
     	return routerIp;
@@ -4701,7 +4701,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         _dcId = (String) params.get("zone");
         _pod = (String) params.get("pod");
         _cluster = (String) params.get("cluster");
-        
+
         _guid = (String) params.get("guid");
         String[] tokens = _guid.split("@");
         _vCenterAddress = tokens[1];
@@ -4709,7 +4709,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         String[] hostTokens = tokens[0].split(":");
         _morHyperHost.setType(hostTokens[0]);
         _morHyperHost.set_value(hostTokens[1]);
-        
+
         VmwareContext context = getServiceContext();
         try {
             VmwareManager mgr = context.getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
@@ -4747,14 +4747,14 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
         if(_privateNetworkVSwitchName == null) {
             _privateNetworkVSwitchName = (String) params.get("private.network.vswitch.name");
-        }    
+        }
         if(_publicNetworkVSwitchName == null) {
             _publicNetworkVSwitchName = (String) params.get("public.network.vswitch.name");
         }
         if(_guestNetworkVSwitchName == null) {
             _guestNetworkVSwitchName = (String) params.get("guest.network.vswitch.name");
         }
-        
+
         String value = (String) params.get("cpu.overprovisioning.factor");
         if(value != null)
             _cpuOverprovisioningFactor = Float.parseFloat(value);
@@ -4762,7 +4762,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         value = (String) params.get("vmware.reserve.cpu");
         if(value != null && value.equalsIgnoreCase("true"))
             _reserveCpu = true;
-        
+
         value = (String) params.get("vmware.recycle.hung.wokervm");
         if(value != null && value.equalsIgnoreCase("true"))
             _recycleHungWorker = true;
@@ -4774,7 +4774,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         value = (String) params.get("vmware.reserve.mem");
         if(value != null && value.equalsIgnoreCase("true"))
             _reserveMem = true;
-        
+
         value = (String)params.get("vmware.root.disk.controller");
         if(value != null && value.equalsIgnoreCase("scsi"))
         	_rootDiskController = DiskControllerType.scsi;
@@ -4825,7 +4825,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                 _serviceContext = VmwareContextFactory.create(_vCenterAddress, _username, _password);
                 VmwareHypervisorHost hyperHost = getHyperHost(_serviceContext, cmd);
                 assert(hyperHost instanceof HostMO);
-                
+
                 HostFirewallSystemMO firewallMo = ((HostMO)hyperHost).getHostFirewallSystemMO();
                 boolean bRefresh = false;
                 if(firewallMo != null) {
@@ -4841,7 +4841,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                 			}
                 		}
                 	}
-                	
+
                 	if(bRefresh)
                 		firewallMo.refreshFirewall();
                 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/78d778fd/setup/db/db/schema-40to410.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql
index 93949b8..6bf6aba 100644
--- a/setup/db/db/schema-40to410.sql
+++ b/setup/db/db/schema-40to410.sql
@@ -141,6 +141,15 @@ UPDATE `cloud`.`conditions` set uuid=id WHERE uuid is NULL;
 
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', '"detail.batch.query.size"', '2000', 'Default entity detail batch query size for listing');
 
+-- Windows 8 support for Vmware
+INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (208, UUID(), 6, 'Windows 8');
+INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (209, UUID(), 6, 'Windows 8 (64 bit)');
+INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (210, UUID(), 6, 'Windows 8 Server (64 bit)');
+
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Windows 8', 208);
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Windows 8 (64 bit)', 209);
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Windows 8 Server (64 bit)', 210);
+
 -- DB views for list api
 
 DROP VIEW IF EXISTS `cloud`.`user_vm_view`;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/78d778fd/setup/db/templates.sql
----------------------------------------------------------------------
diff --git a/setup/db/templates.sql b/setup/db/templates.sql
index 9980b15..ab90811 100755
--- a/setup/db/templates.sql
+++ b/setup/db/templates.sql
@@ -219,6 +219,11 @@ INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (201
 INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (202, UUID(), 5, 'Other SUSE Linux(32-bit)');
 INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (203, UUID(), 5, 'Other SUSE Linux(64-bit)');
 
+INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (208, UUID(), 6, 'Windows 8');
+INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (209, UUID(), 6, 'Windows 8 (64 bit)');
+INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (210, UUID(), 6, 'Windows 8 Server (64 bit)');
+
+
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("XenServer", 'CentOS 4.5 (32-bit)', 1);
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("XenServer", 'CentOS 4.6 (32-bit)', 2);
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES  ("XenServer", 'CentOS 4.7 (32-bit)', 3);
@@ -414,6 +419,10 @@ INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'CentOS (32-bit)', 200);
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'CentOS (64-bit)', 201);
 
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Windows 8', 208);
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Windows 8 (64 bit)', 209);
+INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ("VmWare", 'Windows 8 Server (64 bit)', 210);
+
 
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.5', 1);
 INSERT INTO `cloud`.`guest_os_hypervisor` (hypervisor_type, guest_os_name, guest_os_id) VALUES ('KVM', 'CentOS 4.6', 2);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/78d778fd/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
index 7d26983..eafc8a5 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java
@@ -22,149 +22,154 @@ import java.util.Map;
 import com.vmware.vim25.VirtualMachineGuestOsIdentifier;
 
 public class VmwareGuestOsMapper {
-	private static Map<String, VirtualMachineGuestOsIdentifier> s_mapper = new HashMap<String, VirtualMachineGuestOsIdentifier>();
+	private static Map<String, String> s_mapper = new HashMap<String, String>();
 	static {
-		s_mapper.put("DOS", VirtualMachineGuestOsIdentifier.dosGuest);
-		s_mapper.put("OS/2", VirtualMachineGuestOsIdentifier.os2Guest);
-
-		s_mapper.put("Windows 3.1", VirtualMachineGuestOsIdentifier.win31Guest);
-		s_mapper.put("Windows 95", VirtualMachineGuestOsIdentifier.win95Guest);
-		s_mapper.put("Windows 98", VirtualMachineGuestOsIdentifier.win98Guest);
-		s_mapper.put("Windows NT 4", VirtualMachineGuestOsIdentifier.winNTGuest);
-		s_mapper.put("Windows XP (32-bit)", VirtualMachineGuestOsIdentifier.winXPProGuest);
-		s_mapper.put("Windows XP (64-bit)", VirtualMachineGuestOsIdentifier.winXPPro64Guest);
-		s_mapper.put("Windows XP SP2 (32-bit)", VirtualMachineGuestOsIdentifier.winXPProGuest);
-		s_mapper.put("Windows XP SP3 (32-bit)", VirtualMachineGuestOsIdentifier.winXPProGuest);
-		s_mapper.put("Windows Vista (32-bit)", VirtualMachineGuestOsIdentifier.winVistaGuest);
-		s_mapper.put("Windows Vista (64-bit)", VirtualMachineGuestOsIdentifier.winVista64Guest);
-		s_mapper.put("Windows 7 (32-bit)", VirtualMachineGuestOsIdentifier.windows7Guest);
-		s_mapper.put("Windows 7 (64-bit)", VirtualMachineGuestOsIdentifier.windows7_64Guest);
-
-		s_mapper.put("Windows 2000 Professional", VirtualMachineGuestOsIdentifier.win2000ProGuest);
-		s_mapper.put("Windows 2000 Server", VirtualMachineGuestOsIdentifier.win2000ServGuest);
-		s_mapper.put("Windows 2000 Server SP4 (32-bit)", VirtualMachineGuestOsIdentifier.win2000ServGuest);
-		s_mapper.put("Windows 2000 Advanced Server", VirtualMachineGuestOsIdentifier.win2000AdvServGuest);
-		
-		s_mapper.put("Windows Server 2003 Enterprise Edition(32-bit)", VirtualMachineGuestOsIdentifier.winNetEnterpriseGuest);
-		s_mapper.put("Windows Server 2003 Enterprise Edition(64-bit)", VirtualMachineGuestOsIdentifier.winNetEnterprise64Guest);
-		s_mapper.put("Windows Server 2008 R2 (64-bit)", VirtualMachineGuestOsIdentifier.winLonghorn64Guest);
-		s_mapper.put("Windows Server 2003 DataCenter Edition(32-bit)", VirtualMachineGuestOsIdentifier.winNetDatacenterGuest);
-		s_mapper.put("Windows Server 2003 DataCenter Edition(64-bit)", VirtualMachineGuestOsIdentifier.winNetDatacenter64Guest);
-		s_mapper.put("Windows Server 2003 Standard Edition(32-bit)", VirtualMachineGuestOsIdentifier.winNetStandardGuest);
-		s_mapper.put("Windows Server 2003 Standard Edition(64-bit)", VirtualMachineGuestOsIdentifier.winNetStandard64Guest);
-		s_mapper.put("Windows Server 2003 Web Edition", VirtualMachineGuestOsIdentifier.winNetWebGuest);
-		s_mapper.put("Microsoft Small Bussiness Server 2003", VirtualMachineGuestOsIdentifier.winNetBusinessGuest);
-		
-		s_mapper.put("Windows Server 2008 (32-bit)", VirtualMachineGuestOsIdentifier.winLonghornGuest);
-		s_mapper.put("Windows Server 2008 (64-bit)", VirtualMachineGuestOsIdentifier.winLonghorn64Guest);
-		
-		s_mapper.put("Open Enterprise Server", VirtualMachineGuestOsIdentifier.oesGuest);
-		
-		s_mapper.put("Asianux 3(32-bit)", VirtualMachineGuestOsIdentifier.asianux3Guest);
-		s_mapper.put("Asianux 3(64-bit)", VirtualMachineGuestOsIdentifier.asianux3_64Guest);
-		
-		s_mapper.put("Debian GNU/Linux 5(64-bit)", VirtualMachineGuestOsIdentifier.debian5_64Guest);
-        s_mapper.put("Debian GNU/Linux 5.0 (32-bit)", VirtualMachineGuestOsIdentifier.debian5Guest);
-		s_mapper.put("Debian GNU/Linux 4(32-bit)", VirtualMachineGuestOsIdentifier.debian4Guest);
-		s_mapper.put("Debian GNU/Linux 4(64-bit)", VirtualMachineGuestOsIdentifier.debian4_64Guest);
-		
-		s_mapper.put("Novell Netware 6.x", VirtualMachineGuestOsIdentifier.netware6Guest);
-		s_mapper.put("Novell Netware 5.1", VirtualMachineGuestOsIdentifier.netware5Guest);
-		
-		s_mapper.put("Sun Solaris 10(32-bit)", VirtualMachineGuestOsIdentifier.solaris10Guest);
-		s_mapper.put("Sun Solaris 10(64-bit)", VirtualMachineGuestOsIdentifier.solaris10_64Guest);
-		s_mapper.put("Sun Solaris 9(Experimental)", VirtualMachineGuestOsIdentifier.solaris9Guest);
-		s_mapper.put("Sun Solaris 8(Experimental)", VirtualMachineGuestOsIdentifier.solaris8Guest);
-		
-		s_mapper.put("FreeBSD (32-bit)", VirtualMachineGuestOsIdentifier.freebsdGuest);
-		s_mapper.put("FreeBSD (64-bit)", VirtualMachineGuestOsIdentifier.freebsd64Guest);
-		
-		s_mapper.put("SCO OpenServer 5", VirtualMachineGuestOsIdentifier.otherGuest);
-		s_mapper.put("SCO UnixWare 7", VirtualMachineGuestOsIdentifier.unixWare7Guest);
-		
-		s_mapper.put("SUSE Linux Enterprise 8(32-bit)", VirtualMachineGuestOsIdentifier.suseGuest);
-		s_mapper.put("SUSE Linux Enterprise 8(64-bit)", VirtualMachineGuestOsIdentifier.suse64Guest);
-		s_mapper.put("SUSE Linux Enterprise 9(32-bit)", VirtualMachineGuestOsIdentifier.suseGuest);
-		s_mapper.put("SUSE Linux Enterprise 9(64-bit)", VirtualMachineGuestOsIdentifier.suse64Guest);
-		s_mapper.put("SUSE Linux Enterprise 10(32-bit)", VirtualMachineGuestOsIdentifier.suseGuest);
-		s_mapper.put("SUSE Linux Enterprise 10(64-bit)", VirtualMachineGuestOsIdentifier.suse64Guest);
-		s_mapper.put("SUSE Linux Enterprise 10(32-bit)", VirtualMachineGuestOsIdentifier.suseGuest);
-		s_mapper.put("Other SUSE Linux(32-bit)", VirtualMachineGuestOsIdentifier.suseGuest);
-		s_mapper.put("Other SUSE Linux(64-bit)", VirtualMachineGuestOsIdentifier.suse64Guest);
-		
-		s_mapper.put("CentOS 4.5 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 4.6 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 4.7 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 4.8 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 5.0 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 5.0 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest);
-		s_mapper.put("CentOS 5.1 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 5.1 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest);
-		s_mapper.put("CentOS 5.2 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 5.2 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest);
-		s_mapper.put("CentOS 5.3 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 5.3 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest);
-		s_mapper.put("CentOS 5.4 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 5.4 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest);
-		s_mapper.put("CentOS 5.5 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 5.5 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest);
-		s_mapper.put("CentOS 5.6 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 5.6 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest);
-		s_mapper.put("CentOS 6.0 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("CentOS 6.0 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest);
-		s_mapper.put("Other CentOS (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest);
-		s_mapper.put("Other CentOS (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest);
-		
-		s_mapper.put("Red Hat Enterprise Linux 2", VirtualMachineGuestOsIdentifier.rhel2Guest);
-		s_mapper.put("Red Hat Enterprise Linux 3(32-bit)", VirtualMachineGuestOsIdentifier.rhel3Guest);
-		s_mapper.put("Red Hat Enterprise Linux 3(64-bit)", VirtualMachineGuestOsIdentifier.rhel3_64Guest);
-		s_mapper.put("Red Hat Enterprise Linux 4(32-bit)", VirtualMachineGuestOsIdentifier.rhel4Guest);
-		s_mapper.put("Red Hat Enterprise Linux 4(64-bit)", VirtualMachineGuestOsIdentifier.rhel4_64Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest);
-		s_mapper.put("Red Hat Enterprise Linux 6(32-bit)", VirtualMachineGuestOsIdentifier.rhel6Guest);
-		s_mapper.put("Red Hat Enterprise Linux 6(64-bit)", VirtualMachineGuestOsIdentifier.rhel6_64Guest);
-		
-		s_mapper.put("Red Hat Enterprise Linux 4.5 (32-bit)", VirtualMachineGuestOsIdentifier.rhel4Guest);
-		s_mapper.put("Red Hat Enterprise Linux 4.6 (32-bit)", VirtualMachineGuestOsIdentifier.rhel4Guest);
-		s_mapper.put("Red Hat Enterprise Linux 4.7 (32-bit)", VirtualMachineGuestOsIdentifier.rhel4Guest);
-		s_mapper.put("Red Hat Enterprise Linux 4.8 (32-bit)", VirtualMachineGuestOsIdentifier.rhel4Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5.0(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5.0(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5.1(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5.1(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5.2(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5.2(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5.3(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5.3(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5.4(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest);
-		s_mapper.put("Red Hat Enterprise Linux 5.4(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest);
-		
-		s_mapper.put("Ubuntu 8.04 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest);
-		s_mapper.put("Ubuntu 8.04 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest);
-		s_mapper.put("Ubuntu 8.10 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest);
-		s_mapper.put("Ubuntu 8.10 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest);
-		s_mapper.put("Ubuntu 9.04 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest);
-		s_mapper.put("Ubuntu 9.04 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest);
-		s_mapper.put("Ubuntu 9.10 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest);
-		s_mapper.put("Ubuntu 9.10 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest);
-		s_mapper.put("Ubuntu 10.04 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest);
-		s_mapper.put("Ubuntu 10.04 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest);
-		s_mapper.put("Ubuntu 10.10 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest);
-		s_mapper.put("Ubuntu 10.10 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest);
-		s_mapper.put("Other Ubuntu (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest);
-		s_mapper.put("Other Ubuntu (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest);
-
-		s_mapper.put("Other 2.6x Linux (32-bit)", VirtualMachineGuestOsIdentifier.other26xLinuxGuest);
-		s_mapper.put("Other 2.6x Linux (64-bit)", VirtualMachineGuestOsIdentifier.other26xLinux64Guest);
-		s_mapper.put("Other Linux (32-bit)", VirtualMachineGuestOsIdentifier.otherLinuxGuest);
-		s_mapper.put("Other Linux (64-bit)", VirtualMachineGuestOsIdentifier.otherLinux64Guest);
-		
-		s_mapper.put("Other (32-bit)", VirtualMachineGuestOsIdentifier.otherGuest);
-		s_mapper.put("Other (64-bit)", VirtualMachineGuestOsIdentifier.otherGuest64);
+		s_mapper.put("DOS", VirtualMachineGuestOsIdentifier.dosGuest.toString());
+		s_mapper.put("OS/2", VirtualMachineGuestOsIdentifier.os2Guest.toString());
+
+		s_mapper.put("Windows 3.1", VirtualMachineGuestOsIdentifier.win31Guest.toString());
+		s_mapper.put("Windows 95", VirtualMachineGuestOsIdentifier.win95Guest.toString());
+		s_mapper.put("Windows 98", VirtualMachineGuestOsIdentifier.win98Guest.toString());
+		s_mapper.put("Windows NT 4", VirtualMachineGuestOsIdentifier.winNTGuest.toString());
+		s_mapper.put("Windows XP (32-bit)", VirtualMachineGuestOsIdentifier.winXPProGuest.toString());
+		s_mapper.put("Windows XP (64-bit)", VirtualMachineGuestOsIdentifier.winXPPro64Guest.toString());
+		s_mapper.put("Windows XP SP2 (32-bit)", VirtualMachineGuestOsIdentifier.winXPProGuest.toString());
+		s_mapper.put("Windows XP SP3 (32-bit)", VirtualMachineGuestOsIdentifier.winXPProGuest.toString());
+		s_mapper.put("Windows Vista (32-bit)", VirtualMachineGuestOsIdentifier.winVistaGuest.toString());
+		s_mapper.put("Windows Vista (64-bit)", VirtualMachineGuestOsIdentifier.winVista64Guest.toString());
+		s_mapper.put("Windows 7 (32-bit)", VirtualMachineGuestOsIdentifier.windows7Guest.toString());
+		s_mapper.put("Windows 7 (64-bit)", VirtualMachineGuestOsIdentifier.windows7_64Guest.toString());
+
+		s_mapper.put("Windows 2000 Professional", VirtualMachineGuestOsIdentifier.win2000ProGuest.toString());
+		s_mapper.put("Windows 2000 Server", VirtualMachineGuestOsIdentifier.win2000ServGuest.toString());
+		s_mapper.put("Windows 2000 Server SP4 (32-bit)", VirtualMachineGuestOsIdentifier.win2000ServGuest.toString());
+		s_mapper.put("Windows 2000 Advanced Server", VirtualMachineGuestOsIdentifier.win2000AdvServGuest.toString());
+
+		s_mapper.put("Windows Server 2003 Enterprise Edition(32-bit)", VirtualMachineGuestOsIdentifier.winNetEnterpriseGuest.toString());
+		s_mapper.put("Windows Server 2003 Enterprise Edition(64-bit)", VirtualMachineGuestOsIdentifier.winNetEnterprise64Guest.toString());
+		s_mapper.put("Windows Server 2008 R2 (64-bit)", VirtualMachineGuestOsIdentifier.winLonghorn64Guest.toString());
+		s_mapper.put("Windows Server 2003 DataCenter Edition(32-bit)", VirtualMachineGuestOsIdentifier.winNetDatacenterGuest.toString());
+		s_mapper.put("Windows Server 2003 DataCenter Edition(64-bit)", VirtualMachineGuestOsIdentifier.winNetDatacenter64Guest.toString());
+		s_mapper.put("Windows Server 2003 Standard Edition(32-bit)", VirtualMachineGuestOsIdentifier.winNetStandardGuest.toString());
+		s_mapper.put("Windows Server 2003 Standard Edition(64-bit)", VirtualMachineGuestOsIdentifier.winNetStandard64Guest.toString());
+		s_mapper.put("Windows Server 2003 Web Edition", VirtualMachineGuestOsIdentifier.winNetWebGuest.toString());
+		s_mapper.put("Microsoft Small Bussiness Server 2003", VirtualMachineGuestOsIdentifier.winNetBusinessGuest.toString());
+
+		s_mapper.put("Windows Server 2008 (32-bit)", VirtualMachineGuestOsIdentifier.winLonghornGuest.toString());
+		s_mapper.put("Windows Server 2008 (64-bit)", VirtualMachineGuestOsIdentifier.winLonghorn64Guest.toString());
+
+		// Window 8 support hack to avoid upgrading to newer version of VMWare SDK.
+	    s_mapper.put("Windows 8", "windows8Guest");
+	    s_mapper.put("Windows 8 (64 bit)", "windows8_64Guest");
+	    s_mapper.put("Windows 8 Server (64 bit)", "windows8Server64Guest");
+
+		s_mapper.put("Open Enterprise Server", VirtualMachineGuestOsIdentifier.oesGuest.toString());
+
+		s_mapper.put("Asianux 3(32-bit)", VirtualMachineGuestOsIdentifier.asianux3Guest.toString());
+		s_mapper.put("Asianux 3(64-bit)", VirtualMachineGuestOsIdentifier.asianux3_64Guest.toString());
+
+		s_mapper.put("Debian GNU/Linux 5(64-bit)", VirtualMachineGuestOsIdentifier.debian5_64Guest.toString());
+        s_mapper.put("Debian GNU/Linux 5.0 (32-bit)", VirtualMachineGuestOsIdentifier.debian5Guest.toString());
+		s_mapper.put("Debian GNU/Linux 4(32-bit)", VirtualMachineGuestOsIdentifier.debian4Guest.toString());
+		s_mapper.put("Debian GNU/Linux 4(64-bit)", VirtualMachineGuestOsIdentifier.debian4_64Guest.toString());
+
+		s_mapper.put("Novell Netware 6.x", VirtualMachineGuestOsIdentifier.netware6Guest.toString());
+		s_mapper.put("Novell Netware 5.1", VirtualMachineGuestOsIdentifier.netware5Guest.toString());
+
+		s_mapper.put("Sun Solaris 10(32-bit)", VirtualMachineGuestOsIdentifier.solaris10Guest.toString());
+		s_mapper.put("Sun Solaris 10(64-bit)", VirtualMachineGuestOsIdentifier.solaris10_64Guest.toString());
+		s_mapper.put("Sun Solaris 9(Experimental)", VirtualMachineGuestOsIdentifier.solaris9Guest.toString());
+		s_mapper.put("Sun Solaris 8(Experimental)", VirtualMachineGuestOsIdentifier.solaris8Guest.toString());
+
+		s_mapper.put("FreeBSD (32-bit)", VirtualMachineGuestOsIdentifier.freebsdGuest.toString());
+		s_mapper.put("FreeBSD (64-bit)", VirtualMachineGuestOsIdentifier.freebsd64Guest.toString());
+
+		s_mapper.put("SCO OpenServer 5", VirtualMachineGuestOsIdentifier.otherGuest.toString());
+		s_mapper.put("SCO UnixWare 7", VirtualMachineGuestOsIdentifier.unixWare7Guest.toString());
+
+		s_mapper.put("SUSE Linux Enterprise 8(32-bit)", VirtualMachineGuestOsIdentifier.suseGuest.toString());
+		s_mapper.put("SUSE Linux Enterprise 8(64-bit)", VirtualMachineGuestOsIdentifier.suse64Guest.toString());
+		s_mapper.put("SUSE Linux Enterprise 9(32-bit)", VirtualMachineGuestOsIdentifier.suseGuest.toString());
+		s_mapper.put("SUSE Linux Enterprise 9(64-bit)", VirtualMachineGuestOsIdentifier.suse64Guest.toString());
+		s_mapper.put("SUSE Linux Enterprise 10(32-bit)", VirtualMachineGuestOsIdentifier.suseGuest.toString());
+		s_mapper.put("SUSE Linux Enterprise 10(64-bit)", VirtualMachineGuestOsIdentifier.suse64Guest.toString());
+		s_mapper.put("SUSE Linux Enterprise 10(32-bit)", VirtualMachineGuestOsIdentifier.suseGuest.toString());
+		s_mapper.put("Other SUSE Linux(32-bit)", VirtualMachineGuestOsIdentifier.suseGuest.toString());
+		s_mapper.put("Other SUSE Linux(64-bit)", VirtualMachineGuestOsIdentifier.suse64Guest.toString());
+
+		s_mapper.put("CentOS 4.5 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 4.6 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 4.7 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 4.8 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 5.0 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 5.0 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest.toString());
+		s_mapper.put("CentOS 5.1 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 5.1 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest.toString());
+		s_mapper.put("CentOS 5.2 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 5.2 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest.toString());
+		s_mapper.put("CentOS 5.3 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 5.3 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest.toString());
+		s_mapper.put("CentOS 5.4 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 5.4 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest.toString());
+		s_mapper.put("CentOS 5.5 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 5.5 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest.toString());
+		s_mapper.put("CentOS 5.6 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 5.6 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest.toString());
+		s_mapper.put("CentOS 6.0 (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("CentOS 6.0 (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest.toString());
+		s_mapper.put("Other CentOS (32-bit)", VirtualMachineGuestOsIdentifier.centosGuest.toString());
+		s_mapper.put("Other CentOS (64-bit)", VirtualMachineGuestOsIdentifier.centos64Guest.toString());
+
+		s_mapper.put("Red Hat Enterprise Linux 2", VirtualMachineGuestOsIdentifier.rhel2Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 3(32-bit)", VirtualMachineGuestOsIdentifier.rhel3Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 3(64-bit)", VirtualMachineGuestOsIdentifier.rhel3_64Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 4(32-bit)", VirtualMachineGuestOsIdentifier.rhel4Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 4(64-bit)", VirtualMachineGuestOsIdentifier.rhel4_64Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 6(32-bit)", VirtualMachineGuestOsIdentifier.rhel6Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 6(64-bit)", VirtualMachineGuestOsIdentifier.rhel6_64Guest.toString());
+
+		s_mapper.put("Red Hat Enterprise Linux 4.5 (32-bit)", VirtualMachineGuestOsIdentifier.rhel4Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 4.6 (32-bit)", VirtualMachineGuestOsIdentifier.rhel4Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 4.7 (32-bit)", VirtualMachineGuestOsIdentifier.rhel4Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 4.8 (32-bit)", VirtualMachineGuestOsIdentifier.rhel4Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5.0(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5.0(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5.1(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5.1(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5.2(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5.2(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5.3(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5.3(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5.4(32-bit)", VirtualMachineGuestOsIdentifier.rhel5Guest.toString());
+		s_mapper.put("Red Hat Enterprise Linux 5.4(64-bit)", VirtualMachineGuestOsIdentifier.rhel5_64Guest.toString());
+
+		s_mapper.put("Ubuntu 8.04 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest.toString());
+		s_mapper.put("Ubuntu 8.04 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest.toString());
+		s_mapper.put("Ubuntu 8.10 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest.toString());
+		s_mapper.put("Ubuntu 8.10 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest.toString());
+		s_mapper.put("Ubuntu 9.04 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest.toString());
+		s_mapper.put("Ubuntu 9.04 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest.toString());
+		s_mapper.put("Ubuntu 9.10 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest.toString());
+		s_mapper.put("Ubuntu 9.10 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest.toString());
+		s_mapper.put("Ubuntu 10.04 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest.toString());
+		s_mapper.put("Ubuntu 10.04 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest.toString());
+		s_mapper.put("Ubuntu 10.10 (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest.toString());
+		s_mapper.put("Ubuntu 10.10 (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest.toString());
+		s_mapper.put("Other Ubuntu (32-bit)", VirtualMachineGuestOsIdentifier.ubuntuGuest.toString());
+		s_mapper.put("Other Ubuntu (64-bit)", VirtualMachineGuestOsIdentifier.ubuntu64Guest.toString());
+
+		s_mapper.put("Other 2.6x Linux (32-bit)", VirtualMachineGuestOsIdentifier.other26xLinuxGuest.toString());
+		s_mapper.put("Other 2.6x Linux (64-bit)", VirtualMachineGuestOsIdentifier.other26xLinux64Guest.toString());
+		s_mapper.put("Other Linux (32-bit)", VirtualMachineGuestOsIdentifier.otherLinuxGuest.toString());
+		s_mapper.put("Other Linux (64-bit)", VirtualMachineGuestOsIdentifier.otherLinux64Guest.toString());
+
+		s_mapper.put("Other (32-bit)", VirtualMachineGuestOsIdentifier.otherGuest.toString());
+		s_mapper.put("Other (64-bit)", VirtualMachineGuestOsIdentifier.otherGuest64.toString());
 	}
-	
-	public static VirtualMachineGuestOsIdentifier getGuestOsIdentifier(String guestOsName) {
+
+	public static String getGuestOsIdentifier(String guestOsName) {
 		return s_mapper.get(guestOsName);
 	}
 }


Mime
View raw message