VMware Update Manager (VUM) on a 64bits OS

I Googled for this article many time and I was wondering why I haven’t made a post about this on my blog for my own documentation.
When you want to install VUM on a 64bits OS for example Windows 2008 R2 you need to create a 32bit odbc database connection because VUM is still 32bit.

Everytime I search for this article I end up at boche.net website. He made a great post about creating a 32bit odbc databse connection. So for your and mine convenience here is the link.

Apache with iPrint won’t start even if CUPS is disabled with VMware Tools

A while ago I wrote a post about that the installation of the VMware tools enable the start of Cups at boot time. The was easy to fix by disabling the start of Cups at boot time with the insserv -r /etc/init.d/cups or chkconfig cups off command.

While upgrading a vSphere ESX4.0 to 4.1 site I ran into the same problem. So I thought: “No problem, I dealt with this before”. But after disabling the start of Cups at boot time and a restart of the Virtual Machine Cups still was started. The problem is that in the init script of the VMware tools check if Cups isn’t started and if not it will start Cups. This causes that Apache with iPrint won’t start because iPrint and Cups use the same port (TCP 631).

To make sure Cups won’t start at boot time we have to alter the init script in /etc/init.d. To do this:

  1. Open with vi (or another text editor) the /etc/init.d/vmware-tools file
  2. Go to the section where it say’s

    # If we found CUPS, start it, wait, then start tpvmlpd
    if [ $cupsscript ]; then
    $cupsscript start
    sleep 2

  3. Put a # before $cupsscript start
  4. Save the file and make sure Cups won’t start with the command chkconfig cups off

I know this ain’t the best way to deal with this problem. Probably running iPrint on a separate IP address is better but when your upgrading it’s not easy to change the ip address of your iPrint environment.

vCLI: Managing Files


As I want to get deeper into VMware CLI (vCLI) I deciced to make a summary of the vSphere Command-Line Interface Installation and Scripting Guide. Every chapter will be a separate blog post.
This summary is meant for my documentation but feel free to make use of it.

In this blog post: Managing Files

VMFS file systems
/vmfs/volumes/[filesystem-UUID]
/vmfs/volumes/[filesystem-label]

VMFS file
/vmfs/volumes/[filesystem-label or filesystem-UUID]/[dir]/disk.vmdk

Syntax: vmkfstools [connection options] [options] [target]
connection options: See Running vCLI Commands

File system options
–blocksize (-b) [1m, 2m, 4m, 8m]
Specify the blocksize. Used with –createfs
–createfs (-C) vmfs3
Create a VMFS file system
–queryfs (-p)
List attributes of a file system
–setfsname (-S) [label]
Sets the label of the file system. Used with –createfs
–spanfs (-Z)
Extends the VMFS file system

Virtual Disk options
–adaptertype (-a) [buslogic,lsilogic,ide]
Specify adapter type. Used with –createvirtualdisk and –clonevirtualdisk
–clonevirtualdisk [source] [destination]
clones the virtual disk
–createrdm (-r) [device] [rdm_file]
Maps a raw disk to a file on a VMFS file system
–createrdmpassthru (-z)
Map a passthrough raw disk to a file on a VMFS file system
–createvirtualdisk (-c) [size kK,mM,gG]
Create a virtual disk
–deletevirtualdisk (-U)
Deletes a virtual disk
–diskformat (-d) [zeroedthick(default), eagerzeroedthick, thin, rdm, rdmp, 2gbparse]
Specify virtual disk format
–extendvirtualdisk (-x)
Extends the virtual disk
–geometry (-g)
Display the virtual disk geomerty in C/H/S (Cylinders, Heads and Sectors)
–inflatedisk (-j)
converts a thin virtual disk to eagerzeroedthick format
–renamevirtualdisk (-E)
renames the virtual disk
–writezeros (-w)
Cleans the virtual disk by writing zeros over all its data

Manipulate files on remote ESX/ESXi host using vifs (not vCenter)
Groups:
Host
The hostname. syntax: host/[path]
Temp
The temp directory of the host. Syntax: tm/dir/subdir
Datastore
The datatstore name. Syntax: ‘[datastorename]/vm1/vm1.vmx’

Options
–copy (-c) [source] [target] –force
Copy files between datastores. –force is optional
–dir (-D) [remote dir]
List content
–force (-F)
Overwrite files
–get (-g) [remote path] [local path]
Download file from ESX/ESXI to machine where vCLI is running
–listdc (-S)
List datastore names
–mkdir (-M) [remote dir]
Create directory on remote dir
–move (-m) [source] [target] –force
Move files between or on datastores. –force option is optional
–put (-p) [local path] [remote path]
Upload files from machine where vCLI is running to a datastore
–rm (-r) [remote path]
Delete a file on a datastore
–rmdir (-R) [remote dir]
Deletes a directory on a datastore

vCLI: Managing Hosts

As I want to get deeper into VMware CLI (vCLI) I decided to make a summary of the vSphere Command-Line Interface Installation and Scripting Guide. Every chapter will be a separate blog post.
This summary is meant for my documentation but feel free to make use of it.

In this blog post: Managing Hosts

reboot, shutdown a host
shutdown hosts in maintenance mode
vicfg-hostops [connect options] –operation shutdown

shutdown hosts not in maintenance mode
vicfg-hostops [connect options] –operation shutdown –force

shutdown hosts in cluser or datacenter
vicfg-hostops [connect options] –operation shutdown –cluster [clustername]
vicfg-hostops [connect options] –operation shutdown –datacenter [datacentername]

Reboot hosts
Change the operation shutdown into reboot

Maintenance Mode
Entering Maintenance Mode
vicfg-hostops –operation enter (–cluser or –datacenter)

Check Maintenance Mode
Entering Maintenance Mode
vicfg-hostops –operation check

Exiting Maintenance Mode
vicfg-hostops –operation exit

Backup Configuration (host has to be in maintenanc mode)
Backup configuration information
vicfg-cfgbackup [connection options] -s /tmp/esxi-backup.txt

Restore configuration information
vicfg-cfgbackup [connection options] -l /tmp/esxi-backup.txt

Restore factory settings
vicfg-cfgbackup [connection options] -r

Host updates
which bulletins are installed
vihostupdate [connection options] –query

Which bulletins are available in the bundle
vihostupdate [connection options] –list –bundle https://webserver/bundle.zip

Which bulletions in the bundle are applicable to your host
vihostupdate [connection options] –scan –bundle https://webserver/bundle.zip

Install all or some bulletins from the bundle on your host
vihostupdate [connection options] –install –bundle https://webserver/bundle.zip,https://webserver2/budle2.zip

Make use of a metadata file
vihostupdate [connection options] –list –metadata https://webserver/metadata.zip

Install all bulletions using a metadata file
vihostupdate [connection options] –install –metadata https://webserver/metadata.zip

Install some bulletins using a metadata file
vihostupdate [connection options] –list –metadata https://webserver/metadata.zip –bulletin bulletin1,bulletin2

Removing a bulletin from a host (not vmware patches or updates)
vihostupdate [connection options] –remove –bulletin bulletin1

Active Directory Configuartion

  • Make sure time is synchronized between ESXi host and AD Server
  • ESX host is pingable from AD Server by DNS name
  • AD server is pinable form ESX host by DNS name

vicfg-authconfig –server=[ESX server ip adress]
–username=[ESX server admin name]
–password=
–authschema AD –hoindomain [ad domain name]
–adusername=[AD admnistration name]
–adpassword=

Check authentication
vicfg-authconfig –list

vCLI: Running vCLI Commands

As I want to get deeper into VMware CLI (vCLI) I deciced to make a summary of the vSphere Command-Line Interface Installation and Scripting Guide. Every chapter will be a separate blog post.
This summary is meant for my documentation but feel free to make use of it.

In this blog post: Running vCLI Commands

Authentication order

  1. Commandline (–password, –sessionfile, –config)
    Path:
    Linux: /usr/share/doc/vmware-vcli/apps/session
    Windows: c:Program FilesVMwareVMware vSphere CLIPerlappssession

    save_session(.pl) –savesessionfile /tmp/vimsession –server s1 –username user1 –password wachtwoord
    (.pl is used in Windows)

    vicfg-mpath –sessionfile /tm/vimsession –list

  2. Enviroment variable
    Linux: export VI_SERVER=[servernaam]
    Windows: set VI_SERVER=[servernaam]
  3. Configuartion file
    vicfg-mpath –config [path_to_config_file] –list

    Example:
    VI_SERVER = XXX.XXX.XXX.XXX
    VI_USERNAME = root
    VI_PASSWORD = geheim
    VI_PROTOCOL = https
    VI_PORTNUMBER = 443

  4. Current Account (AD)
    vicfg-mpath –server [vc_Server] –passthroughauth –passthroughauthpackage “Kerberos” –vihost [esxhost] –list
  5. Prompt the user for a password

Command not available in lockdown mode (because you can only use vcli command at a vCenter server):

  • vicfg-snmp
  • vifs
  • vicfg-user
  • vicfg-cfgbackup
  • vihostupdate
  • vmkfstools
  • esxcli
  • vicfg-ipsec