StoreVirtual Storage
1748118 Members
3572 Online
108758 Solutions
New Discussion юеВ

Re: VSA boot up and shut down order with ESX

 
Gauche
Trusted Contributor

VSA boot up and shut down order with ESX

I'm adding this post to replace what was a rather long thread in the old vsa forum.

One issue with using a VSA as iSCSI storage on the same ESX server hosting the VSA is that rebooting the ESX server can take a long time, and may not complete, since the VSA has to shutdown first taking some storage offline before ESX is done shutting down.
Also on bootup the VSA is not online when ESX is first looking for iSCSI.
All this is avoided usually since VSA are meant to me clustered together to provide redundancy. But if using just one VSA, or a power event takes the whole cluster offline you would run into this issue.

There are scripts available now that were built by a collaborative effort in the old forum. These scripts make ESX servers capable of shutting down and booting up cleaner even if hosting the same VSA as they use for iSCSI storage.
Adam C, LeftHand Product Manger
7 REPLIES 7
Gauche
Trusted Contributor

Re: VSA boot up and shut down order with ESX

This was the first end to end script that did the following.

ESX server shutdown, and boot up script is attached.

The shutdown script automates shutting down VMs, shutting down VSA, and disabling iSCSI in a manner that allows the ESX server to shutdown cleanly.

The boot up script automates enabling iSCSI, starting the VSA, rescanning storage, and then starting VMs that are configured to auto start in ESX as per usual.

The disabling and enabling of the iSCSI adapter eliminates the long wait for iSCSI volumes at boot up.

To install simply remove the .txt file extension, copy it to your ESX server, make it executable, and run it. The single script sets up everything.

This does not work with ESXi, that will probably require something more involved inside of a remote CLI appliance.

The script is attached as a text file to this post (look for the paper clip icon)
Adam C, LeftHand Product Manger
Gauche
Trusted Contributor

Re: VSA boot up and shut down order with ESX

This second script was submitted by manicajk in the old forum. It has similar functionality to it as the other script, but a cleaner installer and uninstaller for it. Thanks.

The script is attached as a text file to this post (look for the paper clip icon)
Adam C, LeftHand Product Manger
EDSI
Visitor

Re: VSA boot up and shut down order with ESX

We have tried both versions of this script and are still having issues with the lockup on the shutdown and the virtual machines not seeing the iscsi datastore until after the vsa starts.

We called VMWare and opened a ticket, they tweaked the script and we are still having the same issue.

Anyone test this script recently?
EDSI
Visitor

Re: VSA boot up and shut down order with ESX

I think i found the issue, the installer for the HP VSA creates a directory named /Virtual San Appliance/ by default. The script does not like the spaces in the path. I moved the location of the vsa.vmx file and named the directory /vsa/ and all is working for the order of the script. I am not sure why the default would create a directory with spaces in the names, and also why VMWare support could not find this simple issue.

The original script works, just do not allow the use of spaces in your VSA path to your vmx file.
Atl User
New Member

Re: VSA boot up and shut down order with ESX

Has anyone come up with a script for ESXi 3.5?
Gauche
Trusted Contributor

Re: VSA boot up and shut down order with ESX

I think you can use the same scripts on ESXi for 3.5 but you'd have to go though the "unsupported" console to install them. Alt F1 on the ESXi host I think.
Adam C, LeftHand Product Manger
Atl User
New Member

Re: VSA boot up and shut down order with ESX

I found a somewhat reasonable solution to my quandary. I am using the vMA OVF appliance and a combination of Remote CLI and SSH commands.

1) Enable ssh on the ESXi server

2) generate ssh public/private keys on the vMA for the "root" user (/root/.ssh/) and don't user a passphrase (yes this isn't very secure, so don't use it in production)

3) on the ESXi server you need to create a /.ssh/authorized_keys file. If using a USB version of ESXi you'll need to create a new oem.tgz. (this site helps http://lars.karlslund.dk/?p=3)

4) Once you've got it setup so that from the vMA you can auto ssh into the ESXi it's just a matter of a few commands and timing of startup.

5) vi /etc/rc.local on the vMA

You'll need to add these 3 commands (replace vmhbaXYZ with your correct HBA and use your real password):

ssh root@SERVER_IP 'esxcfg-swiscsi -e'

vicfg-rescan --username root --password yourpassword --server SERVER_IP vmhbaXYZ

ssh root@SERVER_IP 'esxcfg-swiscsi -d'


6) in your automatic startup on ESXi, make sure VSA starts first, then after it has completely started, startup the vMA, and make sure any other VM on the direct attached storage (not on the virtual iSCSI) is setup to go after the vMA and has a long enough delay to have the vMA completely start, run it's commands, and let ESXi rescan the HBA.



I think that's all there was to it. :)