Wednesday, July 29, 2009 2:21 PM Central Time
Posted by Justin
I was provisioning some Compellent storage today for a a series of tests that I am working on that required 62 volumes per server on two different servers. These volumes are multi-pathed and although using the Compellent Storage Center GUI is easy and straightforward, completing this process would take a long time doing by hand and seemed fit to be automated using the Compellent Storage Center Command Set for Windows PowerShell.
I wrote a script a while back that handles my provisioning for me; in this case a couple of mount point root volumes followed by data volumes that would be accessed by mount point instead of drive letter. The script is flexible enough to handle different volume counts and whether or not drive letters would be used, but the catch was I had only used it with Windows Server 2003.
I tried to run the script this morning and found a flaw pretty quickly. The volume was created on the Storage Center, mapped properly across the available paths, but when the script tried to initialize the volume in Windows, it would come back as “failed to initialize” with VDS error code 80070013. This VDS error code indicates that the “media is write-protected”. How could that be on a new volume?
Windows 2008 changed the way disk management is handled especially around delivery of the disk to the server. By default, a disk mapped to a Windows 2008 server via VDS will be delivered in offline mode and also read-only. In Windows Server 2008 there is a policy new to Windows related to SAN disks. This "SAN policy" determines whether a newly discovered disk is brought online or remains offline, and whether it is made read/write or remains read-only. By default, the “Offline All” policy is set. This means All newly discovered disks remain offline and read-only. You can change this default policy in DISKPART by running the SAN POLICY=<POLICY NAME> from a DISKPART command prompt.

changing the default SAN policy in DISKPART
You can read more here, but in the meantime, the fix for this from a scripting perspective is quite simple. The inability to initialize the disk because it was read-only was due to the SAN policy which presented the volume in a read-only fashion (and offline too). We can change the disk attribute of the volume so it is not read-only and then we can bring the disk online so it is usable. Here is a sample of how to use the Command Set to change the read-only attribute and the state of the drive:
Write-Output "Bringing Disk Online..."
Set-DiskDevice -SerialNumber $scvolume.SerialNumber -Online
Set-DiskDevice -SerialNumber $scvolume.SerialNumber -ReadOnly:$false
$scvolume is a variable that refers to the volume object that is created when we create a new volume using New-SCVolume. The serial number is used to identify the disk mapped to the Windows Server. It is also important to note that although the “Online” and “ReadOnly” switches come from the same cmdlet, these must be executed separately as they are in the sample. (Thanks for that important tidbit, Sean!)
Tuesday, July 21, 2009 9:07 AM Central Time
Posted by Justin
Here is an easy way to determine the partition alignment of any given disk on the local system or remotely.
$OffsetKB = @{label=”Offset(KB)”;Expression={$_.StartingOffset/1024 -as [int]}}
$SizeMB = @{label=”Size(MB)”;Expression={$_.Size/1MB -as [int]}}
Get-WmiObject -ComputerName "localhost" -Class "Win32_DiskPartition" | ft`
SystemName, Name, DiskIndex, $SizeMB, $OffsetKB -AutoSize
This will output table that looks like this:
Why should you care about this? This is particularly useful for determining partition alignment of existing disks that may be running applications like Exchange or SQL. Exchange recommends a 64K partition alignment as does SQL in most cases. In Windows Server 2008, partition alignment is automatic and defaults to 1024KB for new partitions. Note that the alignment of partitions on servers that were upgraded from Windows 2003 to 2008 are not changed.
Friday, July 17, 2009 10:41 AM Central Time
Posted by Justin
I contributed a couple of postings to the Compellent “Around The Block” blog this last week. These postings cover the new features in PowerShell v2 and how they can be leveraged with the Compellent Storage Center Command Set.
Here are links to the postings:
Part 1
Part 2
You can download CTP3 of PowerShell v2 here.
Sunday, July 12, 2009 6:53 PM Central Time
Posted by Justin
First and foremost, I am a Windows user. I have been forever. I was a "blue badge" so I was very much a "fanboy" of Microsoft from the platform to desktop apps to mobile devices and still pretty much am. I have also opened my eyes to other computing technologies like the Mac and iPhone.
I used to try to make my Microsoft software work the way I wanted in every case. There really wasn't any other solution. I have moved away from that thought process, and accepted that some other technologies do the job better.
Take Windows Mobile for example. I owned no less than 10 devices in a matter of less than five years because I thought that the issue had to be the device, not the platform. Last year, I finally purchased an iPhone. I absolutely love this device and it will take me a long time to go back to Windows Mobile. Perhaps if Microsoft controlled the hardware platform for Windows Mobile devices, they might share the same success that Apple has had.
I also have a MacBook Pro, which runs virtualization software so I can run Windows. Since most enterprise companies still use Windows as a primary platform, I too still use Windows for 95% of my work-related business. I have had few issues with the Windows platform for the most part; I was even a fan of Vista. I didn't see all of the same issues that caused droves of people to jump on the anti-Vista bandwagon. I still prefer Vista to Windows XP, a sentiment that isn't shared by many. But at the end of the day, I run it on my MacBook. I do most of my blogging from a Mac now, I get all of my newsfeeds on the Mac, and Twitter too! Bottom line, a lot of Mac apps offer better stability and robustness compared to their Windows counterparts. Whether this is related to the platform or just bad coding, that's a topic for a different day. Microsoft wins at a lot of battles - I favor Visual Studio and Office 2007. Those have been solid, just as a lot of the server apps like Exchange, SQL, and SharePoint.
Since I have had my Mac I have looked for ways to synchronize files and folders. Between my Macs would be fine, but across platforms would be even better. Apple's MobileMe is a nice solution, although I don't believe $99/year is worth what it gives me. Yesterday I was searching around for file sync tools on the Mac again and came across Microsoft Live Sync. I've used Live Sync for file storage on the PC side, but I was surprised to find that a Mac client was available. I installed it on both of my Macs, as well as my Vista laptop and work laptop too. I started syncing folders and they appeared across the platforms. Amazing! (and free too).
Looking further, I started digging into Microsoft Live Mesh which bridges the gap for connected devices allowing them to sync files and access their desktops all over the Internet. This provides the ability to access applications on one system that might not be available on another. Better yet, Mesh incorporates mobile devices and Macs. File synchronization is great across platform, but I wish I had the ability to remote control my Mac from one of my Live Mesh PCs. Since the remote control uses an ActiveX control in the browser, this is not possible on the Mac, but bringing a Java applet into the mix might take away this barrier.
I would say that in the last 2-3 months, Microsoft has introduced some very interesting technologies like Bing and Live Mesh (beta). Bing is closing in on it's Google competition, and I have even started using it as my primary search engine. We'll see how the landscape changes when Google finishes their open source OS.
So, with all this being said, it's really not about being an Apple Fanboy or a Microsoft Fanboy, but more-so about who delivers the best solution for the problems at hand.