<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dave Hildebrand.com &#187; VMWare</title>
	<atom:link href="http://www.davehildebrand.com/tag/vmware/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davehildebrand.com</link>
	<description>The IT Crowd</description>
	<lastBuildDate>Sun, 05 Sep 2010 06:25:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Backup your VM’s with VSS</title>
		<link>http://www.davehildebrand.com/2008/01/31/backup-your-vm%e2%80%99s-with-vss/</link>
		<comments>http://www.davehildebrand.com/2008/01/31/backup-your-vm%e2%80%99s-with-vss/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 17:29:27 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Tech Help]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://www.davehildebrand.com/?p=103</guid>
		<description><![CDATA[I’ve been looking for an easy way to backup my VMware images since putting 3 Virtual Machines (VM’s) into production. After having my SharePoint site crash a few months ago I redoubled my efforts to find such a solution. Since I use the free VMware Server I would have to either find a script online [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.davehildebrand.com/wp-content/uploads/2008/01/013108-1728-backupyourv1.thumbnail.jpg" class="alignright" alt="013108-1728-backupyourv1.jpg" />
<p>I’ve been looking for an easy way to backup my VMware images since putting 3 Virtual Machines (VM’s) into production. After having my SharePoint site crash a few months ago I redoubled my efforts to find such a solution. Since I use the free VMware Server I would have to either find a script online or roll my own script. This week I had some success finding numerous scripts. After testing many of these scripts and finding none that worked the way I wanted them to, I decided to take the ideas I learned from these scripts and started writing my own.</p>
<p><span id="more-103"></span></p>
<p>To minimize the VM downtime I used Volume Shadow Copy Services (VSS) component, which is built into Windows XP &#038; 2003. With VSS and VMware Tools I can shutdown the VM’s gracefully, use VSS to make a snapshot of the drive that houses the VM images and mount this snapshot to a virtual drive. Then I can restart the VM’s and either do a straight copy of the server images or zip them. From the testing I have done so far the VM’s are out of service anywhere from 1 to 2 minutes.</p>
<p>My script is by no means the best option out there. I have hard coded my server image paths, do no error checking and do not test the status of the VM’s before shutting down or starting them up. I may add some of these items to my script as I learn more about the VMware Tools API and scripting in general.<br />
<code><font size="1"><br />
@echo off<br />
echo “Shutting down Virtual Machines…”<br />
cd “C:Program FilesVMwareVMware Server”<br />
call vmware-cmd “F:Virtual Machinesserver1Windows XP Professional.vmx” stop soft<br />
call vmware-cmd “F:Virtual Machinesserver2Windows Server 2003 Standard Edition.vmx” stop soft<br />
call vmware-cmd “F:Virtual Machinesserver3Windows Server 2003 Standard Edition.vmx” stop soft<br />
echo “Setting up Shadow Drive…”<br />
cd “C:vmbackup”<br />
vshadow.exe -nw -p -script=GeneratedVarsTempScript.cmd f:<br />
call GeneratedVarsTempScript.cmd<br />
vshadow.exe -el=%SHADOW_ID_1%,O:<br />
echo “Starting Virtual Machines…”<br />
cd “C:Program FilesVMwareVMware Server”<br />
call vmware-cmd “F:Virtual Machinesserver1Windows XP Professional.vmx” start<br />
call vmware-cmd “F:Virtual Machinesserver2Windows Server 2003 Standard Edition.vmx” start<br />
call vmware-cmd “F:Virtual Machinesserver3Windows Server 2003 Standard Edition.vmx” start<br />
echo “Map remote storage…”<br />
net use n: \backupservervirtualmachines /persistent:no /y<br />
echo “Copying to remote storage…”<br />
xcopy “O:Virtual Machinesserver1*.*” n: server1<br />
xcopy “O:Virtual Machinesserver2*.*” n: server2<br />
xcopy “O:Virtual Machinesserver3*.*” n: server3<br />
echo “Cleaning up…<br />
net use n: /delete<br />
cd “C:vmbackup”<br />
VSHADOW.EXE -ds=%SHADOW_ID_1%<br />
del C:vmbackupGeneratedVarsTempScript.cmd<br />
</code></font>
</p>
<p>I chose to copy my server images to a remote server instead of zipping the image.  Testing showed that it took 4+ hours to zip 40GB and just under an hour to copy the same amount over a gig network connection.  Each time the script runs it overwrites the files on the remote server.  The remote server is backed up to tape so I have 2 backup copies of my VM&#8217;s.  I haven&#8217;t decided on how often I will have this script run.  My initial thoughts were to run it once a week.  Although I could easily edit the script so that the images are backed up according to different schedules.</p>
<p>If I had this script in place when my Sharepoint server crashed I would have been able to restore to an earlier image and saved myself a lot of headaches.</p>
<p>Feel free to add comments, suggestions or complaints on how my script works. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davehildebrand.com/2008/01/31/backup-your-vm%e2%80%99s-with-vss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
