Running a VM on a non-array drive


Recommended Posts

There is a plugin and a package that can be installed that will mount a non-array drive, and control the starting and stopping of VMs.

 

Install the SNAP plugin from here: http://lime-technology.com/forum/index.php?topic=31594.msg294062#msg294062 '>http://lime-technology.com/forum/index.php?topic=31594.msg294062#msg294062  This will mount your non-array drive.

 

You will also need the powerdown package.  Powerdown is installed by Dynamix, but it can be installed as a plugin from here:  http://lime-technology.com/forum/index.php?topic=31594.msg294062#msg294062

 

Once you have the SNAP plugin and the powerdown package installed do the following:

Install your non-array drive.  I recommend a sata drive formatted for the reiserfs file system.

Go to the SNAP plugin web page and double click on the drive you want to use.  Name the drive share name.  For this example name it 'VMs'.

Now create a script on the flash drive in /boot/config/plugins/powerdown/rc.unRAID.d/ directory and name it 'S00.sh'.

 

The file contents should be:

/boot/config/plugins/snap/snap.sh -ms VMs
xl create /mnt/user/VMs/ArchVM.cfg

 

Now create a script on the flash drive in /boot/config/plugins/powerdown/rc.unRAID.d/ directory and name it 'K00.sh'.

 

The file contents should be:

xl shutdown -a -w

 

Now go to a telnet session and type:

/etc/rc.d/rc.unRAID update

 

This will update the powerdown scripts from your scripts on the flash drive.

 

Now go to the webGui and stop the array.  Your VMs should stop.

 

Now start the array and your VMs should re-start.

 

You can now run your VMs from non-array drives and don't need to have them reside on the array or the cache drive.

 

Your VMs will now start on the array started event, and shutdown on the array event that occurs just prior to unmounting the array drives.

 

If powerdown is initiated by a UPS shutdown, ctrl-alt-del, the command line "powerdown", or the power button being pressed, the VMs will also be stopped.

 

NOTE: SNAP unmounts any SNAP mounted drives on the array stopped event.  This may cause a problem if you don't stop your VMs with the 'K' file.  Theoretically the unmounts should fail, but I have not tested this because I don't have a system that will allow me to run a VM on a non-array drive.  Consider this procedure to be Beta at this point until someone confirms that it works.

Link to comment

I do have SNAP installed but I am currently using my cache drive for my VMs. Just want to make sure I understand.

 

The Kxx scripts are executed by powerdown (thanks) so I should add the K00.sh just as you have it here and it will shutdown all Xen virtuals, correct?

 

Since I am running my VMs on my cache drive can I just use a line similar to the 2nd line in the S00.sh script to have my VM automatically started?

 

Link to comment

I do have SNAP installed but I am currently using my cache drive for my VMs. Just want to make sure I understand.

 

The Kxx scripts are executed by powerdown (thanks) so I should add the K00.sh just as you have it here and it will shutdown all Xen virtuals, correct?

 

Since I am running my VMs on my cache drive can I just use a line similar to the 2nd line in the S00.sh script to have my VM automatically started?

 

Yes.  Use the same scripts but remove the line mounting the non-array drive with SNAP and reference the location of your VM on the cache drive.

 

The K script can be used to stop your VM.  The S script can be used to start it.  You don't need to add anything to the 'go' file to start your VM.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.