Friday, 29 July 2016

Identify and tag SSD Devices







You can use PSA SATP claim rules to tag SSD devices that are not detected automatically.
Only devices that are consumed by the PSA Native Multipathing (NMP) plugin can be tagged.
Procedure
First find all your relevant information
  • Identify the drive to be tagged and its SATP.
  • For example our drive is called (naa.600605b008f362e01c91d3154a908da1):1
  • Type esxcli storage nmp device list -d naa.600605b008f362e01c91d3154a908da1
  • The command results in the following information.
SSDTagging
  • Note down the SATP associated with the device.
  • You can also run the following to get extra information and you can see that Is SSD is marked false when it should be true
  • esxcli storage core device list -d naa.600605b008f362e01c91d3154a908da1
SSDTagging2
Create a new SATP Rule
  • Add a PSA claim rule to mark the device as SSD.
  • There are several ways to do this
  • You can add a claim rule by specifying the device name.
  • esxcli storage nmp satp rule add -s VMW_SATP_CX -d naa.600605b008f362e01c91d3154a908da1 -o enable_ssd
SSDTagging4
  • You can add a claim rule by specifying the vendor name and the model name.
    esxcli storage nmp satp rule add -s VMW_SATP_CX -V vendor_name -M model_name –option=enable_ssd
  • You can add a claim rule based on the transport protocol.
  • esxcli storage nmp satp rule add -s VMW_SATP_CX  –transport transport_protocol –option=enable_ssd
  • You can add a claim rule based on the driver name.
  • esxcli storage nmp satp rule add -s VMW_SATP_CX  –driver driver_name –option=enable_ssd
Restart the host
  • You now need to restart the host
Unclaiming the device
  • You can now unclaim the device by specifying the device name.
  • esxcli storage core claiming unclaim –type device –device naa.600605b008f362e01c91d3154a908da1
SSDTagging5
  • You can unclaim the device by specifying the vendor name and the model name.
  • esxcli storage core claiming unclaim –type device -V vendor_name -M model_name
  • You can unclaim the device based on the transport protocol.
  • esxcli storage core claiming unclaim –type device –transport transport_protocol
  • You can unclaim the device based on the driver name.
  • esxcli storage core claiming unclaim –type device –driver driver_name
Reclaim the device by running the following commands.
  • esxcli storage core claimrule load
  • esxcli storage core claimrule run
  • esxcli storage core claiming reclaim -d naa.600605b008f362e01c91d3154a908da1
Verify if devices are tagged as SSD.
  • esxcli storage core device list -d device_name
  • or
  • esxcli storage core device list -d naa.600605b008f362e01c91d3154a908da1 |grep SSD
SSDTagging6
The command output indicates if a listed device is tagged as SSD.
  • Is SSD: true
What to do next
If the SSD device that you want to tag is shared among multiple hosts, make sure that you tag the device from all the hosts that share the device.

Thursday, 28 July 2016

vifs for Command Line


What is vifs?
vifs allows you to perform file system operations on remote hosts. The command is supported against ESXi hosts but not against vCenter Server systems.
The vifs command performs common operations such as copy, remove, get, and put on files and directories. The command is supported against ESX/ESXi hosts but not against vCenter Server systems.
Note: While there are some similarities between vifs and DOS or Unix file system management utilities, there are also many differences. For example, vifs does not support wildcard characters or current directories and, as a result, relative path names. Use vifs only as documented.
Note: To use vifs, you will need vCLI installed on  either a Windows/Linux system or you may use VMware vMA
Options using vCLI
vifs
Examples
Note: On Windows, the extension .pl is required for vicfg- commands, but not for ESXCLI.
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying the server, user name, and password. Run vifs –help or vifs.pl –help for a list of common options including connection options.
  • Copy a file to another location:
vifs – -server server01 -c “[StorageName] VM/VM.vmx” “[StorageName] VM_backup/VM.vmx”
  • List all the datastores:
vifs – -server server01 -S
  • List all the directories:
vifs – -server server01 -D “[StorageName] vm”
  • Upload a file to the remote datastore:
vifs – -server server01 -p “tmp/backup/VM.pl”
“[StorageName] VM/VM.txt” -Z “ha-datacenter”
  • Delete a file:
vifs – -server server01 -r “[StorageName] VM/VM.txt” -Z “ha-datacenter”
  • List the paths to all datacenters available in the server:
vifs – -server server01 -C
  • Download a file on the host to a local path:
vifs – -server server01 -g  “[StorageName] VM/VM.txt”
-Z “ha-datacenter” “tmp/backup/VM.txt”
  • Move a file to another location:
vifs – -server server01 -m  “[StorageName] VM/VM.vmx”
“[StorageName] vm/vm_backup.vmx” -Z “ha-datacenter”
  • Remove an existing directory:
vifs – -server server01 -R “[StorageName] VM/VM” -Z “ha-datacenter””
Note:
The vifs utility, in addition to providing datastore file management also provides an interface for manipulating files residing on a vSphere host. These interfaces are exposed as URLs:
  • https://esxi-host/host
  • https://esxi-host/folder
  • https://esxi-host/tmp

Friday, 19 February 2016

How to upgrade ESXi 5.x to the latest ESXi 6.0?

1. Download the file called VMware-ESXi-6.0.0-2494585-depot.zip from My VMware portal. It should be available when you sign-up for a trial of VMware vSphere 6.0 together with the ESXi 6.0 iso file.

2. Upload this file to the datastore visible by your ESXi host.


How to upgrade ESXi 5.x to ESXi 6.0 standalone via Command line

3. Put your host in maintenance mode (right click > enter maintenance mode) and connect via putty. Note that SSh must be enabled. (configuration > security profile > properties > ssh). Now run this command to update the host:
esxcli software vib update -d /vmfs/volumes/<your_volume>/VMware-ESXi-6.0.0-2494585-depot.zip
4. Reboot your host and exit maintenance mode.


Note:- Please take all host configuration files backup and use Host Profiles to backup all settings.

Thursday, 18 February 2016

Looking at esxtop values and results (Realtime)








First visible CPU Statistics
CPUesxtop

Optional Fields for CPU Performance Monitoring



General Memory Statistics


First Visible Memory Statistics

esxtop5

Optional Fields for Memory Performance Monitoring

esxtopmem5

General Disk Statistics



General Network Statistics

esxtopnetwork

Wednesday, 10 February 2016








VMware today announced the complete list of VMware vExperts for this year 2016.

I’m happy to say that I have been recognized as a vExpert 2016. The list of global VMware vExperts 2016 announcement can be found in the VMware  Blog

http://blogs.vmware.com/vmtn/2016/02/vexpert-2016-award-announcement.html

Thursday, 7 January 2016

VMWare ESXi Commands & Logs Tips

Esxcfg-Commands
esxcfg-advcfg Set/Get Advance Configuration Parameters (Stored in /etc/vmware/esx.conf)
esxcfg-auth Configure authentication (ADS, NIS, Kerberos)
esxcfg-boot Configure Boot-Options
esxcfg-configcheck Checks format of /etc/vmware/esx.conf (e.g. Used after esx-updates)
esxcfg-dumppart Configure partition for core-dumps after PSOD
esxcfg-firewall Configure ESX-server firewall
esxcfg-hwiscsi Configure hardware iSCSI initiators
esxcfg-info Get information about hardware, resources, storage, … of the ESX-Server
esxcfg-init Used Internally on boot
esxcfg-linuxnet Setup/Remove linux network devices (ethX)
esxcfg-module Enable/Disable/ Add new/ Query VMKernal modules and set/ get parameters for them.
esxcfg-mpath Configure multipathing for Fibre-Channel and iSCSI
esxcfg-nas Configure NFS-datastores (“NFS-client”)
esxcfg-nics Configure physical nics (VmnicX).
esxcfg-pciid Recreate PCI-device list /etc/vmware/{pci.ids, pcitable, pcitable.linux, vmware-device.map } from the configuration files /etc/vmware/pciid/*.xml
esxcfg-rescan Rescan a SCSI/FC/iSCSI adapter.
esxcfg-resgrp Configure resource groups
esxcfg-route Configure the VMKernel default route
esxcfg-swiscsi Configure /Rescan software iSCSI initiator
esxcfg-upgrade Used for upgrades from ESX2.x to ESX3
esxcfg-vmhbadevs Get information about attached LUNs with /dev/sdX/mappings
esxcfg-vmknic Add /Remove /Configure VMKernel NICs.
esxcfg-vswif Add/Remove/Configure ServiceConsole NICs
esxcfg-vswitch Add/Remove/Configure Virtual Switches
 
esx-Commands
esxnet-support Diagnostic information about Console NICs (Gives Errors in ESX-3.5.0)
esxtop Live Statistics of Virtual Machines (with VM-Names)
esxupdate Tool for updating ESX-3.x
 
Vmware-Commands
Vmware-authd For internal use only (authentication)
Vmware-cmd See vmware-cmd section
vmware-configcheck Check Virtual Machine configuration files (*.vmx)
vmware-config.pl Configure ESX-hostd port, recompile/install VMware VmPerl Scripting API
vmware-hostd Demon for VI Client connections (should only be started by mgmt-vmware start-script)
vmware-hostd-support Creates /var/log/vmware/hostd-support.tgz
vmware-mkinitrd Creates initrd (initial ramdisk)
vmware-vim-cmd Please see vmware-vim-cmd section
vmware-vimdump Get information about ESX-Server configuration and Virtual Machines.
vmware-vimsh Interactive shell – comparable to vmware-vim-cmd with additional commands
vmware-watchdog Watchdog-Demon to keep vmware-hostd running (should only be started by mgmt-vmware start-script)
vmware-webAccess WebAccess-Demon for browser based management (should only be started by vmware-webAccess start-script)
 
Vm-Commands
vmfsqhtool Prints UUID of a device header
vmfsqueuetool Formats all partitions in vmfs queue
vmkchdev Manage PCI devices (give control over the device to VMKernel or Service Console)
vmkdump Manage VMKernel dump partition
vmkerrcode Give description of VMKernel error codes base on decimal or hex value
vmkfstools Create/Remove/Configure VMFS-Filesystems and Virtual Machine .vdsk files (Virtual Disk File)
vmkiscsid iSCSI demon
vmkiscsi-device iSCSI device information
vmkiscsi-ls List iSCSI devices
vmkiscsi-tool Configure software iSCSI initiator
vmkiscsi-util Get information about iSCSI devices
vmkloader Load and unloads the VMKernel
vmkload mod Load/Unload VMKernel modules (e.g. device drivers)
vmklogger Create logmessages (like logger for VMKernel messages)
vmkpcidivy deprecated
vmkping Ping on VMKernel network
vmkuptime.pl Creates HTML output with Uptime/Downtime/Availability
vmres.pl deprecated
vmsnap all Snapshot all Virtual Machines on a ESX-Server
vmsnap.pl deprecated
vmstat (this is a standard linux command – lists memory/disk access statistics)
vm-support Creates /etc/init.d/esx-<date>.tgz
vmware internal use – can not be started manually
 
Other Commands
vdf Show free disk space of mounted partitions (like df with vmfs-support)
 
Start-Scripts
Scripts inside /etc/init.d/
mgmt-vmware Start/Stop/Restart the demon for the VI-Client connections
vmkhalt internal use – can not be started manually
vmware internal use – can not be started manually
vmware-functions internal use – can not be started manually
vmware-late internal use – can not be started manually
vmware-vmkauthd internal use – can not be started manually
vmware-vpxa Start/Stop/Restart the demon for the Virtual Center connections
vmware-webAccess Start/Stop/Restart the demon for the Web-Interface connections
 
Running Processes
crond Schedule jobs at specific intervals
gpm Mouse support in the text console
init First process which runs every other process
klogd Kernel log demon
logger Logs messages to /var/log
sshd Provides secure shell access
syslogd Log/Filter demon with a remote logging ability
vmware-hostd Demon for VI Client connections
vmkload app Loads vmware applications (internal use only)
vmklogger Logs VMKernel messages to /var/log/vmware
wsmand Web Services Management
vmware-vmkauthd Demon for user authentication
vmware-vmx Provides context for a Virtual Machine (internal use only)
vmware-watchdog Checks if vmware processes are running (no connection test à does not restart hung processes)
vpxa Virtual Center agent
webAccess Web-Interface (TomCat-Server)
xinetd Listen on network ports for other demons and start them on-demand
 
vmware-cmd Commands
Commands for a Virtual Machines (vmware-cmd -h).
getconnectedusers List name and IP of connected users (non-working with esx3.5.0?)
getstate Show current state of VM (Ofi/On/…)
start Start a VM
stop Stop a VM
reset Reset a VM
suspend Suspend a VM
setconfig Set a variable in the vmx-configuration-file
getconfig Get a variable from the vmx-file
setguestinfo Set guest info variable
getguestinfo Get guest info variable
getproductinfo Get various product info
connectdevice Connect a device
disconnectdevice Disconnect a device
getconfigfile Get path/filename of config file
getheartbeat Get current heartbeat
gettoolslastactive Time since last notification from vmware-tools (in seconds)
getresource Get a VM resource
setresource Set a VM resource
hassnapshot Determine if VM has a snap-shot
createsnapshot Create a snapshot
revertsnapshot Revert to last snapshot
removesnapshots Remove all snapshots
answer Answer a question (if VM requires input)
 
vmware-vim-cmd Commands
hostsvc/ ESX-Server commands
internalsvc/ ESX-Server internal com- mands
proxysvc/ Web-SDK proxy commands
vimsvc/ VirtualCenter commands
vmsvc/ VM commands
 
Log Files
Logs are in /var/log/vmware/ if no other path is specified)
/etc/syslog.conf Configure logging behaviour
esxcfg-boot.log Boot messages
esxcfg-firewall.log List of executed firewall commands and log messages
esxcfg-linuxnet.log LinuxNet messages
esxupdate.log Debug messages for updates
hostd.log hostd messages
vpx-iupgrade.log Logs for package installations/removals by Virtual Center (e.g. output of rpm –hiv VMware-vpxa-2.5.0-64192.i386.rpm)
vpx/vpxa.log Virtual Center Agent messages
vmfsqueuetool.log VMFSQueueTool messages
webAccess Web-Access messages
/proc/vmware/log VMKernel messages
/var/log/ storage-Monitor VMKernel storage monitor messages
/var/log/ vmkernel VMKernel messages (info messages only)
/var/log/ vmkproxy VMKernel userworld proxy messages
/var/log/ vmk-summary VMKernel messages (notice and higher)
/var/log/ vmk-warning VMKernel warning messages