Sunday, November 20, 2011

VM search

grep -i vmname hostd* | less
/vmname
grep -H -r vmname /vmfs/volume/*/*.vmx  would give the entires of vm which
are resgestered but not named on backened.
vmware-cmd -l|grep -i vmname
vm-support -l| grep -i vmname
vm-support -x |grep -i vmname
ps auxww | grep -i vmname

Sunday, November 13, 2011

VM Resource Management

Respurce management in VM:

Memoery  Reservation:
Dedicated amount of pyscial memeory  for a VM all the time.It is the min amount of RAM required for VM to power on. If the reservation is not set vkernal uses Vmkernal Swap rather than the physical memeory which would degrade the performance of VM but the VM is powered on.
Once the memeory is reservered it can not be reclamied or used by other vm's or hypervisor.Only transperent page sharing can be used with memory reservation.
Memory resrvation incsrease SWAP file size decreases.Number of VCPU and Configured memoery determine the overhead.A Host has 4 GB of moeoery and you allocate 1 GB reservation to 4 VM's then you can not overcommit meoery since you have reserved all the memeory.
-------------------------------------------------------------------------------------------------------------
Memoery Limit:
The Key problem with the use of memory limits is thta they are enforced without aby guest OS awareness.
If a VM is configured  4GB of RAM guest OS thinks it has 4 GB of RAM and works accordinly .Then if you limit the memory to 2 GB the VMkernal forces the the Limit os 2GB out of 4GB and guest OS thinks it is using all 4GB and thus causing  VM disk swapping and degrades the performce

Bottamline :Vm with less memoery would perform better than VM is more moery and Memory limit.
Memeory Limit is useful in cases when you have limited resources and you want to put a host into maintence mode in such case to limit the reources of VM.

-------------------------------------------------------------------------------------------------------------

Memoery Share :
Unlike memory limit and reservation .Memoery share would only come into effect when the ESXi is memoery constraint.VM with more share vlaue would get the preference in such cases.
Some people orgue that memeory share can be achived by memeory reservation yes they are correct but you are commiting the moemeory and thus limiting the number of VM's per host.
------------------------------------------------------------------------------------------------
Cpu reservation :
CPU reservation is smiliar to memoery reservation but differ in one accept that memeory reserved can never be reclaimed ,page to disk and shared memmory but CPU reservation can  use idle cpu cycles to other VM's and will be recliamed when the original VM needs it.
------------------------------------------------------------------------------------------------
Expandble Reservation in Resource pool :
Allows resource pools to barrow resources from parent host or parent resource pools only to satisfy VM reservations not to stisfy excess resource reservation.

NETIOC - > Net I/O --> DV switch -4.1 -->outgoing
stroage IOC -> datastore should be managed by single Vcenter -- > Latency --- >per disk.

Important concepts

Tranparent memeory page sharing is enabled by default and cannot be trun off (T/F) ?
False : enabled by default but you can trunoff using advanced setting on host.
service console is constantly sheduled on diffrent HECs(Hardware Execution Context HEC) (T/F) ?
false : service console does not participate in vKernal in constant sheduling and resheduling on HEC's
and remians on the same CPU at all the times.

------------------------------------------------------------------------------------------
vCPU needs to be sheduled on HEC .HEC is a thread that is sheduled on a physical processor.
vKernal shedules and resdules vCPU on diffrent HEC every 20 milliseconds with the exception of service consle
which is always sheduled on first HEC or physical CPU 0 and never chnaged.
-----------------------------------------------------------------------------------------
Ballon driver max can be set to 0-max75% default is 65% in advanced config
-----------------------------------------------------------------------------------------
Virtual machine swap file is created when it is powered on and deleted when it is powered off.
-----------------------------------------------------------------------------------------
Hyperthreading :The technology that allows for sheduling of mutilple threads on the same CPU is known as
hyperthreading
------------------------------------------------------------------------------------------
DRS cluster yellow overcommited resources
DRS cluster RED insufficent resources

DRS five start:
Most conservative :*****
ModeratelyConservative :****
Default:***
Modertely Aggressive:**
Aggresive :*
-----------------------------------------------------------------------------------------
vMotion Requirments :-
Vmotion does not work across CPU vendors
Vmotion does not work with cpu with different cpu setping or familes
Hyperthreading and cores are not relevant to vMoition
vMotion does not work cpu with diffrent multimedia instrations
NX/XD
vMotion :
When vmotion is intiated ,memoery bitmap is created to track the chnages and the process of copying the
pysical RAM from host to another begins .Quiese(cut-over) the VM and copy the contents of bit-map to destination.
vMotion and Svmotion can not be done performed at once on the VM and can be done consecutively.
-------------------------------------------------------------------------------------------------------
How can you reduce the amount of balloning the occur iside the VM ? reboot or poweroff
VM backup type ? file or image level backups.
File level backup : agent should be instaled in guest OS.
Back up VM files.VCB gives option for both files and image level backups.
VCB spports file backsup on windows-based systems and image level backups for all guest operating systems.
VCB and VDR are agerntless backup solutions
----------------------------------------------------------------------------------------
Outgoing port for HA heart beats and state synchronization
TCP 2050-2250
UDP 2050-2250
incomming port for HA and state sync
TCP 8042-8045
udp 8042-8045
----------------------------------------------------------------------------------------
HA concept:
Memeber of cluster send the heart beat every 1sec  in 4.0 and 10 sec in 10sec in 4.1.
When the other host does not respond for 15 sec the cluster intiates the VM restarts on other boxes.
DNS resolutions should work in all the hosts in cluster.
host isolation :split brain occurs when the host stoped reciving the heart beat in a HA.