<?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>Sean Kelly</title>
<atom:link href="http://www.smkelly.org/feed/" rel="self" type="application/rss+xml" />
<link>http://www.smkelly.org</link>
<description>My personal webpage.</description>
<lastBuildDate>Thu, 05 Jan 2012 05:11:56 +0000</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<item>
<title>Migrating VMs to a new vSphere cluster</title>
<link>http://www.smkelly.org/2011/09/18/migrating-vms-to-a-new-vsphere-cluster/</link>
<comments>http://www.smkelly.org/2011/09/18/migrating-vms-to-a-new-vsphere-cluster/#comments</comments>
<pubDate>Sun, 18 Sep 2011 20:17:51 +0000</pubDate>
<dc:creator>Sean</dc:creator>
<category>
<![CDATA[Technology]]>
</category>
<category>
<![CDATA[Virtualization]]>
</category>
<category>
<![CDATA[powershell]]>
</category>
<category>
<![CDATA[script]]>
</category>
<category>
<![CDATA[VMware]]>
</category>
<category>
<![CDATA[vsphere]]>
</category>
<guid isPermaLink="false">http://www.smkelly.org/?p=76</guid>
<description>
<![CDATA[Where I work, we use VMware to virtualize the majority of our servers. Last year, we bought four new servers in order to provide more resources to our virtual evironment, and also to aid in the upgrade to vSphere 4 from VI3. The plan was to power off all virtual machines and perform an offline <a href='http://www.smkelly.org/2011/09/18/migrating-vms-to-a-new-vsphere-cluster/'>[...]</a>]]>
</description>
<content:encoded>
<![CDATA[<p><a title="Creighton University" href="http://www.creighton.edu" target="_blank">Where I work</a>, we use <a title="VMware" href="http://www.vmware.com" target="_blank">VMware</a> to virtualize the majority of our servers. Last year, we bought four new servers in order to provide more resources to our virtual evironment, and also to aid in the upgrade to vSphere 4 from VI3. The plan was to power off all virtual machines and perform an offline migration of all the VMs from the old cluster to the new cluster. However, we were also migrating from the vSwitch to the distributed virtual switch (dvSwitch).</p>
<p><strong>The Setup:<br />
</strong>To start out, I upgraded VMware vCenter Server to version 4.x. After that was done, I created a new cluster and added all four new hosts to it. I then mapped all of the same LUNs to the new cluster that were already mapped to the old cluster. This allowed me to do a migration from the old cluster to the new without having to worry about storage migrations. Next, I created the new dvSwitch with all the same port groups as the old vSwitch. It was important to make sure all VLAN IDs were present. Finally, I powered off all virtual machines.</p>
<p><strong>The Code<br />
</strong>Now for the interesting part. I wrote a PowerShell script to automate the migration of the VMs from the old cluster to the new. At the same time, it looks at the vSwitches and maps them to their equivalent dvSwitch port group by looking for matching VLALN IDs. For example, if there is a vSwitch port group called &#8220;Monkey&#8221; with VLAN ID of 123, it will check the dvSwitch port groups and map that to whichever one also has VLAN ID 123.</p>
<pre class="brush: powershell; title: ; notranslate">
# Generate a hash of dvSwitch port group VLAN IDs and names, using ID as key.
function CreateDVMap() {
        $vlanmap = @{}
        $pgs = Get-VIew -ViewType DistributedVirtualPortgroup
        foreach ($pg in $pgs) {
                $vlan = $pg.Config.DefaultPortConfig.vlan.vlanid

                if ($vlan -and !$vlanmap.ContainsKey($vlan)) {
                        $vlanmap.Add($vlan, $pg.name)
                }
        }
        return $vlanmap
}
function MigrateVM($vm, $target, $dvMap) {
        # Is the virtual machine in the &amp;amp;quot;Test Dev&amp;amp;quot; resource pool?
        $resPool = Get-ResourcePool -VM $vm
        if ($resPool -and $resPool.Name.CompareTo(&amp;amp;quot;Test Dev&amp;amp;quot;) -eq 0) {
                $TestDev = $true
        } else {
                $TestDev = $false
        }

        $newnetnames = @()
        Write-Host &amp;amp;quot;Migrating VM&amp;amp;quot;, $vm.Name

        # Translate the vSwitch PG of each NIC to the equivalent dvSwitch PG
        foreach ($nic in $vm.NetworkAdapters) {
                Write-Host $nic.name -ForegroundColor Blue
                Write-Host $nic.NetworkName -ForegroundColor Green
                $vlanid = (Get-VirtualPortGroup -Name $nic.NetworkName -VMHost $vm.Host).VlanId
                Write-Host &amp;amp;quot;VLAN ID is&amp;amp;quot; $vlanid
                $newnetnames += $dvMap.get_item($vlanid)
        }

        $newvm = Move-VM -VM $vm -Destination $target

        if ($TestDev) {
                # If it is a Test/Dev VM, move it to the new resource pool
                $rp = Get-ResourcePool -Location $newvm.host.parent -Name &amp;amp;quot;Test Dev&amp;amp;quot;
                $newvm = Move-VM -vm $newvm -Destination $rp
        }

        # Now, set all the NICs to their new dvSwitch port group
        $i = 0
        foreach ($nic in $newvm.NetworkAdapters) {
                Set-NetworkAdapter -NetworkAdapter $nic -NetworkName $newnetnames[$i++] -Confirm:$false
        }
}
# Connect to the vCenter Server
$vihost = Connect-VIServer &amp;amp;quot;vCenter-Server-Hostname&amp;amp;quot;

# Target host in the new cluster to deposit all VMs on
$targetHost = Get-VMHost &amp;amp;quot;Some-Hostname-Here&amp;amp;quot;

# Generate a hash of all dvSwitch PGs
$vlanmap = CreateDVMap

# Get a list of all VMs in &amp;amp;quot;Production cluster
$vmlist = Get-VM -Location (Get-Cluster &amp;amp;quot;Production&amp;amp;quot;) | Where { $_.PowerState -eq &amp;amp;quot;PoweredOff&amp;amp;quot; } | Select &amp;amp;quot;Name&amp;amp;quot;

# Iterate through the VMs and migrate them
foreach ($vmname in $vmlist) {
        $vm = Get-VM $vmname.name
        MigrateVM $vm $targetHost $vlanmap
}
Disconnect-VIServer $vihost -Confirm:$false
</pre>
]]>
</content:encoded>
<wfw:commentRss>http://www.smkelly.org/2011/09/18/migrating-vms-to-a-new-vsphere-cluster/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>A New ${HOME}</title>
<link>http://www.smkelly.org/2011/07/29/a-new-home/</link>
<comments>http://www.smkelly.org/2011/07/29/a-new-home/#comments</comments>
<pubDate>Sat, 30 Jul 2011 03:19:35 +0000</pubDate>
<dc:creator>Sean</dc:creator>
<category>
<![CDATA[Uncategorized]]>
</category>
<guid isPermaLink="false">http://www.smkelly.org/?p=65</guid>
<description>
<![CDATA[Up until last week, this website was run on a generic shared hosting account. For the most part, this worked well. At times, it could be slow. I went through all kinds of trouble to tune WordPress as much as I could to make it respond faster. Unfortunately, a lot of the slowness was in <a href='http://www.smkelly.org/2011/07/29/a-new-home/'>[...]</a>]]>
</description>
<content:encoded>
<![CDATA[<p>Up until last week, this website was run on a generic shared hosting account. For the most part, this worked well. At times, it could be slow. I went through all kinds of trouble to tune WordPress as much as I could to make it respond faster. Unfortunately, a lot of the slowness was in the shared MySQL server that they provided. I had them move me between servers a few times, but it never fully resolved the issues.</p>
<p>Despite the slowness problems, there were other things I was missing by using a shared hosting provider. For one, I was very limited in the amount of tweaking  I could do. This is partly because of the ban on background processes, but also because I didn&#8217;t have administrative access. This meant I couldn&#8217;t try different web servers, PHP modules, change MySQL cache configurations, and all that good stuff. You know, all that stuff that normal people don&#8217;t care about as long as stuff works.</p>
<p>Well, I&#8217;ve now made the jump to a virtual server hosted by <a title="Linode" href="http://www.linode.com/?r=de5e9915427e40f9bae981e58ba9b5ca2c3cee69" target="_blank">Linode</a>! Linode provides a virtual server <em>in the cloud</em> running Linux. They leverage the Xen hypervisor to do this, and you can run pretty much any Linux distribution you want.</p>
<p>So far, my Linode server has these specs:</p>
<ul>
<li>512MB RAM</li>
<li>20GB storage</li>
<li>200GB transfer/month</li>
<li><a href="http://www.debian.org/" target="_blank">Debian</a> GNU/Linux 6 (64-bit)</li>
</ul>
<div>So far, I&#8217;ve transferred both my and my wife&#8217;s websites to the new server. Even better, I&#8217;m experimenting with a different web server other than the standard Apache. This site is currently being served by <a href="http://www.lighttpd.net/" target="_blank">Lighttpd</a> leveraging <a href="http://www.php.net/" target="_blank">PHP</a> via FastCGI.</div>
<div>If you are interested in trying out Linode for yourself, I&#8217;d appreciate it if you used my referral code: <a href="http://www.linode.com/?r=de5e9915427e40f9bae981e58ba9b5ca2c3cee69" target="_blank">de5e9915427e40f9bae981e58ba9b5ca2c3cee69</a></div>
]]>
</content:encoded>
<wfw:commentRss>http://www.smkelly.org/2011/07/29/a-new-home/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Vending Failure</title>
<link>http://www.smkelly.org/2011/05/19/vending-failure/</link>
<comments>http://www.smkelly.org/2011/05/19/vending-failure/#comments</comments>
<pubDate>Fri, 20 May 2011 01:26:12 +0000</pubDate>
<dc:creator>Sean</dc:creator>
<category>
<![CDATA[Uncategorized]]>
</category>
<guid isPermaLink="false">http://www.smkelly.org/?p=50</guid>
<description>
<![CDATA[This evening, I was staying late at work. I decided to go grab a bag of chips from the vending machine. I punched in the code to see what the price was for my chips, since I couldn&#8217;t see it behind the glass. Instead of showing the price on the LCD, I heard a plunk <a href='http://www.smkelly.org/2011/05/19/vending-failure/'>[...]</a>]]>
</description>
<content:encoded>
<![CDATA[<p>This evening, I was staying late at work. I decided to go grab a bag of chips from the vending machine. I punched in the code to see what the price was for my chips, since I couldn&#8217;t see it behind the glass. Instead of showing the price on the LCD, I heard a plunk noise. My chips were free?!</p>
<p>Thinking that the last guy just probably put in a $1 and walked away, I typed a random code. Plunk! I got some Ruffles. Now I figured maybe the last guy put in a $5, so I tried a few more codes. Keep in mind that I have extremely poor eyesight, and I couldn&#8217;t see anywhere where it showed how much money was on tab already. Finally, I came to the conclusion that it was totally broken.</p>
<p>Until I could figure out who to notify, I made a sign:<br />
<a title="1000000085.JPG by smkelly, on Flickr" href="http://www.flickr.com/photos/smkelly/5738645088/"><img class="aligncenter" src="http://farm6.static.flickr.com/5067/5738645088_f7e5f39c2f.jpg" alt="" width="374" height="500" /></a></p>
]]>
</content:encoded>
<wfw:commentRss>http://www.smkelly.org/2011/05/19/vending-failure/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>One Year Anniversary</title>
<link>http://www.smkelly.org/2011/05/16/one-year-anniversary/</link>
<comments>http://www.smkelly.org/2011/05/16/one-year-anniversary/#comments</comments>
<pubDate>Mon, 16 May 2011 15:30:03 +0000</pubDate>
<dc:creator>Sean</dc:creator>
<category>
<![CDATA[Life]]>
</category>
<category>
<![CDATA[amanda]]>
</category>
<category>
<![CDATA[anniversary]]>
</category>
<category>
<![CDATA[wedding]]>
</category>
<guid isPermaLink="false">http://www.smkelly.org/?p=38</guid>
<description>
<![CDATA[One year ago today, I married my wonderful wife Amanda. To celebrate, we are going to The Grey Plume for dinner. As if celebrating our anniversary isn&#8217;t enough, we also just finished celebrating her graduation from pharmacy school. My wife is now Dr. Amanda L. Kelly, PharmD.Congratulations!We are all very proud.]]>
</description>
<content:encoded>
<![CDATA[<p>One year ago today, I married my wonderful wife <a title="Amanda's website" href="http://www.amanda-kelly.org/" target="_blank">Amanda</a>. To celebrate, we are going to <a title="The Grey Plume" href="http://www.thegreyplume.com/" target="_blank">The Grey Plume</a> for dinner. As if celebrating our anniversary isn&#8217;t enough, we also just finished celebrating her graduation from pharmacy school. My wife is now Dr. Amanda L. Kelly, PharmD.Congratulations!We are all very proud.<br />
<a title="P1020806.JPG by smkelly, on Flickr" href="http://www.flickr.com/photos/smkelly/4613130011/"><img class="aligncenter" src="http://farm4.static.flickr.com/3305/4613130011_330bae9c4f_m.jpg" width="180" height="240" /></a></p>
]]>
</content:encoded>
<wfw:commentRss>http://www.smkelly.org/2011/05/16/one-year-anniversary/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>The Webs I&#8217;ve Spun</title>
<link>http://www.smkelly.org/2011/05/01/the-webs-ive-spun/</link>
<comments>http://www.smkelly.org/2011/05/01/the-webs-ive-spun/#comments</comments>
<pubDate>Sun, 01 May 2011 23:00:51 +0000</pubDate>
<dc:creator>Sean</dc:creator>
<category>
<![CDATA[Life]]>
</category>
<category>
<![CDATA[concrete5]]>
</category>
<category>
<![CDATA[drupal]]>
</category>
<category>
<![CDATA[joomla]]>
</category>
<category>
<![CDATA[website]]>
</category>
<category>
<![CDATA[wordpress]]>
</category>
<guid isPermaLink="false">http://www.smkelly.org/?p=30</guid>
<description>
<![CDATA[For a long time now, I&#8217;ve been looking for a new content management system for my website. Over the years, I&#8217;ve tried all sorts of solutions and never found one that I found to be a satisfying solution. Finally, I think I may have found something I don&#8217;t absolutely hate. In the beginning, there was <a href='http://www.smkelly.org/2011/05/01/the-webs-ive-spun/'>[...]</a>]]>
</description>
<content:encoded>
<![CDATA[<p style="text-align: justify;">For a long time now, I&#8217;ve been looking for a new content management system for my website. Over the years, I&#8217;ve tried all sorts of solutions and never found one that I found to be a satisfying solution. Finally, I think I may have found something I don&#8217;t absolutely hate.</p>
<p style="text-align: justify;">In the beginning, there was <a title="GeoCities on Wikipedia" href="http://en.wikipedia.org/wiki/GeoCities" target="_blank">Geocities</a>. Back in those days, GeoCities websites were broken down into &#8220;cities&#8221; and addresses. For example, a URL may have looked something like http://www.geocities.com/broadway/1138. My first website was somewhere under /broadway/. I believe I used a GeoCities tool to generate the HTML. Later, for some reason I don&#8217;t remember, I relocated to /SiliconValley/. By that point, I had started tinkering with HTML and created my website with some <a title="Shareware on Wikipedia" href="http://en.wikipedia.org/wiki/Shareware" target="_blank">shareware</a> website authoring tool for Windows 3.1, though mainly writing my own HTML. This was back before CSS, kids.</p>
<p style="text-align: justify;">Time passed. I learned Linux. I bought a domain or eight. By this point, I had learned PHP. I created a new website and self-hosted it on my Linux desktop at home.  It used a mixture of HTML and PHP, though it was all within the same file. Eventually, I moved to FreeBSD and the website moved as well. Over time, I added some CSS into the page. I also migrated towards XHTML, I think. This page hung around for quite a while, and was only replace in the last year or two.</p>
<p style="text-align: justify;">Next up, <a title="Drupal" href="http://www.drupal.org" target="_blank">Drupal</a>. I got a web hosting provider to host my website. I deployed on Drupal 6 and tweaked it over time. Drupal is very complicated, so it kept me busy customizing things to my liking. When Drupal 7 was in beta, I migrated over to it and pretty much had to start all over again. While Drupal is highly customizable, it ended up burning me out. It was just too big and unwieldy. So, I experimented with <a title="Joomla" href="http://www.joomla.org/" target="_blank">Joomla</a>, <a title="concrete5" href="http://www.concrete5.org/" target="_blank">concrete5</a>, <a title="WordPress" href="http://www.wordpress.org" target="_blank">WordPress</a>, and a pile of other CMSes.</p>
<p style="text-align: justify;">And finally, to the point! After all that experimentation, I have decided to stick with WordPress for now. So, I&#8217;ve redone my website for yet another time. This time, WordPress. I am liking it so far, but we&#8217;ll see how it goes. If you have any WordPress tips, please send them my way.</p>
]]>
</content:encoded>
<wfw:commentRss>http://www.smkelly.org/2011/05/01/the-webs-ive-spun/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
</channel>
</rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 11/17 queries in 0.004 seconds using apc
Object Caching 635/640 objects using apc

Served from: www.smkelly.org @ 2012-02-23 05:21:02 -->
