<?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>Parkingdenied &#187; Computers</title>
	<atom:link href="http://www.parkingdenied.com/category/computers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.parkingdenied.com</link>
	<description>Redline is just a suggestion</description>
	<lastBuildDate>Wed, 26 Oct 2011 14:15:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Microsoft KMS licensing quick tips</title>
		<link>http://www.parkingdenied.com/2011/10/26/microsoft-kms-licensing-quick-tips/</link>
		<comments>http://www.parkingdenied.com/2011/10/26/microsoft-kms-licensing-quick-tips/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 14:15:01 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[KMS]]></category>
		<category><![CDATA[Licensing]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=271</guid>
		<description><![CDATA[From the cmd line run the following. View Current Counts cscript C:\windows\system32\slmgr.vbs /dlv all Uninstall KMS slmgr /upk Convert client from MAK to KMS slmgr /upk slmgr /ipk &#60;KMS Client Key&#62; Set KMS Server slmgr /skms servername.fqdn.here]]></description>
			<content:encoded><![CDATA[<p>From the cmd line run the following.</p>
<p>View Current Counts<br />
cscript C:\windows\system32\slmgr.vbs /dlv all</p>
<p>Uninstall KMS<br />
slmgr /upk</p>
<p>Convert client from MAK to KMS<br />
slmgr /upk<br />
slmgr /ipk &lt;KMS Client Key&gt;</p>
<p>Set KMS Server<br />
slmgr /skms servername.fqdn.here</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2011/10/26/microsoft-kms-licensing-quick-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recreate the NTFS change journal</title>
		<link>http://www.parkingdenied.com/2011/10/26/recreate-the-ntfs-change-journal/</link>
		<comments>http://www.parkingdenied.com/2011/10/26/recreate-the-ntfs-change-journal/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 14:14:11 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[NTFS]]></category>
		<category><![CDATA[USN]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=269</guid>
		<description><![CDATA[Recently I have found a few machines having issues with their backup software. From the logs the NTFS  journal was missing. Quick fix is to run this command substituting in your own drive letter. fsutil usn createjournal m=2147483648 a=536870912 F:]]></description>
			<content:encoded><![CDATA[<p>Recently I have found a few machines having issues with their backup software. From the logs the NTFS  journal was missing.</p>
<p>Quick fix is to run this command substituting in your own drive letter.</p>
<p>fsutil usn createjournal m=2147483648 a=536870912 F:</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2011/10/26/recreate-the-ntfs-change-journal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic lists and mail migration in Exchange 2007</title>
		<link>http://www.parkingdenied.com/2011/01/23/dynamic-lists-and-mail-migration-in-exchange-2007/</link>
		<comments>http://www.parkingdenied.com/2011/01/23/dynamic-lists-and-mail-migration-in-exchange-2007/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 11:13:33 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/2011/01/23/dynamic-lists-and-mail-migration-in-exchange-2007/</guid>
		<description><![CDATA[Just a couple of quick tips which have helped me recently. Unlike Exchange 2003, creating dynamic lists based on AD attributes has become a little more complicated. Granted there is a built in wizard which works for some basic queries but doesn’t have the fine grained control that I needed. For example to create a [...]]]></description>
			<content:encoded><![CDATA[<p>Just a couple of quick tips which have helped me recently. Unlike Exchange 2003, creating dynamic lists based on AD attributes has become a little more complicated. Granted there is a built in wizard which works for some basic queries but doesn’t have the fine grained control that I needed.</p>
<p>For example to create a dynamic mailing list which will contain all users who have been marked as being in say the Perth office. This refers to the office field which you can set through AD users and computers or via the Exchange console. To create this load your Exchange shell as admin and run the following.</p>
<p>New-DynamicDistributionGroup -Name &#8216;Perth Staff&#8217; -OrganizationalUnit yourdomain.com.au/MyBusiness/Users/Staff&#8217; -Alias &#8216;PerthStaff&#8217; -RecipientFilter { (Office -eq &#8216;Perth&#8217;) }</p>
<p>To break it down you are limiting your search scope with the –OrganizationalUnit which improves performance by not having to search the entire tree when you don’t need to. The -Alias is self explanitory and the –RecipientFilter is simply what you are filtering on and in this case its the Office field and the fact it equals Perth.</p>
<p>This is just a simple dynamic list, check out the Microsoft page here <a href="http://technet.microsoft.com/en-us/library/aa996561(EXCHG.80).aspx">http://technet.microsoft.com/en-us/library/aa996561(EXCHG.80).aspx</a> for more advanced examples and options.</p>
<p>&#160;</p>
<p>Mail migration between mailboxes has always been a bit of a pain. In the past Exmerge was the tool of choice however this is no longer needed come Exchange 2007. This could be useful for archiving mail out from one mailbox to another on different storage (Exchange 2010 has archiving built in which is much better) or you can even go to PST for maybe permanent archival to tape or optical media.</p>
<p>Make sure you have the latest service and you can simply run the export-mailbox tool via the Exchange shell.</p>
<p>export-mailbox –identity source.mailbox -includefolders &quot;\Inbox&quot; -MaxThreads 4 –TargetMailbox destination.mailbox -TargetFolder Archive</p>
<p>You can filter this further if needed but it’s relatively straight forward and will pull all the mail you specify out and put directly into the target mailbox without having to go to PST in between or use Outlook.</p>
<p>Good luck and have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2011/01/23/dynamic-lists-and-mail-migration-in-exchange-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto generate Exchange 2007 certificates</title>
		<link>http://www.parkingdenied.com/2011/01/23/howto-generate-exchange-2007-certificates/</link>
		<comments>http://www.parkingdenied.com/2011/01/23/howto-generate-exchange-2007-certificates/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 10:55:19 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/2011/01/23/howto-generate-exchange-2007-certificates/</guid>
		<description><![CDATA[By default Exchange uses a self signed certificate. If you are allowing external access its best practice to use a CA signed certificate either by your own internal CA or an external 3rd party trusted CA. So to generate yourself a signing request open an Exchange shell as admin and run the following. New-ExchangeCertificate -GenerateRequest [...]]]></description>
			<content:encoded><![CDATA[<p>By default Exchange uses a self signed certificate. If you are allowing external access its best practice to use a CA signed certificate either by your own internal CA or an external 3rd party trusted CA.</p>
<p>So to generate yourself a signing request open an Exchange shell as admin and run the following.</p>
<p>New-ExchangeCertificate -GenerateRequest -SubjectName &#8220;cn=remote.domain.com.au&#8221; -IncludeAcceptedDomains -DomainName additional.domain.com.au,internal.domain.com.au -IncludeAutoDiscover -Path c:\mycert.req</p>
<p>To break this command down, –GenerateRequest and –SubjectName are pretty straight forward and define the primary subject for the certificate. –IncludeAcceptedDomains tells it to add any other accepted domains to the certificate, useful if you accept mail for multiple domains. –DomainName is for additional domains you wish to specify, sometimes you may have a split internal and external domain so this would be used in that instance. And –IncludeAutoDiscover is one that gets forgotten but adds the autodiscover domain name to the certificate. If you do not include your autodiscover domain or the domain of the server it is on then you may get certificate errors when launching Outlook.</p>
<p>So now you have your certificate request, either plug it into your internal CA to get signed or pass this on to a 3rd party to get it signed by them. You should get a certificate file back and once you do simply run the following from your admin Exchange shell.</p>
<p>Import-ExchangeCertificate -Path C:\certnew.cer</p>
<p>Next step is to tell Exchange to use the certificate. Upon importing you should get the thumbprint of the certificate. With this you can enable the certificate by running the following and substituting the thumbprint.</p>
<p>Enable-ExchangeCertificate -Thumbprint THUMBPRINT -Services SMTP,POP,IMAP,IIS</p>
<p>One gotcha that I have seen a couple of times now is that the IIS/SMTP certs don’t stick. This presents itself after a reboot when suddenly its reverted back to the original certificate. In these cases I have found it necessary to re-run the command with just IIS and SMTP like below.</p>
<p>Enable-ExchangeCertificate -Thumbprint THUMBPRINT -Services SMTP,IIS</p>
<p>And that should be it, your certificate will take affect immediately and you should be good to go.</p>
<p>One last note, its worth keeping in mind that your paths may vary in terms of the OWA, OAB and Autodiscover paths and you should check to ensure that these are all correct. Domain name mismatch is pretty common which can create error messages which have the potential confuse users.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2011/01/23/howto-generate-exchange-2007-certificates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto remote restart ARD from SSH</title>
		<link>http://www.parkingdenied.com/2011/01/23/howto-remote-restart-ard-from-ssh/</link>
		<comments>http://www.parkingdenied.com/2011/01/23/howto-remote-restart-ard-from-ssh/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 07:41:54 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=249</guid>
		<description><![CDATA[If you have ever been working with an Apple server/desktop you will have come across ARD. It&#8217;s Apple Remote Desktop and it&#8217;s quite neat. But it&#8217;s sadly only for Mac. This means if your on another OS you need some other way to connect. Luckily ARD is really just VNC with some Apple Propriety addons so if [...]]]></description>
			<content:encoded><![CDATA[<p>If you have ever been working with an Apple server/desktop you will have come across ARD. It&#8217;s Apple Remote Desktop and it&#8217;s quite neat. But it&#8217;s sadly only for Mac. This means if your on another OS you need some other way to connect. Luckily ARD is really just VNC with some Apple Propriety addons so if enabled we can VNC straight to the machine, however it does have a few issues. One major problem is that ARD falls over quite a lot, especially if you use incorrect settings like the new experimental 2mbit mode within UltraVNC etc. So if you manage to crash ARD what you need to do is restart it and that can be a pain if the server is remote. As OSX shares many traits with other UNIX operating systems you can in most cases SSH in and restart the service, to do this simply run the command below and you should then be good to go.</p>
<p>sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -stop</p>
<p>sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -privs -all -restart -agent</p>
<div>Of course if you login as root you will not need to use the sudo part of the command.</div>
<div></div>
<div>And that&#8217;s it. Problem fixed!</div>
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2011/01/23/howto-remote-restart-ard-from-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP WMI Library for Linux</title>
		<link>http://www.parkingdenied.com/2010/02/24/php-wmi-library-linux/</link>
		<comments>http://www.parkingdenied.com/2010/02/24/php-wmi-library-linux/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 04:39:33 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=220</guid>
		<description><![CDATA[I&#8217;ve just released a WMI/PHP library which will allow you to easily WMI query Windows machines from your Linux server via PHP. It is somewhat of an extension of the CactiWMI project as it used that code base as a reference for the query and processing of the returned data. Whilst there are a number [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released a WMI/PHP library which will allow you to easily WMI query Windows machines from your Linux server via PHP. It is somewhat of an extension of the CactiWMI project as it used that code base as a reference for the query and processing of the returned data. Whilst there are a number of libraries in existence for this purpose on Windows there appeared to be none for when running PHP on Linux.</p>
<p>So why has this all come about. In my job I&#8217;ve been working on a small helpdesk type application written in PHP. The idea being that it presents all the information about the user, computer and helpdesk ticket that we are working on in one place. It also provides a quicker interface for searching information than the existing systems on their own. For this I needed to be able to hook into Active Directory, the MSSQL job tracking DB and of course WMI data for the remote PC. All this from the Linux based server.</p>
<p>So I branched off some code from the CactiWMI project and initially wrote it as a simple wmi() type function to run basic queries against remote machines. This quickly became a bit of a pain as I needed to add more arguments to allow filters and then more code to decide if a filter had been supplied or not etc so dumped it and rewrote it into a WMI object.</p>
<p>Now what we have is a reasonably simple library which you can include into your project, create the WMI object and throw some queries at hosts. The data returned at the moment is a little rough as its just a numerically indexed multi dimensional array but should make iteration very easy. I&#8217;ll be looking for suggestions as to what I can improve as it&#8217;s the first library like this I have had to write and I&#8217;ve probably made plenty of rookie mistakes.</p>
<p>I&#8217;ve attached a copy of the current stable release and an example file which should get people started until I can add some documentation. I may look at releasing the helpdesk app as well as it&#8217;s come in quite useful <img src='http://www.parkingdenied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>SVN Repository is located here <a href="http://svn.parkingdenied.com/PHPWMILib/">http://svn.parkingdenied.com/PHPWMILib/</a></p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2010/02/24/php-wmi-library-linux/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Automated VirtualBox + LVM Snapshot VM Provisioning</title>
		<link>http://www.parkingdenied.com/2009/07/12/automated-virtualbox-lvm-snapshot-vm-provisioning/</link>
		<comments>http://www.parkingdenied.com/2009/07/12/automated-virtualbox-lvm-snapshot-vm-provisioning/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 09:14:32 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[Snapshots]]></category>
		<category><![CDATA[Virtualbox]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/2009/07/12/automated-virtualbox-lvm-snapshot-vm-provisioning/</guid>
		<description><![CDATA[Just a quick follow-up to my previous post about using LVM to clone logical volumes to create new VM’s. I’ve written up a quick script to help automate the process which allows you to rapidly deploy a fleet of test VM’s without having to mess about. The script is attached below and requires PHP. Configure [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick follow-up to my previous post about using LVM to clone logical volumes to create new VM’s. I’ve written up a quick script to help automate the process which allows you to rapidly deploy a fleet of test VM’s without having to mess about.</p>
<p>The script is attached below and requires PHP. Configure the config options within the script and then to provision a new VM you simply sudo ./makevm.php &lt;vmname&gt; and it will take care of everything.</p>
<ul>
<li>Creates the snapshot of the original logical volume</li>
<li>Sets the permissions on the device so that the user can access it</li>
<li>Creates the raw VMDK file and registers it with VirtualBox</li>
<li>Creates the base VM with the name provided</li>
<li>And finally it configures the VM to use the correct disk and network setting etc</li>
</ul>
<p>That’s all there is to it <img src='http://www.parkingdenied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2009/07/12/automated-virtualbox-lvm-snapshot-vm-provisioning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>0.0.6 Release of CactiWMI</title>
		<link>http://www.parkingdenied.com/2009/05/21/006-release-of-cactiwmi/</link>
		<comments>http://www.parkingdenied.com/2009/05/21/006-release-of-cactiwmi/#comments</comments>
		<pubDate>Thu, 21 May 2009 11:35:25 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Cacti]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/2009/05/21/006-release-of-cactiwmi/</guid>
		<description><![CDATA[I posted this on the forums some time ago and realised I had not posted here. This is the latest version, the mini change log is below. Update templates to suit new input method Backwards compatibility for old argument input method Overhaul how arguments are passed to wmi.php Debug mode via console option Add support [...]]]></description>
			<content:encoded><![CDATA[<p>I posted this on the forums some time ago and realised I had not posted here. This is the latest version, the mini change log is below.</p>
<ul>
<li>Update templates to suit new input method</li>
<li>Backwards compatibility for old argument input method</li>
<li>Overhaul how arguments are passed to wmi.php</li>
<li>Debug mode via console option</li>
<li>Add support for alternate namespaces</li>
<li>Use isset() instead of is not null</li>
<li>Prevent passwords from showing up in process list</li>
<li>Fix data template MIN &amp; MAX</li>
<li>Enterprise Vault Templates</li>
</ul>
<p>I have added support for additional namespaces and overhauled how  input arguments are passed to support this. As you can see below the cmd line help details how input is now passed.</p>
<blockquote><p>Usage:<br />
-h &lt;hostname&gt;         Hostname of the server to query.<br />
-u &lt;credential path&gt;  Path to the credential file. See format below.<br />
-n &lt;namespace&gt;        What namespace to use. (optional, defaults to root\CIMV2)<br />
-w &lt;wmi class&gt;        WMI Class to be used.<br />
-c &lt;columns&gt;          What columns to select. (optional, defaults to *)<br />
-k &lt;filter key&gt;       What key to filter on. (optional, default is no filter)<br />
-v &lt;filter value&gt;     What value for the key. (required, only when using filter key)<br />
-d &lt;debug level&gt;      Debug level. (optional, default is none, levels are 1 &amp; 2)</p>
<p>All special characters and spaces must be escaped or enclosed in single quotes!</p>
<p>Example: wmi.php -h 10.0.0.1 -u /etc/wmi.pw -w Win32_ComputerSystem -c PrimaryOwnerName,NumberOfProcessors -n &#8216;root\CIMV2&#8242;</p>
<p>Password file format: Plain text file with the following 3 lines replaced with your details.</p>
<p>username=&lt;your username&gt;<br />
password=&lt;your password&gt;<br />
domain=&lt;your domain&gt; (can be WORKGROUP if not using a domain)</p></blockquote>
<p>In addition to this there is now no longer any need for additional PHP files. The passwords are stored in a separate file and called via passing the path. This prevents passwords showing up in your process list and allows you to secure it further by limiting access to the password file to the cacti user.</p>
<p>To ease the upgrade process backwards compatibility has been maintained however there is one gotcha. You will still need to update your templates to point to the new password file instead of the reference to the key pair in wmi-logins.php. Aside from this the old templates will all work.</p>
<p>So basically this version is a bit cleaner, adds a few key features, improves security and lays the foundation for further feature upgrades. As per usual the download is attached to this post and any fault tickets can be lodged on my Mantis bug tracker page (<a href="http://mantis.parkingdenied.com" target="_blank">Link</a>) and the subversion repository in the usual spot (<a href="http://svn.parkingdenied.com/CactiWMI" target="_blank">Link</a>).</p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2009/05/21/006-release-of-cactiwmi/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Cloning VM’s with VirtualBox, LVM and Snapshots!</title>
		<link>http://www.parkingdenied.com/2009/05/15/cloning-vm%e2%80%99s-with-virtualbox-lvm/</link>
		<comments>http://www.parkingdenied.com/2009/05/15/cloning-vm%e2%80%99s-with-virtualbox-lvm/#comments</comments>
		<pubDate>Fri, 15 May 2009 15:10:30 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[Snapshots]]></category>
		<category><![CDATA[Virtualbox]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=205</guid>
		<description><![CDATA[Recently I wanted to setup a development environment to test some Active Directory setups. Basically I wanted a whole stack of domain controllers and client machines across multiple sites, domains and forests to see how they tick and replicate between each other. Easy enough to do, just create a bunch of virtual machines using your [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I wanted to setup a development environment to test some Active Directory setups. Basically I wanted a whole stack of domain controllers and client machines across multiple sites, domains and forests to see how they tick and replicate between each other. Easy enough to do, just create a bunch of virtual machines using your favourite virtualization package, I prefer VirtualBox but you could do the same with VirtualPC or VMWare. But say you want to quickly deploy this and be able to easily tear down machines and bring new ones up, again easy enough just clone the disks and create new VM’s. All pretty straight forward. However there is a much neater and more elegant way of doing this which allows you to quickly snapshot a VM and redeploy in a matter of a seconds rather than minutes to hours copying full disk images around.</p>
<p>So how does one accomplish this task, well it’s really quite simple, LVM snapshots. If you have never heard or used LVM before it is a logical volume manager. It’s job is to take a bunch of physical volumes such as hard disks or raid arrays and combine them into a storage group. From this storage group you can then create multiple logical volumes (similar to luns in the Netapp world) which act like standard disk devices allowing you to easily carve up your storage in a more logical way. Now LVM is really quite a powerful tool and has many extra features which are outside of the scope of this article but see my links at the end to find out more on the specifics.</p>
<p>Anyway the feature we are going to use as I already mentioned is snapshots, what these are is an instantaneous snapshot of a volume which we can then mount separate to the real volume and use as a normal disk. The beauty of this is that your original volume remains completely untouched and any changes that are written to the snapshot are stored as just that changes or differences between that and the original volume. This means for our VM’s that only a few hundred meg or so will change that our disk usage is significantly reduced. You can see now just how useful this can be. The other big advantage is that they are fast, you can create a snapshot in a matter of seconds whereas to copy a vmdk or vdi file it takes a lot longer for it to copy, especially if using a dynamic disk as it locates all the used blocks.</p>
<p>Now lets get down to using it in the real world.</p>
<p>First things first get your VM installed using a raw device mapping.</p>
<blockquote><p>lvcreate -L20G -nvbox_win2003std_base storage /dev/md2<br />
Logical volume &#8220;vbox_win2003_base&#8221; created</p></blockquote>
<p>In this instance I have created a 20gb volume called “vbox_win2003_base” on my storage volume group and forced it to allocate all its extents on /dev/md2. I prefer to do this just to make sure no logical volumes cross over physical volumes unless absolutely needed.</p>
<p>Now you have your volume ready you will need to create a disk for VirtualBox to use.</p>
<blockquote><p>VBoxManage internalcommands createrawvmdk -filename &#8220;win2003_base.vmdk&#8221; -rawdisk /dev/storage/vbox_win2003std_base -register<br />
VirtualBox Command Line Management Interface Version 2.2.2<br />
(C) 2005-2009 Sun Microsystems, Inc.<br />
All rights reserved.</p>
<p>RAW host disk access VMDK file win2003_base.vmdk created successfully.</p></blockquote>
<p>This creates a vmdk file with a raw mapping to the logical volume and automatically registers it for use within VirtualBox.</p>
<p>Now prepare your VM like you would any other Windows machine being cloned. Preinstall all your OS, applications, software, any patches or tweaks and get it configured just the way you like. However try to keep things reasonably simple, this means don’t promote the machine to a DC or any other service which when cloned will break. For my builds I have been testing with Windows 2003 Standard edition. So this means you need to extract the deploy.cab from your Windows 2003 CD to c:\sysprep and run the setupmgr.exe app to generate a sysprep.inf. If you want to avoid problems don’t set a password for the admin account in the sysprep if you have already set one for the machine as it appears to fail when updating it. So you have generated your sysprep.inf, do a quick check to ensure everything is in it’s place and run sysprep.exe –reseal –mini –pnp. The machine will do its bit and then shut down meaning it is ready to be cloned.</p>
<p>Now the fun part, time to make a snapshot of your logical volume.</p>
<blockquote><p>lvcreate -L5G -s -nvbox_vodka_dc /dev/storage/vbox_win2003std_base<br />
Logical volume &#8220;vbox_vodka_dc&#8221; created</p></blockquote>
<p>Now in the blink of an eye it has created a snapshot of your base VM’s logical volume with a maximum growth of 5gb. This means the VM can have a maximum of 5gb of changes before it runs out of space. You will need to fine tune this depending on your VM’s and workload. To keep an eye on it simply use lvdisplay as per normal.</p>
<blockquote><p>lvdisplay storage/vbox_vodka_dc<br />
&#8212; Logical volume &#8212;<br />
LV Name                /dev/storage/vbox_vodka_dc<br />
VG Name                storage<br />
LV UUID                IOFUF4-Bxze-Xpij-Qd5b-nH7k-FeEx-k6936B<br />
LV Write Access        read/write<br />
LV snapshot status     active destination for /dev/storage/vbox_win2003std_base<br />
LV Status              available<br />
# open                 0<br />
LV Size                20.00 GB<br />
Current LE             5120<br />
COW-table size         5.00 GB<br />
COW-table LE           1280<br />
Allocated to snapshot  0.00%<br />
Snapshot chunk size    4.00 KB<br />
Segments               1<br />
Allocation             inherit<br />
Read ahead sectors     auto<br />
- currently set to     256<br />
Block device           253:4</p></blockquote>
<p>Now that we have the snapshot volume all we need to do is create another raw device vmdk.</p>
<blockquote><p>VBoxManage internalcommands createrawvmdk -filename &#8220;Vodka_DC.vmdk&#8221; -rawdisk /dev/storage/vbox_vodka_dc<br />
VirtualBox Command Line Management Interface Version 2.2.2<br />
(C) 2005-2009 Sun Microsystems, Inc.<br />
All rights reserved.</p>
<p>RAW host disk access VMDK file Vodka_DC.vmdk created successfully.</p></blockquote>
<p>And that’s it, you now have a complete clone of that machine ready to load into a new VM within VirtualBox and boot. It will run through the mini-setup as per normal for any cloned machine and that’s it. All done!</p>
<p>With a few batch commands you can quickly automate the creating of a whole fleet of VM’s ready to plug into your dev environment.</p>
<p>Hope this helps a few people out there <img src='http://www.parkingdenied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Links:</p>
<ul>
<li><a href="http://tldp.org/HOWTO/LVM-HOWTO/index.html" target="_blank">LVM</a> (<a href="http://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29" target="_blank">wiki</a>)<a href="http://tldp.org/HOWTO/LVM-HOWTO/index.html" target="_blank"><br />
</a></li>
<li><a href="http://www.virtualbox.org" target="_blank">VirtualBox</a> (<a href="http://en.wikipedia.org/wiki/VirtualBox" target="_blank">wiki</a>)<a href="http://www.virtualbox.org" target="_blank"><br />
</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2009/05/15/cloning-vm%e2%80%99s-with-virtualbox-lvm/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>0.0.5 Release of CactiWMI</title>
		<link>http://www.parkingdenied.com/2009/02/23/005-release-of-cactiwmi/</link>
		<comments>http://www.parkingdenied.com/2009/02/23/005-release-of-cactiwmi/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 09:33:41 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Cacti]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=133</guid>
		<description><![CDATA[It&#8217;s been a while since I released an update and there have been a number of templates since 0.0.4 so packaged them up ready for consumption Below are some examples of what we now have! So we have some standard Windows stats such as system calls, context switches and process/processor stats. We can now also [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I released an update and there have been a number of templates since 0.0.4 so packaged them up ready for consumption <img src='http://www.parkingdenied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Below are some examples of what we now have!</p>
<p>So we have some standard Windows stats such as system calls, context switches and process/processor stats.</p>
<p><img class="alignnone size-full wp-image-139" title="windows-processes" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/windows-processes.png" alt="windows-processes" width="603" height="227" /></p>
<p><img class="alignnone size-full wp-image-138" title="windows-contextswitches" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/windows-contextswitches.png" alt="windows-contextswitches" width="603" height="227" /></p>
<p><img class="alignnone size-full wp-image-137" title="windows-processorqueuelength" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/windows-processorqueuelength.png" alt="windows-processorqueuelength" width="603" height="227" /></p>
<p><img class="alignnone size-full wp-image-136" title="windows-systemcalls" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/windows-systemcalls.png" alt="windows-systemcalls" width="603" height="227" /></p>
<p>We can now also monitor processes themselves on an individual basis.</p>
<p><img class="alignnone size-full wp-image-141" title="processstats-memory" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/processstats-memory.png" alt="processstats-memory" width="587" height="241" /></p>
<p><img class="alignnone size-full wp-image-142" title="processstats-general" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/processstats-general.png" alt="processstats-general" width="587" height="241" /></p>
<p>And some new Exchange graphs including the much requested SMTP graphs.</p>
<p><img class="alignnone size-full wp-image-144" title="smtp-performance" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/smtp-performance.png" alt="smtp-performance" width="603" height="255" /></p>
<p><img class="alignnone size-full wp-image-145" title="smtp-queue" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/smtp-queue.png" alt="smtp-queue" width="603" height="241" /></p>
<p><img class="alignnone size-full wp-image-143" title="exchange-clientrpclatency" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/exchange-clientrpclatency.png" alt="exchange-clientrpclatency" width="953" height="243" /></p>
<p>And here is the download. Any questions or suggestions let me know and feel free to stop by the thread on the Cacti forums (<a href="http://forums.cacti.net/viewtopic.php?t=30438" target="_blank">Link!</a>).</p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2009/02/23/005-release-of-cactiwmi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

