Friday, November 7, 2008

Wednesday, November 5, 2008

VMware RCLI Creating a session file for ESXi

The RCLI utility comes with the ability to create a session file for your host so that you do not need to repeat the user ID and password to a host when passing multiple perl script commands.

The session file that is created will have the host name and ID and password saved in it. This allows you to call/use this file when executing .pl scripts against the host, thus saving you the time of entering your ID and password every time.

Creating the session file:

In the following location of the RCLI install (assuming default path) you will find a save_session.pl, you will use this script to create your sesssion file.

C:\Program Files\VMware\VMware VI Remote CLI\Perl\apps\session>save_session.pl

The command looks like this:
>save_session.pl --savesessionfile c:\users\robert\ESX1host --server 10.10.1.105 --username root --password pass

This will create a file in c:\users\robert called ESX1host. The file is a session files that contains the informaiton for the host (10.10.1.105) wiht the ID or root and using a password of pass.

NOTE for Vista users - by default you do not have the ability to create files in the default installation folder of the RCLI application. Instead of using c:\users\robert you could have just as easly only put the file name. The perl scritp will then create the files in the same directory as the save_session.pl file. The scrit will not error out! But it will also NOT create the file (even when is says is did). So please use a path to a directory that you have the ability to write.

Now that you have a sessoin file for your host you can used it as follows:

Command without using the session file...
>vicfg-ntp.pl --server 10.10.1.105 --list
Enter username: root
Enter password:
No NTP servers configured.

Command using the session file...
>vicfg-ntp.pl --sessionfile c:\users\robert\ESX1host --list
No NTP servers configured.

At first it looks like more effort to create the file than to just enter the server name, user ID and password everytime. And it is if you only running a single command, but if you are going to run multiple commands againts a server all you have to do now is keep calling the same session file with a new script

>vicfg-vswitch.pl --sessionfile c:\users\robert\ESX1host --list
Switch Name Num Ports Used Ports MTU UplinksvSwitch0 64 4 1500 vmnic0
PortGroup Name VLAN ID Used Ports Uplinks VM Network 0 0 vmnic0 Management Network 0 1 vmnic0

or

>vicfg-vmknic.pl --sessionfile c:\users\robert\ESX1host --list
Interface Port Group IP Address Netmask MAC Addressvmk0 Management Network 10.10.1.105 255.255.255.0 00:0c:29:0e:8e:e2

Its worth the effort to create if you run more then one command... Espically since the file, once created can be used over and over again (assuming the password to the host has not changed).

VMware RCLI commands for ESXi

Using the RCLI to configure a VMware ESXi server.... All can be done via the Virtual Infrastructure client but with a little scripting to can easily configure, audit and manage multiple ESX i hosts.

I'll add real world syntax as I figure them out.... Updated 11-5-08

To help identify what command does you can use the --hlep switch wiht any of the pearl scripts.




  • vicfg-advcfg.pl - allows for the modification of any of the advanced configuraiton options.

vicfg-advcfg.pl --server 10.10.1.104 --get Cpu.MigratePeriod - returns the value of the Cpu.MigrationPeriod

  • vicfg-cfgbackup.pl - can backup and restore ESX settings

vicfg-cfgbackup.pl --server 10.10.1.104 --save rwgood

  • Restore the file

vicfg-cfgbackup.pl --server 10.10.1.104 --load rwgood --force

  • vicfg-dns.pl allows you to change the DNS seetings of a host
  • vicfg-dumppart.pl > helps with the support files
  • vicfg-module.pl > allows you to manged the loaded modules
  • vicfg-mpath.pl - all sort fo info on the VMFS paths

vicfg-mpath.pl --server 10.10.1.104 --list

  • vicfg-nas.pl
  • vicfg-nics.pl > configure the phsical NICs in the host
  • vicfg-ntp.pl > managed the NTP settings

vicfg-ntp.pl --server 10.10.1.104 --list > List the configured NTP servers on the host
vicfg-ntp.pl --server 10.10.1.104 --add time.gov > Adds time.gov to the ntp configuration
vicfg-ntp.pl --server 10.10.1.104 --delete time.gov > Removes the time.gov from the ntp configuration
vicfg-ntp.pl --server 10.10.1.104 --start > Starts the NTP service on the host
vicfg-ntp.pl --server 10.10.1.104 --stop > Stops the NTP service on the host

  • vicfg-rescan.pl > rescanning for VMFS and storage
  • vicfg-route.pl
  • vicfg-snmp.pl > configure your SNMP settings
  • vicfg-syslog.pl > configure the ESX host syslog target
  • vicfg-user.pl > local ESX i user management

vicfg-user.pl --server 10.10.1.104 -e user -o add -l Newusername -p password --role admin > This will add the user called Newusername wtih a password of password to the host and give the the permission of admin. --role options are the following admin read-only no-access

vicfg-dns.pl --server 10.10.1.104 > this will show you the DNS settings fo the host

  • vicfg-vmhbadevs.pl > all about the HBAs
  • vicfg-vmknic.pl > more and same infor for you nics
  • vicfg-vswitch.pl > configuring the vSwitches

vicfg-vswitch.pl --server 10.10.1.104 --add mine > adds new vSwitch called mine

vicfg-vswitch.pl --server 10.10.1.104 --add-pg public mine > adds a port group called public to the vSwitch mine

vicfg-vswitch.pl --server nhqesx036 vSwitch1 --pg mine --vlan 100 > This adds a vlan tag of 100 to the port goup mine.

vicfg-vswitch.pl --server 10.10.1.104 --link vmnic1 mine > adds the vmnic1 to the vSwitch called mine

  • vifs.pl > used to move files to and from the ESX host
  • vihostupdate.pl > updating and patching the ESX i

vihostupdate.pl --server 10.10.1.104 --bundle --install ESXe350-200807812-O-BG.zip > Install the ESXe patch on server 10.10.1.104

NEW - Built a utility to help update visit http://www.itsallvirtua.com/ downloads

vihostupdate.pl --server 10.10.1.104 -q > shows the version of the ESXi host

  • vmkfstools.pl > same as alway managing disk
  • vmkuptime.pl - does nothing yet
  • vms.pl
  • vmware-cmd.pl > same as always managing the VMs on the host

Thursday, October 23, 2008

ESXi Configurator Utility version 1.0.2

New release as of 10-23-08.

Made few updates to the user interface and fixed the issue with the application not being able to connect to an ESXi host with a blank password.

http://www.itsallvirtual.com/ downloads

Thursday, October 16, 2008

ESXi Configurator Utility

ESXi Configurator Utility is out!!!!!

A friend and I got together and created a web GUI that is built over the RCLI perl scripts that VMware publishes to support ESXi.

I for one love the i version of ESX and have been working to certify it for production use since Update 2 was released. I also started working with the RCLI scripts. These scripts enable all (or most) of the functionality that the services console gives to the server versions of ESX.

But wiht the announcement of ESXi being free to all users I started to look at RCLI utility and comparing what could and could not be done with the Virtual Infrastructure Client (not VirtualCenter but just the client connecting directly to an ESXi host). What I discovered was a backup and restore feature and the update script to patch the ESXi hyper visor. Both features are in this first release of the Configurator.

The time bomb issue that VMware had a few months ago was the key to me wanting to create this GUI application. It turns out that if you are not managing ESXi hosts with VirtualCenter and using VMware's Update Manager to patch the hosts you can only update an ESXi host by using the VMware RCLI update script.

Like many others I very quicly figured out the syntax for using the RCLI update script and got past the time bomb update, this included update all the USB key installs I had running as well.

So I found a programmer and asked nicely (bothered the heck out of her really) untill she taught me enough about creating a windows web application that could do these few features. We worked togher (her doing all the really cool stuff while I concentrated on the easy stuff that she showed me.) It started as an idea just to enable me to use a GUI instead of the RCLI scripts from a command line, and also an opportunity to me to learn c# and windows application development. (Used Visual Studio Express to create this app with C# has the language)

Well after many hours and with the skills of a real coder we finally ready to share this application. I call it the ESXi Configurator Utility (I'm not creative either) and I'm hopping it will hlep all thoes that are using ESXi in a stand along fashion or for thoes that are not running VMware Update Manager in VirtulaCenter.

Please feel free to comment make suggestions...

Wednesday, September 10, 2008

ESXi Lockdown Mode

So finally got a chance to work with and figure out the ESXi lockdown mode. Once I actually saw it in person it make complete sense...
Ways to access and ESXi host
a) Using VirtualCenter and you AD credentials
b) Using the VIC client direct to the ESXi host with the ESXi ID
c) Using the RCLI commands using the ESXi IDs
d) standing in front of the server wtih direct console access (keyboard & mouse attached to server) and using the ESXi IDs

The chart below show the four way to access an ESXi host along with the user credentials used...

Looking at this two thing jump out at me

Number 1 - if you are standing in front of you ESXi host and plan on making configuration changes you must have the 'root' password. No other ID will let you log in the console.

Number 2 - Lockdown mode really only disables the use of the actually 'root' ID from being used with either the VIC or the RCLI interface. Other users with 'root like' privileges that you create can still make changes to the ESXi host using these methods. Thus avoiding using VirtualCenter.

And since there is not a PAM module for ESXi if you do plan on creating users on each ESXi host you'll need to manage each host individually (IDs and Passwords), or go with generic account with 'root like' access which in that case you might as well just use the root ID.

Lockdow mode does make for a good idea if you don't have the need for any of the RCLI interfaces. This way you can keep the 'root' password in a safe, managed all the ESXi hosts via VirtualCenter and only break out the root password in the event you need to make changes to the ESXi host to fix a communiction issues with VirtualCenter.

Tuesday, September 9, 2008

Mendel Rosenblum Resigns from VMware

Was wondering how long it would take and yesterday 9-9-08 it happened. Mendel stepped down form his position at VMware. Everyone was guessing when this was going to happen, in my opinion is was all a matter of time. The only thing I could think of that could have been keeping him at VMware was some sort of language in his contract (if he even had one).

But now with the NY Times supplying more details about the firing of Mendels wife Diane Greene in July of this year his time as come to an end.

This should make for a very interesting week next week at VMworld...

Sunday, August 24, 2008

Applying the Time Bomb Patch to an ESXi server

Anyone running a VMware ESX server has already heard about the time bomb issue with 3.5 update 2 and have hopfully fixed the issue by now.

But I wanted to post my findings wtih patching the ESXi 3.5 U2 server using the RCLI. This is the way you need to patch a host that is not being managed by VirtualCenter server that has update manger running.

First you'll need to install the RCLI sofware on your PC, (for this I'm going to cover using the Windows version of the RCLI.

This link will help download and install the RCLI software:
http://pubs.vmware.com/vi3i_e35/server_config/wwhelp/wwhimpl/common/html/wwhelp.htm?context=server_config&file=sc_use_rcli.18.8.html

You will also need to get the u2 patch - that can be found at http://www.vmware.com/landing_pages/esxexpresspatches.html

The file you need can be found at - http://www.vmware.com/go/esxiu2patch081208

If you did a default install of the RCLI software a command prompt link will be created in the vmware folder that will take you to the following location (Start All Programs VMware RCLI)

C:\Program Files\VMware\VMware VI Remote CLI\

Once at thsi command prompt change into the bin folder making your path
C:\Program Files\VMware\VMware VI Remote CLI\bin>

Now copy the ESXi patch that you downloaded and put in the bin folder, file should be called ESXe350-200807812-O-BG.zip

Now you are ready to install the patch to your ESXi host - - -

First lets find out what versions your ESXi box is currently running - from the bin location run the following command.

vihostupdate.pl --server 10.10.1.104 -q
Where 10.10.1.104 is your ESXi IP or name - and you will be promted for an id and password of the host.

You will see results that look like this - assuming you are running ESXi 3.5 u2 gold code.
VMware ESX Server 3i 3.5.0 build-103909
Installed packages:

firmware 103909
viclient 103682
tools 103909

Run the following command from this location
C:\Program Files\VMware\VMware VI Remote CLI\bin>

vihostupdate.pl --server 10.10.1.104 -i -b ESXe350-200807812-O-BG.zip

Where 10.10.1.104 is the name or IP of your host. (its important to put the -i before the -b)

The above command will prompt you for an ID and password to the host - enter it and the patch will connect to the host and begin the install.

The fist step of this command will extract the zip file to the RCLI server; that is what the -b switch does - if you look in the Bin folder on your RCLI server will will see four folders get created.
The ESXe350-200807812-O-BG folder contains the matadata.xlm file that xml file is called buy the script and it applies the patches. The other three folders contain the actual patches; one for the firmware, one for the tools and the last is for the viclient.

When you run the command you will see the following output -
Enter username: root
Enter password:
unpacking ESXe350-200807812-O-BG.zip ...
( skipping verification : ESXe350-200807812-O-BG/ESXe350-200807812-I-BG.zip.sig )
unpacking ESXe350-200807812-O-BG/ESXe350-200807812-I-BG.zip ...
( skipping verification : ESXe350-200807812-O-BG/ESXe350-200807402-T-UG.zip.sig )
unpacking ESXe350-200807812-O-BG/ESXe350-200807402-T-UG.zip ...
( skipping verification : ESXe350-200807812-O-BG/ESXe350-200807403-C-UG.zip.sig )
unpacking ESXe350-200807812-O-BG/ESXe350-200807403-C-UG.zip ...
Installing : ESXe350-200807812-I-BG
Copy to server : VMware-image.tar.gz ...
Copy to server : VMware-OEM-image.tar.gz ...
Copy to server : descriptor.xml ...
Copy to server : install.sh ...
Copy to server : contents.xml.sig ...
Copy to server : contents.xml ...
Removed ESXe350-200807812-I-BG Success Not applicable : ESXe350-200807402-T-UG. Skipped.Not applicable : ESXe350-200807403-C-UG. Skipped.

The host needs to be rebooted for the new firmware to take effect.
Type 'yes' to continue:


Type yes to re-boot the host, when the server is finished re-booting us the -q command to verify the patch level you should be at the following levels on the three versions.
VMware ESX Server 3i 3.5.0 build-110180
Installed packages:

viclient 103682
tools 103909
firmware 110180

You'll notice that only the firmware verison is changed.

Wednesday, August 6, 2008

ESXi running without no USB key needed

So today I confimed (again) that you do not need to keep the ESXi USB key attached to the server once its loaded. You can make all the changes to the server, all without the bootable USB key physically attached....


Now why??? No idea even why I tested it, and have no real reason for the ability to do it. But its cool, server with no hard drives and no USB key (internal or external) running ESXi and hosting VMs. Not that is a hypervisor.

BUT - the ESXi web page will work but the VI Client download link will not work unless you attach the USB drive again. That file is not loaded in to memory.

Sunday, July 27, 2008

VMware ESXi for Free

VMware has announced that ESX i (hypervisor version of ESX) will be available for free starting the week for July 28th.

http://blogs.vmware.com/partner/2008/07/important-produ.html

For those that do not know ESX i is has the same VI3 functionality as the full ESX server version minus the service console. Wich in my opinion is long over due, the services console has done nothing but confuse ESX with some sort of Linux based operating systems. When in fact ESX is and always has been a hypervisor and the service console is just a virtual machine used to manage the hyoervisor.

ESX i did not launch with all the VI3 features (VMware HA, VCB) and that was one major reason why a lot of customers/admins did not move forward. That combined with people using the services console for things other then management, I.E. backups, third party agents ect.

But with the latest updates to ESX i you can now fully deploy it into a VI3 environment (assuming your operation process do not relay on third part agents running in the services console).

I for one am excited about this announcement, I've been working/planning the migration away for ESX server to i since it was announced last September (2007). Now with pricing on my side and the features matching that of ESX server, I have a more clear path to deploying ESX i into production.

Friday, July 25, 2008

vCharterPro - Review part 1

Been working for a while with Vizioncore on their new release of the VI3 monitoring utility. vChaterPro (new release to vCharter) is a monitoring tool for a VMware Virtual Infrastructure.

The tool has been a great help and is to a fault over detailed in the information it supplies, but once you get past the shock of being overloaded with data and start digging into and finding valuable information about your VMs you will be hooked on the interface.


For me is has become the interface that I now keep up and running all day, its replaced the VirutalCenter client on my desktop. I'm not saying it replaces VC!!! I'm saying for me an Architect that does not deploy VMs or ESX hosts, I can not not log into VC for the VM information that is valuable to me. I.E. host and VM perform ace.

The user interface at first glance is not very intuitive and you'll need to do a lot of work setting up application dashboards but when I mean work its not coding its as easy as drag and drop. But finding what your looking for can be a challenge (con of having all this information at our finger tips).


Above is a screen shot of one of my favorite screen dashboards, its an over over of the entire VirtalCenter - from here I can see alerts, CPU load, Network, disk, memory all at a high level. From here I can now dive into any direction I wish.

With vCharterPro you can drill down form Cluster all the way to VM and see any of its current or past usage. The tool also enables you to create unique dashboards based on any topic you wish.

I use the dashboard feature every time I deploy a new infrastructure for a project. First by using vCharterPro to monitor the development and QA servers I can then use those number to build a production world that I know will support the needs of the application.

Thursday, July 24, 2008

1st Run

This a sample test to see how the site works with my main page http://www.virtualrw.com/. I'm figuring this is an easy way to add a good blogging utility to my site.