Search This Blog

Sunday 22 May 2011

vMA 4.1 commands

esxcfg-advcfg / vicfg-advcfg - Modify advanced kernel options, e.g. adjust CIM providers, set DCUI message ...


esxcfg-cfgbackup / vicfg-cfgbackup - Backup and restore ESXi host configurations

esxcfg-dns / vicfg-dns - Configure DNS properties of ESX(i) host

esxcfg-dumppart / vicfg-dumppart - Query, set & scan for diagnostic (dump) partitions on ESX(i) hosts

esxcfg-iscsi / vicfg-iscsi - Manages iSCSI storage on ESX(i) host. Add/remove discovery addresses or static targets, changes CHAP authentication, set/list HBA IP details, list LUN/target properties, enable/disable s/w iSCSI

esxcfg-module / vicfg-module - Configures VMkernel modules

esxcfg-mpath / vicfg-mpath - List iSCSI & fibre path information, and changing path state

esxcfg-mpath35 / vicfg-mpath35 - List iSCSI & fibre path information, and changing path state on ESX(i) 3.5 hosts

esxcfg-nas / vicfg-nas - Manipulates NAS file system, adds, deletes, lists, add host

esxcfg-nics / vicfg-nics - Get information, set speed/duplex for physical nics.

esxcfg-ntp / vicfg-ntp - Configure/add/delete NTP server on ESX(i) host, start/stop service

esxcfg-rescan / vicfg-rescan - Scan the LUNs on a host for a specific adapter

esxcfg-route / vicfg-route - List/add/delete VMkernel routing information for IPv4 & IPv6

esxcfg-scsidevs / vicfg-scsidevs - Displays available LUN information for ESX(i) 4.x hosts

esxcfg-snmp / vicfg-snmp - Configure/start/stop SNMP service

esxcfg-syslog / vicfg-syslog - Get/set syslog server & port

esxcfg-user / vicfg-user - Manage local users and groups for ESX(i) host

esxcfg-vmknic / vicfg-vmknic - Configures VMkernel NICs. You can add/delete VMkernel NIC, set MTU, IP address, assign DVS & dvport/portgroup, enable/disable for VMotion, IPv6 & disable TSO.

esxcfg-volume / vicfg-volume - Resignature snapshot volume and mount/unmount it. List snapshots & mount snapshot persistently.

esxcfg-vswitch / vicfg-vswitch - Add/remove virtual (dv)switches/portgroups, and modify settings.

esxcli - Manages the Pluggable Storage Array (PSA) architecture. There are 3 namespaces (nmp,corestorage and swiscsi). nmp is for the Native MultiPathing, corestorage is for managing the claim rules to mask devices, and swiscsi is for managing the iscsi interface.

resxtop - Display ESX(i) host resource utilisation

svmotion - Move storage of a virtual machine

vifs - copy/delete/get and put files & directories on ESX(i) host file system

vihostupdate - Manage (install, remove, list) software installations on ESX(i) host

vihostupdate35 - Manage (install, remove, list) software installations on ESX(i) 3.5 host

vmkfstools - Used to manipulate and creat virtual disks, file systems, logical volumes and physical storage devices. Manage VMFS and RDMs

vmware-cmd - Perform VM operations. You can retrieve information such as the power state, register and unregister the virtual machine, set configuration variables, and manage snapshots.

Tuesday 1 February 2011

Setting up IIS to act as an Update Manager repository

The following KB article describes how to set up IIS to provide the patches downloaded by the Update Manager Download Server (UMDS) to the Update Manager server.

KB 1019288

I'd like to add some additional information to help with this.



  1. The configuration of Update Manager means that you have to either host the downloaded patches locally to the UM server (i.e. plug in a drive with them on, or copy to the servers drive), or host them on a web server that is accessible by the UM server.
  2. After the patches have been downloaded, they can be hosted on the UMDS server running IIS, and therefore you don't need to export the downloads anywhere saving on disk space & manual activities.
  3. When you follow the KB article, make sure you copy version.txt and version1.txt to the root of the patch folder from the downloaded patches folder.
  4. The KB article says copy the downloaded patches to the Document Root folder. Even better than this would be simply to set up UMDS to download directly to this folder, and then you don't need to worry about file copies.
To make sure that the IIS server is working, type using IE on the VM machines to connect to the following address:

http://umds_server_name/patch_store/version.txt

you should see something like:

"Created with VMware Update Manager Download service 4.1.0"


Monday 24 January 2011

datacenter.QueryConnectionInfo error when connecting ESX host

I had a bit of a problem in my home lab. I have 2 hosts, and one crashed. Unfortunately this was the host running AD & vCenter. When I brought the host back, I managed to restart the VMs, but looking in the vSphere client when I connected back onto vCenter, both hosts were disconnected. When I tried to reconnect, I got this Datacenter.QueryConnectionInfo error message. I have a feeling that name resolution was to blame here, but couldn't work out what was wrong. I could ping the hosts from vCenter by IP & name, I could add the hosts by IP address, but not by name. The only work around I could come up with was to add the ESX host details into the hosts file to avoid using DNS. As soon as I did that, I could reconnect the hosts. I've no idea what the actual problem is, although i wonder if some connection information is stored in the database and was corrupted when the host died.

Useful vMA commands




NFS Storage

If you are connecting an NFS share to your ESX(i) server, use the command vicfg-nas

To see what NFS datastores are connected to a host, use

  • vicfg-nas -h esxhostname/ip address -l
  • e.g. vicfg-nas -h esx.test.com -l

To add a datastore to a host

  • vicfg-nas -h ESXhostname/ip address -a "Datastore name" -o NFS Servername/ip address -s sharename
  • vicfg-nas -h esx.test.com -a "NFS datastore" -o nfs.test.com -s /mnt/nfs

To delete a datastore from a host

  • vicfg-nas -h ESXhostname/ip address -d "Datastore name"
  • e.g. vicfg-nas -h esx.test.com -d "NFS datastore"

Virtual Machine vSwitch Configuration

To list vSwitches and portgroups use:

  • vicfg-vswitch -h ESXhostname/ip address -l
  • e.g. vicfg-vswitch -h esx.test.com -l
To create a vSwitch

  • vicfg-vswitch -h ESXhostname/ip address -a vSwitchname
  • e.g. vicfg-vswitch -h esx.test.com -a esxvSwitch

To delete a vSwitch

  • vicfg-vswitch -h ESXhostname/ip address -d vSwitchname
  • e.g. vicfg-vswitch -h esx.test.com -d esxvSwitch

To create a portgroup in a vSwitch
  • vicfg-vswitch -h ESXhostname/ip address -A portgroupname vSwitchname
  • e.g. vicfg-vswitch -h esx.test.com -A portgroup1 esxvSwitch

To configure a portgroup with a VLAN ID (this can't be done when the portgroup is created

  • vicfg-vswitch -h ESXhostname/ip address -v vlanid -p portgroupname vSwitchname
  • e.g. vicfg-vswitch -h esx.test.com -v 32 -p portgroup1 esxvSwitch

To delete a portgroup from a vSwitch

  • vicfg-vswitch -h ESXhostname/ip address -D portgroupname
  • e.g. vicfg-vswitch -h esx.test.com -D portgroup1

vmkernel vSwitch Configuration


The format is very similar to the vicfg-vswitch command
To list vmkernel portgroup details use:

  • vicfg-vmknic -h ESXhostname/ip address -l
  • e.g. vicfg-vmknic -h esx.test.com -l
To create a vmkernel portgroup (i.e. convert the portgroup from a Virtual Machine portgroup to a vmkernel portgroup)

  • vicfg-vmknic -h ESXhostname/ip address -a -i ipaddress -n netmask -p portgroupname
  • e.g. vicfg-vmknic -h esx.test.com -a -i 10.10.10.1 -n 255.255.255.0 -p portgroup1

To delete a vmkernel portgroup (i.e. convert it back to a Virtual Machine portgroup)

  • vicfg-vmknic -h ESXhostname/ip address -d -p portgroupname
  • e.g. vicfg-vmknic -h esx.test.com -d -p portgroup1

To enable a vmkernel portgroup for VMotion

  • vicfg-vmknic -h ESXhostname/ip address -E -p portgroupname
  • e.g. vicfg-vmknic -h esx.test.com -E -p portgroup1

Wednesday 12 January 2011

VCD Reservation Pool Capacity

I’ve been playing with some capacity stuff in the cloud, and have used PowerCLI to gather some allocation information for each of the Org vDCs that exist (such as reservation allocated to each vDC & reservations used by the VMs in it).

This has gone swimmingly for PAYG & Allocation Pools, but for Reservation Pools I made the assumption that no VMs in the vDC would have any reservations. I thought I should get some data to validate my script, so created a couple of random vApps in a test Reservation Pool vDC. I ran my script and found that actually reservations existed for some of the VMs.

The reason is that for Reservation Pools only, the resource settings come directly from the template VM, so if the template was created on an Allocation Pool vDC, those settings will be transferred when this template is cloned.

I believe that this is a bug rather than a feature.