VMWare cheatsheet

Table of Contents

Running Vmware console from command line

Got this from http://www.glenbecker.com/2011/03/launching-vmware-remote-console-from-a-batch-script/

C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\4.0\vmware-vmrc -h <host addr/ip> "[datastore] machdir/mach.vmx"

Linux:
vmware-vmrc -h [] [-u -p ] [-M | ]

Windows:
vmware-vmrc.exe -h [-u -p ] -M |

MOID are in vmInventory.xml in /etc/vmware/hostd/ under Linux or %ALLUSERSPROFILE%\Application Data\VMware\VMware Server\hostd under Windows.

Running vsphere client from command line

C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient -h <hostname\ipaddr>

C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe. -passthroughAuth -s %VCservername%.


This allows you to passthrough your logged-on username credentials.

terms

vSphere 5 licensing / editions / kits

vCenter Server

editions

install and sizing notes

Can no longer install Guided Consolidation or Converter.
Choose correct size for vCenter JVM and change after install via http://kb.vmware.com/kb/1039180.
You can size via Administration / vCenter Server Settings in vCenter Server Settings Statistics window,
or via www.vmware.com/support/vsphere4/doc/vsp_4x_db_calculator_oracle.xls (oracle)
or via www.vmware.com/support/vsphere4/doc/vsp_4x_db_calculator.xls (MS SQL)

bundled SQL2K8R2Express can handle up to 5 hosts and 5 virtual machines in inventory.
max size is 10GB
Cannot be installed as part of vCenter Server upgrade (latter needs to be manually
installed prior to running vCenter Server Installer

Reqs

default pw

root/vmware

vSPhere Client

Can manage ESXi hosts and vCenter Server instances.
suggest getting from vcenter.domain.com or ESXi.domain.com where domain.com is your domain

vSphere Web Client

cross-platform web app that allows you to connect to vCenter Svr to manage ESXi host (no direct connect to ESXi host)
useful if you are not using Windows OS
Cannot connect directly to ESXi host
licensing report says what RAM utilization is
suggest registering URL of vCenter Server as https://vcenter.domain.com where domain.com is your domain
access vSphere Web Client from http://vcenter.domain.com where domain.com is your domain. *** well suited for help desk, op cntr, virt mach owners, non-windows users

Reqs

membership in admin group on system
64-bit OS
IE7, IE8, Firefox 3.6+
Flash Player 10.1.0+

vSphere Client Plug-ins

registered with vCenter Server, available to vSphere client
verify enabled via Plug-ins menu in vSphere Client/Manage Plug-ins
examples

Licensing

25 chars grouped 5 at a time separated by dashes
soft licenses allow ops that would result in exceding licenses cap. hard licenses do not.
if ESX/ESXi 3.5 hosts to be managed, separate license svr req to supp theses hosts
upgrading from vSphere 4 to vSphere 5 requires new license
from vCenter Svr (via vSPhere Client) - Home / Administration options / Licenses / Management tab

vSphere/vCenter Availability reqs

Installing vCenter in virt mach allows entire image to be backed up
With exception of vSPhere Essentials, all versions can leveaage HA and vMotion
Enterprise and Enterprise plus can also leverage VMware Distributed Resource Scheduler (DRS)
Clustering vCenter Server using Microsoft Cluster Services (MSCS) or Veritas Cluster Services (VCS) can provide HA to vCenter Server

ESXi

bare-metal hypervisor used to run virt machines on x86 hw.

Installing manually

Installing using auto-deploy

additional cfg steps

NTP on ESXi host

From vSphere client, connect to ESXi host or vCenter Server managing host
select ESXi host, click cfg tab in right pane, choose Time Cfg link in software panel, click Propertieslink, manually set time and date, select NTP client enabled, click options button to put in NTP server (s), restart NTP service, for general settings of NTP Daemon Otpoins, select Start Automatically if any ports are open, and stop when all ports are closed.

DNS and routing

Inventory screen, select host, click cfg link, choose DNS and ROuting from software panel, click properties link to modify, modify DNS entries in DNS COnfiguration tab (if necessary), click routing tab, change default gw if necessary, update DNS or IP Route Cfg tsk may start, wait until complete.

You can also configure DNS and routing from ESXi Direct Console User Interface (DCUI).

CLASS

VCenter preferable

Terms

Thinking about taking vcp5

www.vmware.com -

Sizing

minimum - 64-bit x86 CPU,2GB RAM, 1 or more ethernetVCP4 8 cpus vcp5 32 cpus
assume we don't enable hyperthreading on box
Virtual machine -

Easy to move/copy files
easy to manage virtual machines insulated fom hw chgs
provides ability to support legacy apps
allows svr to be consolidated
ESXI 5.0 supports 160 LCPUs EXAM QUESTION

Configuring machine

vSphere User Interfaces

Get vSphere CLient from ESXi host or vCenter
- Use vCenter and remote lock down mode
Web client
enable ssh - console - remember to disable after you do work
new firewall in kernel - able to enable ssh from firewall

Logs

Export SystemLogs

ESxi overview

Comin Info Mgmt (hw mgmt)
Virtual Machine Module (VMM)

Phys mach - Disks NICs, HD, RAM
1 vCPU
gets scheduled by kernel
VMM - virtual machine manager
newere processes - recognize virtualization
Windows uses pages active, free, idle
Memory Mgmt Unit - MMU - EXAM QUESTION

vnic ties to vsw ties to phys nic
vSCSI works with HBA and SAN or HD

DCUI

F2 from console
VCenter will create vpxuser account EXAM QUESTION

Configuration / Networking tab Firewall at Configuration \/ SecurityProfile

NTP/DNS Routing

ESXi can be NTP client

best practices
create alternate accounts for admin/root privelages

VDI subscription 100 / year

Creating Virtual Machine

recommended to keep machine name simple

Virtual Machine Hardware (v8)


Virtual Disk
stored in Server1.vmdk (description) and Server1-flat.vmdk
custom installation mode choices diskNIC
Other Devices

Custom Cfg

Virt machine version (e.g. v8)
number of cpus, number of cores per cpu and size of memory
number ofnics, network to connectto, network adapter type
SCSI controller type
whether to creatdisk use existing disk oruse raw device mapping (RDM) or use nodisk
Other disk-provisioning settings
    wther to store virt disk with virt mach or in different datastore
virt device noe (for examplw (SCSI(0:0)
Mode-independent (persistent andnonperistent

thin provisioning

Raw Device Mapping

RDM enables you to store virt machine directly on Logical unit Number (LUN)
maping file storedon VMFS datastore that points to raw LUN
(normalllly virtual disk stored on VMFS or NFS.
this allows raw LUN (e.g. NTFS or ext3 - phyxical mode compatability (direct), virtual mode compatability (vmware manages))

installing Guest OS

installing VMWare tools (adds SVGA,vmxnet,vmxnet3, balloon driver formemory mgmt,improved mouse, virt machine heartbeat, time sycnh, ability to shut down virt machine, adds additional choices to perfmondll

advise to synch time with NTP on vmware host OS
- remember that clock does not have ability to slow down when you enable.  set time ahead of time a little b
- vmware has white paper on best practices on time synch...
- when you do this - disable windows time service - kill in registry (?)

Virtual Appliance

down load OVF Templates from VA Marketplace
http://www.vmware.com//appliances

VCenter

Up to 1000 hosts managed per instances
up to 10,000 powered-on virtual machines per vCenter Server instance
linked mode (linking multiple vCenters)
up to 15,000 registered
vCenter svr has to have db (bundled sqlw2k express)
VMware vSphere Client logs into hostd daemon on host EXAMQUESTION
80 and 443 need to be open between vsphere client and vCenter ServerEXAMQUESTION
vCenter Server talks to ESXi host using vpxa user id 256 character serverEXAMQUESTION
vcenter server talks to host via vpxa daemonEXAMQUESTION
vpxa talks to hostd?

vcenter core services
addiitonal modules - update manager, orchestrator, site recofery manager, data recovery appliance
every module installed has server component and client component
initially installed modules - storage , hardware status, service status, auto deploy

inventory

root is initially created, build datacenters

sections

inventory
admin
mgmt
solutions andapplications
hosts and clusters inventory view
vms and templates inventory view
    when you create folders in one view, you don't see them in other view
datastores and datastore cluster inventory view
network inventory view
licensing - 25 char string
product, license key, asset

events

listed in events tab

Networking

VMkernel ports needed for - exam question?

MGmt - VMK0 - vswitch0
IP Storage -iSCS /NAS / FCOE
vMotion
FT

vswitch

L2 device - virtual switch
can't communicate with another virtual switch
can combine bwonmultiple net adapters andbalance traffic
some portuplink,others vmkernal,othersvirtualmachine ports
can set up vlans (8-4088 ports (120 default) exam question
TYpes
3 things show up in VM Network Properties/Securit
Security
Traffic Shaping
Load Balancing options
NIC Teaming
Detect Network failure

Storage Concepts

Disk Drive Companies

Compellent
Left Hand
Equalogic
NetApp

Considerations

Cost
Availability
Latency
BW
IOPS
Multi Pathing

PUT IN CHART 6-8
iSCSI - remote boot supported
Fibre Channel
FCoE
Direct Attached (DAS)
NAS (Use NFS not VMFS on this one)
VM -> Q -> HBA -> SAN -> LUN
Queue stacks up to 32 commands / LUN

VMFS

VMFS3
VMFS5

NFS

Storage Device Naming Conventions

Physical Storage Considerations

iSCSI

iSCSI storage system
physical HDs
-> LUNs
-> Storage processors (SPs)
-> TDCPIP net
-> HBA or iSCSI
Names
iqn (iSCSI qualified name
iqn.(year-month alias licensed).mycompany.stor1-47cf3c25
    or
eu.fedcba9876543210
iSCSI alias : stor1
ip addr : <ipadddr>

iSCSI initiator

iqn.1998-01.com.vmware:train1-64ad4c29
    or
eui.12345677890123456
iscsi alias: train1
IP addr:

Configuring

  1. Cfg VMkernel port
  2. enable sw adaptor
  3. cfg IQN and alias
  4. cfg iSCSI sw adapter properties, such as static/dynamic discovery addrs and iscsi port binding
  5. cfg iSCSI security (eg.g. CHAP)
2 discovery mehthods
- static
- Dynamic
initiator sends out SendTargets request, & get back SendTargets response over IP network (EXAM Question)
options for CHAP
HW iSCSI

NAS/NFS

NFS svr 00 NIC/ IP net - NIC - virt sw - host

create vmkernael port for better perf and security, separte from iSCSI network
Gist s and Clusters / Cfg tab / storage link
datastores view / storage views tab

multipathing

  1. cfg 1 vmkernel port
  2. use adapters tattached to same phys switch to cfg NIC teaming
  3. cfg NFS svr with mult ip addrs (can be on same sub)
  4. mult links cfg NIC teamswith IP hash load-balancing policy

Fibre Channel SAN with ESXI

storage system -> HDs - LUNS - SPs - Fibre Channel ) switches "the fabric"...
WW name (WWN) 64 bit adddr assigned to Fibre Channel node (8 bytes)

LUNs can be hidden or masked (maskedmakes LUN invisible " when target is scanned (can't do from vSphere client, can do at command prompt or sorage processor end

  1. install fibre channel adapters in ESXi host
  2. adapters are recognized by host during boot sequence

Create VMKernel port - can only have one 1 to 1 relationsihp
multipathing means need multi ways to get to dat astore
multipathing with SW FCoE (can't run over regular Ethernet switch)

VMFS Datastore

VM4 2TB Extends (32 of the) get you up to 64TB total
no extens can be 64 TB (tstill 32 of them if necessary)

Increasing size

VMS4 used to be volume grow, VMS5 expanding (withing extent)

Virtual machinepower state
multipathing algorithms

Pluggable Storage Architecture (PSA)
- NMP (NativeMultipathingPlugin)
    - SATP (Storage Array Type Plugin)
    - SATP-xx
 Mfg can create their own modules, and should work better (?)

Multi Storage Paths
- Manage Paths (choose path selection policy

VSA - vSPhere Storage Appliacne

vSphere Storage Appliance
Allows hardware on ost to be shared storage
supports vmotion HA, DRS
take localdrives,create images on other machines 1->2 2->3 3-1, etc
export these as NFS mounts
install VSA Manager in vcenter server 5.0
vsa cluster service
recommended 24GB RAM, 4 hard disks, RAID controller, Gigabit Ethernet switches
- need 2 physical nics for appliance
vsamgr ip
nfs vol ip
vmotion ip
esxi host ip
new for 5.0
need separate cluster from existing production cluster

Clones

Templates

master copy of virtual machine (never powered on)
have to convert to machine to power on.
to create - right click on virt machine and template/cloned/convert to template
clone to template can happen powered on or off, convert must be powered off
.vmtx extension
VM and templates inv vie
hosts view\to deploye - right click on template and deploy

Virtual Machine Options

VMware tools
check and upgrade tools during power cycling
Boot options

Migrating Virt Machines

max of 8 simultaneous vmotion, cloning,
Copy Comparison of Migration Types Chart
good to have separate network for vMotion from Production
- guest OS quiesc'ed (sp) during vmotion, but users will not notice...
reqs:

CPU Constraints on vmotion
To check if CPUs are similar, use VMware CPU identification utilty.

ToDo

StoragevMotion

moving between shared storage locations
  1. initiate storage migration
  2. copy data usigng VMkernel data mover or vSPhere Storage APIs - Array Integration (VAAI
  3. start virt machin process
  4. mirror IO calls to fileblocks that havealready been copied to virt disk on dst data store

Snapshots

allow preservation of state ofvirt machin so can return to same state repeatedly.
don't use for backups, every snapshop relies on parent
snapshots are differential (?)
  1. freeze flat vmdk file,keep delata vmdk file
  2. snapshot list  (.vmsd) keeps track of virt machines snapshots
you can take a snapshot whil virt machin running or suspended or powered off
delet/delete all less problem in VMWare 5.0

vApp

Remove Virtual machine

remove from inventory
delete from disk

Converter Standalone

convertvirtmachine to virt machine

roles and permissions

Reserved resources

CPU
Balloondriver can recover 65% by default
    free, than idle, than in use
if you keep reservatino at 35%, neverhave to use swap file, but ha can get messed up
FT 1GB becomes reserved

Carl Waldspurger designed memory swapping for vmware...

Resource Mgmt and Monitoring

memory

can overcommit memory due to swap and share
create a default virtual machine 384MB (swap space equals)
Virt machines power on only if

Transparent page sharing - allows pages with identical contents to bestorednly once
Baollooning mechanism, adctivewhen memory is scarce forces virtual machines use their own paging areas
memory compression - compressed to 2KBand stored in per-virtual machine compression cache

Virtual SMP

hyperthreading =- doubles # of threads or ccpus
cpu loadbalancing can load balance across threads
max is 160 logical cpus (including hyper threading

Resource Contention

Virt machine will only poweron if reservatino can be guaranteed
Shares
Chart

Resource Pool

logical abstract for hhierarchicaclly managing CPU and memory resources
used on standalong hosts or clusters
isolation between pools and sharing within pools
access control anddelegation
separation of resoruces frohw
mgmt ofsets of virt machines running on multitier svc

admission control for VM

WHere do you go to find memory info - Resource Allocation tab EXam question

Resrource monitoring

Alarms

HA

vCenterServer relies on database and AD structure
vCenter Server can be virtual or physical


in v4 vmware cluster (whole set of hosts)
leaves virtual machine powered on if it thinks othersin v5
  1. enable HA
  2. Host Montitoring sttaus
  3. Admission control (power on operations that violate availability constraints (e.g. cpu or chassis running guest OS rules)
  4. Admission control policy 
    1. (how many host failures cluster tollerate)
    2. % of cluster resources reserved as failover spare capacity
      1. slot size is avg # of resources to meet requirements (used to be 256MHz and 256 MB default) HA will monitor and look at avgCPU/Memory requirements
      2. reservations will make HA assume everyone needs this reservation size
remember can only monitor application
if doing maintenance disable host monitoring
host monitoring separate from vmware told monitoring (VM monitoring or application monitoring)
Heartbeat Datastores
master contacts vcenter for connectivity to lost vm
looks on datastore for same
can set min/max for slot size

Neverfail application copies LUNs et. al. over to new locations
vcenter svr talks to vpxa which talks to host d wand FDM(Fault Domain Mgr?)

rememeber master uses datastore heartbeats as well as machine and guest and app heartbeats
vcenter can only talk to 1 master

Fault Tolerance

Host Profiles


WHAT IS MAINTENANCE MODE?

DRS - Distributed Resource Schedule

set under cluster settings

Adding Host to Cluster

Removing host from cluster

- put host in maintenance mode

Improveing virt machin pedrf
- fine- usic taffic shaping through broad usea DRScluster,use storage multipathing

HA might no be able to fail over machines

DPM (Distributed Power Mgmt)

set under cluster setting

Distributed Switch

template that rolls out hidden standard switches
NEED ENTERPRISE PLUS LICENSE
port mirroring netwflow
dviPortGroup
portbindingtype
up to 350 hosts
vcenter owns cfg, consistent across all hosts
has to happen within data center
may not want to put distributed switch on mgmt ports (e.g. vswitch 0)

benefits

simplified datacenter admin
provide support for private VLANs
enable net statistics and plicies to migrate with virtual machins during a migration with vMotion
provide for customization andthird development

home/inventory/networking
can put one physical link in uplink
Connecgt VItrt Mach to Dist Port Group
right-click edit settings, put port into port group
IO Plane is control plane

adds inbound traffic shaping
vm networkport block
private vlans
load-based teaming
datacenter-level management
network vmotion
vnetwork switchAPIs
per-port policy settings

Port binding

VLANs and PVLANs

 pvlan anextensionof VLAN standard - furhter
secondary VLAN only exists within primary
Need to have physical switch that understandsPVLANs
types
standard 802.1Q tagging,no double encapsulation
Packets travel tagged with secondary id
phys switch can be confused by fact that each macaddr is visible on vlan tag

CDP or LDLLDP can listen advertise or do both

Network I/O Control

group traffic into network resourcepool, set share a sn limits to control traffic priority
set from resource allocation tab
# of traffic types defined

NetFlow

net analysis tool for monitoring traffic and for gaining visibiltiy into virt
sends summary packets to netflow collector

Port mirroring

source and destination info entered

Storage APIs

array integration, storage awareness, cfg and use profile-driven storage
VAAI - VMware API Array Intration
vendors provide plogins for IO operations sothatarrays do alot offunctions formerly relegated to the host
VASA -VMware API storage Awarenessprofile driven storage

Storage I/O Control

cluster wde storageI/O prioritization
allows for betterworkloadconsolidation
helps reduce extra costs associatedwith overprovisioning

Datastore cluster

collection of datastores grouped together to take advantageof things at a cluster level
storage drs can be enabled to control

Patch Management

centralize,automated patch and version for ESXI hosts virt mach hw,vmware tools, and virt appliances

Components

Creating baseline
Attaching baseline tocluster

Can remediate virtual machine, templates, hosts
  1. update mgr puts host into maint mode
  2. DRS moves virt machines to aviail host
  3. update mgr patches host and exist maint mode
  4. DRS moves virt machines back per rule

Checking physical MAC addresses

From the CLI:
# esxcfg-nics -l 
# esxcfg-vswitch -l
# esxcfg-vmknic -l