Enable VMotion and iSCSI in scripted install Print
Tuesday, 30 June 2009 16:31

Last week I posted my UDA experience. I was quite satisfied with the results, but for some reason I couldn't enable VMotion and iSCSI.

It took me some time so resolve the issue. Let me explain what I 'think' is happening:

S99

rc.local is NOT the last started script (while it should). This is very important since Pegasus is doing some stuff AFTER the rc.local. This is because VMware made multiple S99 scripts. I think this is a major issue, since all S99 scripts are started in alphabetical order. So in our case the boot is in this order:

S99local
S99pegasus
S99vmware-autostart
S99vmware-vpx (only there after adding ESX to vCenter)
S99wsman

So during %post I rename '/etc/rc.d/rc3.d/S99local' to '/etc/rc.d/rc3.d/S99zlocal' (notice the 'z' in the filename). Now it always starts last during boot. Huge improvement. I think VMware should not be using S99, there are plenty of other options.

Output

When you are able to run a command in rc.local started interactively, but it is not running during boot, the command might need some kind of output device. Now I've been trying to output the command to '/dev/tty1' but that doesn't work (since /dev/tty1 only exists after the last commands in rc3 are finished). But it does work if you output the command to a file, like /tmp/output. Example:

/etc/rc.d/init.d/sshd restart 2>&1 /tmp/output

Using the method I was able to enable VMotion during scripted install! It also works if you put the VMotion enabling stuff in a script and call the script with an output to file.

Environment variables

Some scripts are not using an absolute path to commands. This way you'll get an issue when the correct $PATH variables are not loaded yet. So it makes perfect sense the command runs during interactive start of rc.local, but not during boot. The way to resolve this is using 'su'. Example:

su - root -c "<command>"

Using this method I was able to get the iSCSI stuff going!

Wait a minute!

Right after boot and during rc.local, not all services are running. So I use sleep to wait some time to make sure those services are running (like the VMware management services). Use 'sleep <n>' where <n> is the number of seconds to wait. I sleep for 120 seconds but I guess it can be much shorter, not tested yet.

Echo "DONE"

For some strange issue I had problems with ^M characters, dos files and ? (question marks) after filenames. This is due to a bug I guess, but as I explained earlier in my previous article, Patrick van Rantwijk showed a workaround I used to start commands. It is adding ' | echo "DONE" ' to the end of the command.

So there you go, I'll need some tidying up to do and I'll post my script soon. Will let you know. But using the above methods you should be able to get EVERYTHING working. Goodluck.

Comments (0)
Write comment
Your Contact Details:
Gravatar enabled
Comment:

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."