Sunday, January 13, 2008

VMWare ESX 3.5 crash introduction - in at the deep end!

As a developer and for systems testing I have used VMWare workstation and VMWare Server for some time, however Ive felt that I needed to get to grips with ESX server to really take advantage of virtualisation. It should be pretty similar to VMWare Server shouldn't it - errm well no...

Firstly you can download a 60 day eval of ESX 3.5 server and other components from VMWare. This gives you a chance to learn but I didn't realise the curve would be quite so steep.

I created a boot disk, booted onto an 8Gb server taking most of the default options and I was impressed how fast it loaded. It asked me to enter a base IP address and gateway which I put it a standard 192.168.x.x address (I thought it would be easy to change after) and rebooted.

ESX booted fine, but just gave me a Linux prompt - no GUI, no friendly interface, just a command line. I haven't worked on Unix since University over 20 years ago so this was a shock.

The first thing you need to do is a connect a browser from another machine on the network and download the "VMWare Infrastructure Client". From here you can carry out quite a lot of admin.
BUT here was my first problem, I had made a mistake on the initial IP address configuration and couldn't find any way to change it to DHCP or anything else !

It turns out that to change an IP address on the ESX server is quite complex, needing to use the system console to deleting a configuration file, re-create it and then update the gateway using the vi text editor somewhere else! My thanks to Damian Murdoch for his article on how to do this. But although I followed this I couldn't find how to switch it to DHCP, so I bit the bullet and installed ESX server from scratch for a second time, this time choosing the DHCP option.

Now I could talk to the ESX server from the "VMWare Infrastructure Client", so I created a new "Resource Pool" and created a new "Virtual Machine" so I could build a Windows 2003 server.

I had a Windows 2003 ISO on my machine with the Infrastructure client but I could find any way of linking the new "Virtual Machines" CD drive to this ISO - except by using the "Connect to CD/DVD" button. This button only works once you start your new VM - so you have to be quick to click on it and connect it to your ISO whilst your VM is booting. Trouble is that the VM boots so fast that it ignores the CD boot and just tries a DHCP network boot and gives up.

Transferring files and ISO's to the ESX Server
I could have burnt a CD from the ISO and put it in the ESX physical server, but I was working remotely and so thought I'd just copy the ISO on the the ESX store and link the new Virtual machines CD to it.

Again a problem. If you are only running ESX Server you seem to need to access the ESX using a form FTP Server. I found a Free Utility called Veeam FastSCP 2.0 which seemed to answer my problem really well, so I loaded it up and tried to log in. As a rookie I tried to login as root but got an access denied error. Searching support forums told me that FastSCP would not login as root except if you check the elevate to root check box and enter the root password. Well this doesn't seem to work on ESX3.5 so I had to create a new user using the Infrastructure client. (You select the ESX Server Icon on the LHS and there is a Users and Groups tab).

Using this new user login, I could access the ESX file system and create Folders, however whenever I tried to copy and paste a file I received a timeout error. I tracked this down to a tightening of the ESX 3.5 firewall. FastSCP uses ports 2500, 2501... but these are now locked down in ESX 3.5. The option is to open the ports which FastSCP uses by using the ESX console command "esxcfg-firewall -o 2500,tcp,in,FastSCP", however you need to do this for 2501, 2502... etc An alternative is to open the firewall whilst copying the files using "esxcfg-firewall --allowIncoming" and then closing it aftewards using "esxcfg-firewall --blockIncoming" - source discussion on "Transfer timeouts" here.

This worked well and I could transfer my ISO file to the ESX store. One forum suggested transferring ISO's to the /vmimages folder, however this seems to be mounted under /dev/sda2 which only had 5Gb of space. If you right click on the properties of the connected server in FastSCP then it will list the devices with space. I ended up using /vmfs/volumes/xxxx.

Now having the Win2k3 iso on the ESX file store, I could edit the new Virtual Machine settings to point its CD to the ISO on the ESX store. (Remember to check the enable the CD device tick box as well as connecting it to the ISO).

Thus this is the story so far. I have a Windows server running on ESX after a weekend of head scratching and searching blogs and forums!

I know that the ESX platform is a very very powerful suite, but for beginners with simple requirement it seems rather tricky to get started!

3 comments:

Anonymous said...

Thanks Mark!

I ran into this exact problem and really appreciate your instructions on correcting it.

Thanks again!

Anonymous said...

Mark,
Another workaround is to press esc in the console screen when the virtual machine is loading, once the boot from device menu is loaded you can then re-select the connect to CD/DVD and point to the iso on your local machine, then just select boot from CD/DVD from the menu in your virtual machine console window

Anonymous said...

I am sharing your frustration also. The stock ESX 3.5 OS is stripped to the bone, no wget, lynx, mc, no working yum. All these things seemed to work on earlier versions fine.