Friday, 22 January 2010
VMware Update Manager Download Service
I knew it existed, but I hadn't come across this until now, so here are my notes.
The UMDS is very useful in 2 scenarios
1. When the VUM server has no access to the internet (proxy or not)
This is a pretty obvious use case. VUM can't get the updates, so something else needs to.
2. When there are multiple VUM servers
To avoid all the VUM servers downloading all the same patches, just have UMDS do it instead, and then place them onto a shared device/folder somewhere that all the VUM servers have access to.
In both cases, the updates will be downloaded by UMDS, exported, and then placed onto some sort of shared storage that the VUM servers can see. In scenario 1, this can be a shared folder, a usb drive, or even a CD. In scenario 2, I would suggest that only a shared folder makes sense.
UMDS is not very attractive in terms of using it, it doesn't have a GUI, and you need to use the command vmware-umds which is found in the c:\program files\vmware\infrastructure\update manager folder. Here are the switches as reported by the -H (--help) option:
Basic Commands:
-H [ --help ]
Help on running (this description)
-D [ --download ]
Download Updates based on the current configuration
-E [ --export ]
Export Updates
-R [ --re-download ]
Re-download the Updates
-S [ --set-config ]
Setup Initial Configuration
-v [ --version ]
Print the UMDS version number
-i [ --info-level ] arg
The level of information shown on the console: verbose, info.
Optional arguments for Export and Re-download:
--export-store arg
The destination directory for export operation (Overrides setting from initial configuration)
-s [ --start-time ] arg
For re-download, restrict selection to include updates downloaded since this time (inclusive). Format is ISO-8601 YYYY-MM-DDThh:mm:ss[Z]. Use 'Z' at the end to indicate UTC
-t [ --end-time ] arg
For re-download, restrict selection to include updates downloaded till this
time (inclusive). Format is ISO-8601 YYYY-MM-DDThh:mm:ss[Z]. Use 'Z' at the end to indicate UTC
Arguments for setting up initial configuration:
--patch-store arg
The directory to store all the downloaded updates
--proxy arg
Proxy Server settings in host:port format.To disable proxy, use --proxy ""
-h [ --enable-host ] arg
Enable ESX Host update downloads: true or false
-w [ --enable-win ] arg
Enable Windows VM update downloads: true or false
-l [ --enable-lin ] arg
Enable Linux VM update downloads: true or false
-e [ --export-store ] arg
The default directory for exporting updates
--lang arg
Specify the languages for which updates are downloaded. Multiple values are allowed. Valid values are: ARA, CHS, CHT, DA, ELL, ENU, FI, FRA, GER, HEB, HUN, ITA,
JPN, KOR, NL, NO, PLK, PT-BR, RUS, ESN, SV, THA, TRK
So the common setup commands will be:
vmware-umds -S -h true
vmware-umds -S -w false
vmware-umds -S -l false
If you only want to download host patches and not Virtual Machine patches. I haven't found a way of only downloading certain versions of host patches such as only the ESXi 4 patches. You will end up downloading ALL the patches for ALL the versions.
When you have run the commands above, you can now download the patches by running:
vmware-umds -D
This will download the patches into the repository you specified during install. BEWARE - this takes a LONG time!
UPDATE
See http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1015663 to see how to only download ESX 4 patches
Wednesday, 13 January 2010
vCenter installation
- When creating the database first, run the script provided in the VMware installation and setup guide, but change the password.
- I also used the script to create the Update Manager database, but I changed the username.
- For 64 bit servers, run the odbc.exe in c:\windows\SysWoW64\odbcad32.exe, and configure the System DSN from there.
- It's best to use a service account for the vCenter and Update Manager services, and it is also better to create these before install, rather than changing them after.
- These service accounts will need to have run as a service, act as part of the operating system rights, plus be local admins on the vCenter server.
- The service account will also need access to the SQL vCenter database created in point 1
- When installing vCenter, make sure you are logged on with a domain account with local admin rights rather than a local account. It will also need rights to the SQl server. I got error "25004: Failed to create vcenter server repository" right at the end of the install which i think was due to this causing issues with connection to the SQL server.
- When installing, I found it much quicker to unzip the vCenter iso/zip onto a drive on the vCenter server, rather than connecting the iso to the CD or opening the zip from a remote server.
Sunday, 3 January 2010
ESXi Hints and Tips
Its worth finding out about and installing vMA
- Use vicfg-cfgbackup to save the configuration of a host. This backup can then be used if it is necessary to restore the host at a later point in time.
- To view the log files of a host, simply point your browser at https://hostname.vmware.com/host
- To view the datastore files of a host, simply point your browser at https://hostname.vmware.com/folder
- Us the vCLI command vifs to transfer files to/from ESXi hosts
- The command esxcli is used for multi-pathing module management
- It is not possible to have persistent HA logs either by using a datastore or syslog server as they are only stored locally on the server.
Thursday, 17 December 2009
PowerCLI to alter VM BIOS setting
I've been asked by a client how to change the BIOS boot order of a Virtual Machine so that they can PXE boot it first to build it, and then change it to boot from the hard disk afterwards.
So, I've not discovered any information where it is possible to actually change the order of boot devices, but it IS possible to allow/disallow certain devices. So, the code is as follows
Connect-VIServer ipaddress
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.extraConfig += New-Object VMware.Vim.OptionValue
$spec.extraConfig[0].key = "bios.bootDeviceClasses"
$spec.extraConfig[0].value = "allow:net"
(get-view (Get-VM -Name "Virtual Machine").ID).ReconfigVM_Task($spec)
Thursday, 3 December 2009
vSphere client crashes with C++ error
Update Manager Proxy settings
Just discovered something important when you are creating proxy settings in update manager for vSphere 4.
You must make sure that the account you are using for the proxy server
a) exists!!
b) is the service account that Update Manager is running under.
Friday, 6 November 2009
ESXi Architecture
This is my summary of the following VMware article:
www.vmware.com/files/pdf/vmware_esxi_architecture_wp.pdf
ESXi Components
1. VMkernel
POSIX like operating system. It provides functionality such as process creation & control, signals, file system and process threads. It provides resource scheduling, I/O stacks and device drivers to enable the running of multiple Virtual Machines.
2. File System
The VMkernel provides a simple in memory file system to hold config file, log files and staged patches. The file system layout is similar to the ESX Service Console.
The file System is independent of the VMFS file system, and if all VMFS file systems for the host are on shared storage, then the host can be a diskless machine. However if the host will be a member of an HA cluster, refer to this KB article as you will need to configure the location of your swap file:
Remote access to the file systems is manage by HTTP get and put requests with authentication against local groups and users privileges.
The file system is not persistent, and thus log files will be lost on reboot, so it is definitely worth configuring a syslog server. However, for ESXi embedded, configuration information is written to a readable and writable memory location. This memory is persistent, and is read from on boot.
3. Users and Groups
They can be defined locally for use with the Vi Client, VIM API, or remote command line.
4. User Worlds
"User World" is a process running in the VMkernel environment. The user world environment is very limited compared to normal POSIX-like environments. For Example:
- The set of available signals is limited.
- The system API is a subset of POSIX.
- The /proc file system is very limited.
- A single swap file is available for all user world processes. If a local disk exists, the swap file is created automatically in a small VFAT partition. Otherwise, the user is free to set up a swap file on one of the attached VMFS datastores, by changing the advanced paramenter ScratchConfig.ConfiguredScratchLocation, see KB link above for more details. For each host, the file is about 1GB in size, and each ESXi host will require a unique directory name for its swap file location. Probably the best approach is to have a single LUN for all swap files (say 10GB for 8 hosts).
The user world is a very limited set of functionality aimed at only running the processes required, and no more.
5. Direct Console User Interface
Runs in a user world. It is used for configuration and management interface through the system console. This is used for initial basic configuration of the host. It uses the system user dcui in the VMkernel so it can identify itself when communication with other processes. The DCUI can:
- Set administrator password
- Configure netowrking, or set it to DHCP
- Perform some network tests
- View logs
- Restart agents
- Restore defaults
it is possible to give individual users access to the DCUI by adding them to the localadmin group, thus removing the need to hand out the root password.
6. Other User World Processes
- hostd - provides interface to VMkernel. Tracks users & groups privileges and provides authentication.
- vpxa - used for connection to vCenter. Runs as special system user vpxuser and interfaces between hostd and vCenter.
- HA agent - runs in its own user world
- syslog daemon - used to forward logs to syslog server
- iSCSI discovery - is performed in its own user world. After discovery, the VMkernel handles all traffic. The iSCSI network interface is the same as the main VMkernel network interface.
- NTP - has process to manage NTP time synchronisation
- SNMP - has process to manage SNMP monitoring & alerts
7. Startup
Any upgrade to ESXi can be easily performed because the ESXi image is only 32MB, and thus will just be replaced for upgrades or patching. There are 2 banks for ESXi packages, and either can be used to boot the ESXi host. So if an upgrade is performed and there is a problem, the previous package can be used from the alternate bank. This can be either automatic, or the administrator can choose which bank to boot from.
8. CIM
The Common Information Model (CIM) is an open standard that defines how computing resources can be represented and managed. It enables a framework for agentless, standards-based monitoring of hardware resources for ESXi. This framework consists of a CIM object manager, often called a CIM broker, and a set of CIM providers.
The CIM providers provide a way gain management access to device drivers and hardware. Both hardware manufacturers and VMware have written specific CIM providers. These providers are packaged with ESXi and can be installed at runtime. The CIM broker take all the information from the CIM providers and presents it via standard APIs.
9. VI API
The VI API provides a common interface for vCenter, ESX and ESXi enabling bespoke applications and functionality to be developed, but obvioulsy certain functions will only work with certain targets.