Upload
roxanne-price
View
222
Download
0
Tags:
Embed Size (px)
Citation preview
© 2014 VMware Inc. All rights reserved
My Slides from
VMware vSphere: Optimize and Scale
1-2
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
Found at www.renright.com/work
PrepForVCP-DCV.zip (Prep for VCP)
VCAP-DCA.zip (Prep for VCAP)
vSphere_Perf.zip (Performance Documents)
Additional student materials
1-3
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
vSphere Management Assistant includes the following commands:
Esxcli (Both)
Resxtop (vMA) esxtop (SSH)
Svmotion (Both)
vicfg- commands (vMA)
esxcfg- commands (deprecated) (Both)
Vifs (vMA)
Vihostupdate (Cannot be used with ESXi 5.0 or later)
Vmkfstools (Both)
vmware-cmd (vMA)
vim-cmd (SSH)
vSphere Management Assistant & SSH Commands
1-4
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
Use vim-cmd commands from ESI Shell or SSH
ESXi Shell & SSH
Get a list of VMs on a host vim-cmd vmsvc/getallvms
Unregister a VM vim-cmd vmsvc/unregister vmid
Delete a VM vim-cmd vmsvc/destroy vmid
Determine if a VM has a snapshot vim-cmd vmsvc/get.snapshot vmid
Take a snapshot of a VM vim-cmd vmsvc/snapshot.create vmid snapshot_name
Remove a snapshot of a VM vim-cmd vmsvc/snapshot.remove vmid
Get the current power state of a VM vim-cmd vmsvc/power.getstate vmid
Get the uptime for a VM vim-cmd vmsvc/get.summary vmid |grep uptimeSeconds
Power on a VM vim-cmd vmsvc/power.on vmid
Shutdown a VM vim-cmd vmsvc/power.shutdown vmid
Power off a VM esxcli vm process kill –w world_id vim-cmd vmsvc/power.off vmid
Reboot a VM vim-cmd vmsvc/power.reboot vmid
Reset a VM vim-cmd vmsvc/power.reset vmid
Upgrade VMware Tools in a VM vim-cmd vmsvc/tools.upgrade vmid
Display the IP address of a VM vim-cmd vmsvc/get.guest vmid |grep -m 1 "ipAddress = \""
1-5
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
Use the esxcli command with the network vswitch standard namespace:
esxcli conn_options network vswitch standard cmd_options
Examples:
To set the maximum transmission unit size:
• esxcli –-server esxi02 network vswitch standard set --mtu=9000 --vswitch-name=vSwitch5
• esxcli network vswitch standard set –m 9000 –v vSwitch5
To set the Cisco Discovery Protocol status:
• esxcli –-server esxi02 network vswitch standard set --cdp-status=advertise --vswitch-name=vSwitch5
• esxcli network vswitch standard set –c advertise –v Switch5 (or –c listen , -c both, -c down)
• esxcfg-vswitch –B both vSwitch1
Setting Virtual Switch Attributes
1-6
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
Use the esxcli command with the network vswitch standard namespace:
esxcli conn_options network vswitch standard cmd_options
Examples of using esxcli:
To create a standard switch:
• esxcli –-server esxi02 network vswitch standard add –-vswitch-name=vSwitch5 SSH: esxcfg-vswitch –a vSwitch5
To list information about a standard switch:
• esxcli –-server esxi02 network vswitch standard list–-vswitch-name=vSwitch5 SSH: esxcfg-vswitch -l
To delete a standard switch:
• esxcli –-server esxi02 network vswitch standard remove–-vswitch-name=vSwitch5 SSH: esxcfg-vswitch –d vSwitch5
You can also use the vicfg-vswitch command. See examples in the notes.
Listing, Creating, and Deleting Standard Switches
1-7
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
Use the esxcli command with the network vswitch standard portgroup namespace:
esxcli conn_options network vswitch standard portgroup cmd_options
Examples:
To list port groups on all standard switches:
• esxcli –-server esxi02 network vswitch standard portgroup list
To add a port group to a standard switch:
• esxcli –-server esxi02 network vswitch standard portgroup add --portgroup-name=TestDev --vswitch-name=vSwitch5
• esxcli network vswitch standard portgroup add –p TestDev –v vSwitch5
To remove a port group from a standard switch:
• esxcli –-server esxi02 network vswitch standard portgroup remove --portgroup-name=“VM Network” --vswitch-name=vSwitch0
You can also use the vicfg-vswitch command. See examples in the notes.
Listing, Adding, and Removing Port Groups
1-8
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
Device driver queue depth determines how many commands to a given LUN can be active at one time.
Set device driver queue depth size properly to decrease disk latency.
Qlogic adapters depth of queue is 64 (default)
Other brands depth of queue is 32 (default).
Maximum recommended queue depth is 64.
Set Disk.SchedNumReqOutstanding to the same value as the queue depth.
Device Driver Queue Depth
Set LUN queue depth to its maximum: 64.
ESXi 5.1 & earlier
1-9
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
ESXi 5.5
To check the current value for a device,run the command:
esxcli storage core device list -d naa.xxx
Note: The value appears under No of outstanding IOs with completing worlds:
To modify the current value for a device,run the command
esxcli storage core device set -d naa.xxx -O Value
Where Value is between 1 and 256Source: KB Article 1258
1-10
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
vscsiStats <options>
-l List running virtual machines and their world IDs (worldGroupID).
-s Start vscsiStats data collection.
-x Stop vscsiStats data collection.
-p* Print histograms, specifying histogram type.
-c Produce results in a comma-delimited list.
-h Display help menu for more information about command-line parameters.
-w Specify worldGroupID* Followed by all, ioLength, seekDistance, outstandingIOs, latency or interarrival (Case sensitive)
Running vscsiStats
1-11
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
Configure the BIOS:
1. Check for latest BIOS version
2. Enable
H.A.V
Hyperthreading
NUMA
All Sockets
Enable NX/XD
3. Disable unused devices
USB, Serial, Parallel, etc
4. Set power management to OS controlled
5. Consider turning off Dynamic Voltage & Frequency Scaling
Intel SpeedStep or AMD PowerNow
VMware Best practices for configuring ESXi hosts
1-12
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
VM “A” Boots up. Vmk assigns it memory pages.
VM “B” Boots up. Vmk assigns it memory pages.
How TPS Works
The vmkernel hashes each memory page.
If redundant pages are verified, then the vmkernel will map both hosts to the same pageThus freeing up pages and making more memory available
Memory pages on an ESXi host
1-13
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
Example of ESXi Host with 512 GB of RAM
•Take the first 4 GB of RAM x 6% = 246 MB
•Next 4 to 12 GB is 8GB x 4 = 328 MB
•Next 12 to 28 GB is 16 GB x 2% = 328 MB
•Any amount above 28 GB x 1% Take 512 – 28 = 484 x 1% = 4842 MB
• Base Total 5742 MB
•If free memory is > 64% of base (5742 x 64% = 3098 MB Free) = High
•If free memory is between 32 & 64% of base then state is Soft
•If free memory is between 16 & 32% of base then state is Hard
•If free memory is less than 16% of base then state is Low
Example of Calculating MinFreePct
1-14
© 2014 VMware Inc. All rights reserved
VMware vSphere: Optimize and Scale
VM Overhead
Prior to vSphere 5.0
vSphere 5.0 - 5.5
VM overhead is now swapped to vms-<VM-name>-1233434.vswp