Pages

Showing posts with label Vmware. Show all posts
Showing posts with label Vmware. Show all posts

Wednesday, 29 August 2012

Error: Unable to contact the Hypervisor

Please check out www.kaztechsolutions.co.uk for more of my technical posts, alternately please call us on 01932 268289. 

I came across this error recently when doing a POC for XenDesktop on Vmware ESXi 5.

Error: Unable to contact the hypervisor. Check that the address, user name, and password are correct; the Controller and hypervisor are connected; and the SSL certificates have been set up correctly if you are using HTTPS.




To get around this issue I had to change the Proxy.xml file located on the Virtual Center to accept HTTP communication which is located in the following directory


C:\ProgramData\VMware\VMware VirtualCenter\proxy.xml


Find the following sections of the XML file and change them from "httpWithRedirect" to "httpAndHttps"



Now from the knowledge base article its a tad confusing which part of the xml file you need to change, ignore the id= part and just look for "/" and change the access mode and also look for "/sdk"and change the access mode.


http://support.citrix.com/article/CTX125578

Tuesday, 25 October 2011

Find memory/CPU reservation on all VMs

To retrieve the settings for reservation of both memory and CPU run the following PS script

## retrieve the values for MemReservationMB for the given VMs
Get-Cluster "myCluster" | Get-VM | Get-VMResourceConfiguration | select VM,MemReservationMB


## retrieve the values for CPUReservationMhz for the given VMs
Get-Cluster "myCluster" | Get-VM | Get-VMResourceConfiguration | select VM,CPUReservationMhz


If you want to go through a set all VM memroyCPU reservations to "0" run the following

## set the MemReservationMB to 0 for given VMs
Get-Cluster "myCluster" | Get-VM | Get-VMResourceConfiguration | Set-VMResourceConfiguration -MemReservationMB 0 -Confirm:$false


## set the CPUReservationMhz to 0 for given VMs
Get-Cluster "myCluster" | Get-VM | Get-VMResourceConfiguration | Set-VMResourceConfiguration -CPUReservationMhz 0 -Confirm:$false

Tuesday, 4 October 2011

VMware PS Script to export Datastores Information

Get-View -ViewType Datastore | %{
$_ | Select Name,
@{N="Location";E={$_.Summary.Url}},
@{N="Type";E={$_.Summary.Type}},
@{N="Hosts Connected";E={$_.Host.Count}},
@{N="VMs Connected";E={$_.Vm.Count}},
@{N="Capacity";E={"{0:n2} GB"-f ($_.Summary.Capacity/1GB)}},
@{N="Provisioned";E={"{0:n2} GB"-f (($_.Summary.Capacity - $_.Summary.FreeSpace + $_.Summary.Uncommitted)/1GB)}},
@{N="Free";E={"{0:n2} GB"-f ($_.Summary.FreeSpace/1GB)}}
} | Export-csv ("c:\VMreports\Datastore-"+$a+".csv")

Friday, 15 July 2011

The MAC address challenge – XenDesktop on vSphere

http://blogs.citrix.com/2011/07/09/the-mac-address-challenge-xendesktop-on-vsphere/

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1024025

Wednesday, 11 May 2011

ESXTOP logging to Windows File share

1. Create a share on a windows server.

2. Create a local user on the same server and give them full access to the share you just created.

3. On your ESX server enable SMB client (ports tcp:137-139,445) on your ESX firewall so that you can reach your windows share.














4. Logon your console or Putty with root user and create a new folder to store your .csv results.
mkdir /mnt/logging

5. To create the Windows mount point
mount -t cifs //Servername/ESXLogging /mnt/logging -o username=ESXLogging,password=L0gging

6. After you have setup the above you now need to run ESXTOP and point it to the mount point.
esxtop -b -d 10 -n 77760 >/mnt/logging/ESXSERVER_DATE.csv

A good online reference for this is http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=242.

Monday, 15 March 2010

vpxd.cfg Advanced Configuration

The vpxd.cfg is an XML formatted file which can be modified to alter the behaviour of the VMware vCenter Server.



The vpxd.cfg file is located by default at %ALLUSERPROFILE%\Application Data\VMware\VMware VirtualCenter\vpxd.cfg
  • On Windows Server 2008, this would generally be C:\ProgramData\VMware\VMware VirtualCenter\vpxd.cfg
  • On Windows Server 2003, this would generally be C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\vpxd.cfg
Remember to restart the VMware VirtualCenter Server service in the Server Manager for changes to vpxd.cfg to take effect.

Tag:  blockingTimeoutSeconds
Nested In:  vmomi, soapStubAdapter
What It Does:  Defines the timeout value in seconds for SOAP layer blocking.  Use cases for increasing: slow connections, low bandwidth, or high latency between virtual infrastructure components.  Read more here and here.
Example:
< vmomi> 
< soapStubAdapter> 
< blockingTimeoutSeconds> 10800< /blockingTimeoutSeconds> 
< /soapStubAdapter> 
< /vmomi> 

Tag:  calls
Nested In:  trace, vmomi
What It Does:  Unknown.  Read more here.
Example:
< trace> 
< vmomi> 
< calls> true< /calls> 
< /vmomi> 
< /trace> 

Tag:  cipherList
Nested In:  vmacore, ssl
What It Does:  Reverts to cipher suites used in previous versions of vCenter Server (2.5u3 and earlier) for browser/SSL compatibility issues.  Read more here.
Example:
< vmacore> 
< ssl> 
< cipherList> DEFAULT< /cipherList> 
< /ssl> 
< /vmacore> 

Tag:  compressOnRoll
Nested In:  log
What It Does:  Defines whether or not vCenter Server vpxd log files are rolled up and compressed into .gz files.  Read more here.
Example:
< log> 
< compressOnRoll> false< /compressOnRoll> 
< /log> 

Tag:  cpuFeatureMask
Nested In:  guestOSDescriptor, esx-2-x-x, all-versions, all-guests
What It Does:  Masks CPU features to force VMotion compatibility between hosts. VMware neither supports nor recommends modifying the VMotion constraints for CPU features.  Read more here.
Example:

< guestOSDescriptor> 
< esx-2-x-x> 
< all-versions> 
< all-guests> 
< cpuFeatureMask> Elements and mask definition go in here< /cpuFeatureMask> 
< /all-guests> 
< /all-versions> 
< /esx-2-x-x> 
< /guestOSDescriptor> 

Tag:  directory
Nested In:  log
What It Does:  Defines the location for the vCenter logs.  Read more here.
Example:
< log> 
< directory> D:\VC_Logs< /directory> 
< /log> 

Tag:  dontstartconsolidation
Nested In:  vcp2v
What It Does:  May resolve an issue where the Consolidation button is missing in the Virtual Infrastructure Client.  Read more here.
Example:
< vcp2v> 
< dontstartconsolidation> true< /dontstartconsolidation> 
< /vcp2v> 

Tag:  filterOverheadLimitIssues
Nested In:  vpxd
What It Does:  Unknown.
Example:
< vpxd> 
< filterOverheadLimitIssues> true< /filterOverheadLimitIssues> 
< /vpxd> 

Tag:  hostRescanFilter
Nested In:  unknown
What It Does:  Defines the behavior of mass ESX(i) host rescans of vmHBAs.  Read more here.
Example:
< hostRescanFilter> true< /hostRescanFilter> 

Tag:  IoMax
Nested In:  vmacore, threadpool
What It Does:  Unknown but my guess is it defines the maximum I/O for the vpxd.exe process (vCenter Server service). Influenced by TaskMax.
Example:
< vmacore> 
< threadpool> 
< IoMax> 200< /IoMax> 
< /threadpool> 
< /vmacore> 

Tag:  level
Nested In:  log
What It Does:  Defines the logging level for vCenter logs.  Read more here.
Example:
 < log> 
< level> trivia< /level> 
< /log> 

Tag:  logLevel
Nested In:  trace, vmomi
What It Does:  Enables debug logging level for vmomi?  Read more here.
Example:
< trace> 
< vmomi> 
< logLevel> verbose< /logLevel> 
< /vmomi> 
< /trace> 

Tag:  loglevel
Nested In:  nfc
What It Does:  Enables debug logging level for the NFC process.  Read more here.
Example:
< nfc> 
< loglevel> debug< /loglevel> 
< /nfc> 

Tag:  managedIP
Nested In:  unknown
What It Does:  Defines the managed IP address used in vCenter Server Heartbeat.  Read more here.
Example:
< managedIP> 10.10.0.1< /managedIP> 

Tag:  maxCostPerHost
Nested In:  ResourceManager
What It Does:  Defines the number of simultaneous VM migrations (both hot and cold) per ESX(i) host.  Read more here.
Example:
< ResourceManager> 
< maxCostPerHost> 8< /maxCostPerHost> 
< /ResourceManager> 

Tag:  maxFileNum
Nested In:  log
What It Does:  Defines the maximum number of log files for vCenter logs.  Read more here.
Example:
< log> 
< maxFileNum> 50< /maxFileNum> 
< /log> 

Tag:  maxFileSize
Nested In:  log
What It Does:  Defines the maximum log file size in Bytes and thus rollover interval for vCenter logs.  Read more here.
Example:
< log> 
< maxFileSize> 10485760< /maxFileSize> 
< /log> 

Tag:  name
Nested In:  log
What It Does:  Defines the log file prefix name for vCenter logs.  Read more here.
Example:
< log> 
< name> vpxd< /name> 
< /log> 

Tag:  notRespondingTimeout
Nested In:  heartbeat
What It Does:  Defines the heartbeat timeout value in seconds between ESX(i) hosts and vCenter Server.  Use case would be to increase the value if remote ESX(i) hosts frequently go into a not responding state in vCenter Server due to WAN bandwidth or latency issues.  Read more here.
Example:
< heartbeat> 
< notRespondingTimeout> 60< /notRespondingTimeout> 
< /heartbeat> 

Tag:  portReserveTimeout
Nested In:  dvs
What It Does:  Defines the timeout value in minutes for unused dvPort reservations.  Lowering the value temporarily is helpful for unlocking dvPorts to remove a vDS or dvPort group.  Read more here.
Example:
< dvs> 
< portReserveTimeout> 10< /portReserveTimeout> 
< /dvs> 

Tag:  serializeadds
Nested In:  vpxd, das
What It Does:  Unknown but if I had to guess I’d say it defines the behavior of how the HA agent is installed on cluster hosts.
Example:
< vpxd> 
< das> 
< serializeadds> true< /serializeadds> 
< /das> 
< /vpxd> 

Tag:  slotCpuMinMHz
Nested In:  vpxd, das
What It Does:  Defines the minimum CPU calculation of a HA cluster slot size when there are no CPU reservations. Read more here.
Example:
< vpxd> 
< das> 
< slotCpuMinMHz> 256< /slotCpuMinMHz> 
< /das> 
< /vpxd> 

Tag:  slotMemMinMB
Nested In:  vpxd, das
What It Does:  Defines the minimum memory calculation of a HA cluster slot size when there are no memory reservations. Read more here.
Example:
< vpxd> 
< das> 
< slotMemMinMB> 0< /slotMemMinMB> 
< /das> 
< /vpxd> 

Tag:  sspiProtocol
Nested In:  unknown
What It Does:  Defines the authentication mechanism used with passthrough authentication between the Virtual Infrastructure Client and vCenter Server.  Read more here.
Example:
< sspiProtocol> Kerberos< /sspiProtocol> 

Tag:  TaskMax
Nested In:  vmacore, threadpool
What It Does:  Defines the number of worker threads for the vpxd.exe process (vCenter Server service). Influences IoMax.
Example:
< vmacore> 
< threadpool> 
< TaskMax> 30< /TaskMax> 
< /threadpool> 
< /vmacore> 

Tag:  timeout
Nested In:  task
What It Does:  Defines the timeout value in seconds for long tasks.  Read more here.
Example:
< task> 
< timeout> 10800< /timeout> 
< /task> 

Tag:  verbose
Nested In:  trace, db
What It Does:  Enables database tracing.  Enables database logging in the vpxd log.  Read more here and here.
Example:
< trace> 
< db> 
< verbose> true< /verbose> 
< /db> 
< /trace> 

Tag:  verbosity
Nested In:  trace, vmomi
What It Does:  Unknown.  Read more here.
Example:
< trace> 
< vmomi> 
< verbosity> verbose< /verbosity> 
< /vmomi> 
< /trace> 

Tag:  verboseObjectSize
Nested In:  trace, vmomi
What It Does:  Unknown.  Read more here.
Example:
< trace> 
< vmomi> 
< verboseObjectSize> 40< /verboseObjectSize> 
< /vmomi> 
< /trace> 

Tag:  VMOnVirtualIntranet
Nested In:  migrate, test, CompatibleNetworks
What It Does:  Setting to false enables VMotion for VMs connected to an internal vSwitch. Setting to false will turn off the internal vSwitch restriction on VMotion events. Useful for servers behind a firewall virtual appliance deployed in bridged networking mode.  Read more here.
Example:
< migrate> 
< test> 
< CompatibleNetworks> 
< VMOnVirtualIntranet> false< /VMOnVirtualIntranet> 
< /CompatibleNetworks> 
< /test> 
< /migrate> 

Tag:  VMOverheadGrowthLimit
Nested In:  cluster
What It Does:  Defines the growth rate cap in terms of MB per minute for VM memory overhead at the cluster level. Can be adjusted to resolve high CPU utilization in guest VMs introduced in ESX(i) 3.5 and vCenter 2.5.  Read more here.
Example:
< cluster> 
< VMOverheadGrowthLimit> 5< /VMOverheadGrowthLimit> 
< /cluster> 
 
Slightly related, the vCenter Server process (vpxd.exe) can be launched at a command prompt on the vCenter Server (instead of starting as a service) for troubleshooting purposes.  The executable is located at:

< Install Directory> \VMware\Infrastructure\VirtualCenter Server> vpxd.exe

Usage: vpxd.exe [FLAGS]
Flags:
-r Register VMware VirtualCenter Server
-u Unregister VMware VirtualCenter Server
-s Run as a standalone server rather than a Service
-c Print vmdb schema to stdout
-b Recreate database repository
-f cfg Use the specified file instead of the default vpxd.cfg
-l licenseKey Store license key in ldap and assign it to VirtualCenter
-e feature Set the feature to be in use for VirtualCenter. This option takes only one feature at a time.
-p Reset the database password
-v Print the version number to stdout

Monday, 22 February 2010

Helpful ESX file paths


Check the following file (could be multiple secure logs followed with a .1, .2 etc) for logging in details in to the Service Console.

/var/log/secure




Check the following file if you like to see the iSCSI session, connection information.

/proc/scsi/vmkiscsi/1


If you are having VMKernel issues look in the following file at the exact same time that the error happen.


/var/log/vmkernel

Thursday, 11 February 2010

Understanding VMware Fault Tolerance

VMware Fault Tolerance (FT) provides continuous availability for applications by creating a live shadow instance of a virtual machine that is in virtual lock-step with the primary instance. By allowing instantaneous failover between the two instances in the event of hardware failure, VMware Fault Tolerance eliminates even the smallest of data loss or disruption.


VMware Fault Tolerance (FT) works by creating an identical copy of a virtual machine. One copy of the virtual machine, called the primary, is in an active state, receiving requests, serving information and running applications. Another copy, called the secondary, receives the same input that is received by the primary.

In an FT environment, one virtual machine runs as a primary and FT runs a secondary virtual machine on a different ESX host. The secondary virtual machine shares the primary's virtual disks. The virtual machines are kept in lock-step via logging information sent over a private network connection. The primary is the sender of this logging information and the secondary only listens. FT is based on VMware Record/Replay technology.


In the event that the primary's ESX host fails, the secondary virtual machine takes over without interrupting applications.
VMware FT provides more continuity than VMware HA because FT does not require a virtual machine restart and the secondary virtual machine immediately comes online with all, or almost all state information preserved.
Virtual machines protected by FT are not handled by VMware HA for restart priority. It is considered disabled in the restart priority.


Determining Node Failure
VMware FT uses network heartbeats to determine when primary and backup hosts are down. Backup goes live and becomes the new primary if it declares the current primary dead.
FT uses an atomic operation on the shared VMFS to distinguish between a failed host from a network failure.

VMware FT Migration Transition States
VMware FT tracks failover operations with a variety of states. For more information on transition states, see - VMware Fault tolerance migration transition states (1010634).

Friday, 5 February 2010

VMotion a VM with a Internal Network

I've always been under the impression that you could never VMotion a VM that has an active connection to an internal switch (with no link to any pNIC), but you actuall can. In order to do it, you have to add some particular lines in the vpxd.cfg file on the VitualCenter Server itself.

Edit

C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\vpxd.cfg

and add the following lines to the bottom of the cfg file.

< test >
< compatiblenetworks >
< vmonvirtualintranet >false< /vmonvirtualintranet >
< /compatiblenetworks>
< /test >
< /migrate >


You have to create this section at the end of the vpxd.cfg file but still in the section.

Note: This is not supported by VMware but is very handy and you also need to remove the spaces in the < >!

Thursday, 4 February 2010

ESXTOP

Esxtop allows monitoring and collection of data for all system resources: CPU, memory, disk and network.
Understanding all the information in esxtop can seem like quiet a lot to take it at first but once you use esxtop and understand all the information you wont stop using it.

The following keys are the ones I use the most.
open console session or ssh to ESX(i) and type:
esxtop

By default the screen will be refreshed every 5 seconds, change this by typing:
s 2

Changing views is easy type the following keys for the associated views:
c = cpu 
m = memory 
n = network 
i = interrupts 
d = disk adapter 
u = disk device 
v = disk VM

To Ad/Remove fields:
:f

Changing the order:
o

Saving all the settings you’ve changed:
W
To capture the information and export it to a CSV use the following command:
esxtop -b -d 2 -n 100> esxtopcapture.csv

Where “-b” stands for batch mode, “-d 2″ is a delay of 2 seconds and “-n 100″ are 100 iterations. In this specific case esxtop will log all metrics for 200 seconds.

Help:?

here are a few of the metric thresholds that i use


DisplayMetricThresholdExplanation
CPU%RDY10Overprovisioning of vCPUs, excessive usage of vSMP or a limit(check %MLMTD) has been set. See Jason’s explanation for vSMP VMs
CPU%CSTP100Excessive usage of vSMP. Decrease amount of vCPUs for this particular VM. This should lead to increased scheduling opportunities.
CPU%MLMTD0If larger than 0 the world is being throttled. Possible cause: Limit on CPU.
CPU%SWPWT1VM waiting on swapped pages to be read from disk. Possible cause: Memory overcommitment.
CPUTIMER/S (H)1000High timer-interrupt rate. It may be possible to reduce this rate and thus reduce overhead. The amount of overhead increases with the number of vCPUs assigned to a VM.
MEMMCTLSZ (I)1If larger than 0 host is forcing VMs to inflate balloon driver to reclaim memory as host is overcommited.
MEMSWCUR (J)1If larger than 0 host has swapped memory pages in the past. Possible cause: Overcommitment.
MEMSWR/s (J)1If larger than 0 host is actively reading from swap(vswp). Possible cause: Excessive memory overcommitment.
MEMSWW/s (J)1If larger than 0 host is actively writing to swap(vswp). Possible cause: Excessive memory overcommitment.
MEMN%L (F)80If less than 80 VM experiences poor NUMA locality. If a VM has a memory size greater than the amount of memory local to each processor, the ESX scheduler does not attempt to use NUMA optimizations for that VM and “remotely” uses memory via “interconnect”.
NETWORK%DRPTX1Dropped packages transmitted, hardware overworked. Possible cause: very high network utilization
NETWORK%DRPRX1Dropped packages received, hardware overworked. Possible cause: very high network utilization
DISKGAVG (H)25Look at “DAVG” and “KAVG” as the sum of both is GAVG.
DISKDAVG (H)25Disk latency most likely to be caused by array.
DISKKAVG (H)5Disk latency caused by the VMkernel, high KAVG usually means queuing. Check “QUED”.
DISKQUED (F)1Queue maxed out. Possibly queue depth set to low. Check with array vendor for optimal queue depth value.
DISKABRTS/s (K)1Aborts issued by guest(VM) because storage is not responding. For Windows VMs this happens after 60 seconds by default. Can be caused for instance when paths failed or array is not accepting any IO for whatever reason.
DISKRESETS/s (K)1The number of commands reset per second.
For a more detailed view over ESXTOP read the followign VMware article.