Move all your Windows 8 Hyper-V VM’s to SSD with PowerShell

I built a lab on my Windows 8 laptop consisting of System Center 2012 Configuration Manager, Operations Manager, Configuration Manager, a DC, SQL, and SharePoint. Although it runs so-so on my 7200RPM hard drive I decided to join the club and finally get an SSD for a secondary drive. After months of research I ended up with the Intel 330 240GB SSD and purchased it on Amazon for about 180$. This blog post addresses two items. First I had problems with my OS locking up when attempting to format my new SSD. And second moving Hyper-V VM’s to a new drive.

Trouble formatting new *Intel* SSD

I had some difficulty formatting the drive in Computer Management. Every time I attempt to format it, it would lock up my OS. So here are the steps I took to resolve it:

!!!! WARNING: this will destroy all data on the target disk !!!!

  1. Download and install Intel SSD Toolbox
  2. Open an elevated cmd prompt.
  3. Type diskpart.exe and hit enter
  4. list disk
  5. select disk # (the disk you want to clean)
  6. clean all (more info on this command and diskpart http://technet.microsoft.com/en-us/library/cc766465%28v=ws.10%29.aspx )
  7. It will take 10-20 minutes or so but after these steps I was able to format the drive.

Also note that 64K unit allocation size is recommended for drives where VHDX’s will be stored (since they will be large files). This unit size is not recommended for smaller files. You can use the wizard in computer management or run format FS=NTFS LABEL=”L.A.B.” UNIT=64k QUICK in disk part.

Moving your Hyper-V VM’s via PowerShell

After installing my shiny new SSD I sure as heck wasn’t going to move all my VM’s manually, so PowerShell it is!

Here is a good start to become familiar with the Hyper-V PowerShell cmdlets. Just be sure to run the PowerShell ISE is elevated mode! http://social.technet.microsoft.com/wiki/contents/articles/8700.windows-server-8-manage-hyper-v-3-0-with-powershell-en-us.aspx

After you familiarize yourself with some of the cmdlet’s there is some really slick ones for moving VM’s around:

  • Move-VM (Moves the VM to another host)
  • Move-VMStorage (Moves all of the VM’s dependencies to another location)

I’m moving my VM’s to my new SSD on my laptop so Move-VMStorage was the best route!

  1. Start with Get-VM to get a list of VM’s
    Get-VM
  2. Now you will want to copy that to a variable. Let’s say $VMs via
    1
    
    $VMs = Get-VM
  3. Now for each of these $VMs we will want to execute Move-VMStorage to (in my case) D:\.
    1
    2
    3
    4
    5
    6
    7
    
    $DestinationPath = "D:\SCSM Lab"
    ForEach ($VM in $VMs) {
    	$VMName = $VM.Name.toString()
    	Write-Output "Moving $VMName"
    	Move-VMStorage -VMName $VM.Name -DestinationStoragePath "$DestinationPath\$VMName"
    	Write-Output "Finished Moving $VMName"
    }

    A progress bar will appear indicating the move is occurring:
    Move-VMStorage

  4. That’s pretty much it :). You will also be able to migrate them while they are still running, although it could take longer.

Full script:

1
2
3
4
5
6
7
8
$VMs = Get-VM
$DestinationPath = "D:\SCSM Lab"
ForEach ($VM in $VMs) {
	$VMName = $VM.Name.toString()
	Write-Output "Moving $VMName"
	Move-VMStorage -VMName $VM.Name -DestinationStoragePath "$DestinationPath\$VMName"
	Write-Output "Finished Moving $VMName"
}
Microsoft, PowerShell, Windows 8 , , , Leave a comment

Beta Private Cloud exams from MMS not showing on MCP transcript

A few month ago I came across Kevin Holman’s blog post on checking the status of the Private Cloud beta exams I took at MMS (71-246 Monitoring and Operating a Private Cloud with System Center 2012 & 71-247 Configuring and Deploying a Private Cloud with System Center 2012) and to my excitement I passed both (I was NOT dancing around my house in celebration :D). All I needed then was an MCSA: Windows Server 2008 and I’d have my MCSE: Private Cloud certification! So I’ve been hitting the books the past few months and taking practice exams in order to prep for my MCSA: Windows Server 2008 exams. (70-640, 70-642, and finally today passing 70-646!) All the hard work, late nights, spousal complaints (love ya dear), and early mornings on my aggressive schedule paid off.

But wait, my two Private Cloud beta exams are still not showing up on the damn MCP site! It’s been over four months! I need support! I don’t really like to call into support (even though sometimes it’s usually faster) and ended up using the MCP site’s chat feature in the support section, see our exchanges below…

Sponsors, article continues below...

Continue reading »

Certification, Microsoft, Private Cloud, SCCM, SCOM , , , , , Leave a comment

Report on SCOM Alert Notification Subscriptions

Trouble tracking down alert notifications? A good word of advice is to be sure to include the notification subscription ID in your alert channel, such as follows…

Sponsors, article continues below...

Alert: Logon Failures – Multiple failures by same User on single Machine
Severity: 2
Source: ADS04.Domain.pvt
Path: ADS04.Domain.pvt
Last modified by: System
Last modified time: 9/22/2011 11:47:49 AM

Alert description: Multiple Logon Failures by user DOMAIN\user01 with logon type 0xffffffffc0000225. See Alert Context for more details.

Alert view link: “http://RMS01:51908/default.aspx?DisplayMode=Pivot&AlertID=%7bdbe48f98-2051-4d83-aecb-664a07c0eb46%7d”
Notification subscription ID generating this message: {BB47B5DE-176C-524C-FC13-2C8576C7000E}

Continue reading »

Microsoft, SCOM , , Leave a comment

Enable Windows Authentication for Live Maps on a non-RMS Server

I’ve wanted to move my Live Maps installation off of my SCOM 2007 R2 RMS for some time now. But until recently I was under the impression that it was not possible to do this with Windows based authentication enabled in Live Maps. I attended MMS 2011 and stopped by the Savision booth in the expo to preview Savision’s new Vital Signs product (A must see!) and got to talking about this issue with Dennis Rietvink of Savision. He said it was very possible and to contact their support. So when I got back from MMS I did and Michiel Rens at Savision support referred me to Kevin Holman’s blog for a possible solution. Kevin goes into quite a bit of detail on the work around. He is providing a solution if you want to run the SCOM console on another server with Windows based authentication, although most of the solution enables the same for Live Maps. Please read Kevin Holman’s blog in detail before continuing. The goal of this post is to communicate what worked for me, in my environment. My environment consists of a Windows 2008 R2 RMS, a Windows 2008 R2 Live Maps server, and Windows 2008 R2 function level AD. All environments vary on operating systems, AD function levels, and security policies. So be sure you know exactly what you are doing before implementing this solution!

Continue reading »

Microsoft, SCOM , , , , , 1 Comment

Mass reboot servers and workstations with PowerShell

We’ve got a bunch of servers stuck in pending reboot state due to SCCM updates. There is no way I’m rebooting 50 servers manually! PowerShell to the rescue!
Continue reading »

Microsoft, PowerShell , , , Leave a comment

Resetting Logical Disk Fragmentation Monitor via PowerShell

I’ve been goog..errr bing’ing trying to look for a solution and most everyone points to the GreenMachine. Although a great and powerful tool that I have used on occasion, for some reason it does not filter for monitors in “Warning” only state and I cannot filter by monitor. In this case I will be resetting healthstate for monitors I did not intent to. I have assignee and ticket number assigned to the associated alert. If the monitor resets I lose that tracking information. My goal is to reset healthstate for only the “Logical Disk Fragmentation” monitors. There are two of these monitors, one for Windows 2003 and one for Windows 2008. My proposed solution is to utilize PowerShell with the SCOM snapin. Next week when my fragmentation monitors flip back to “Warning” state I will try the PS script I created and post an update. In theory it should work 😀 Continue reading »

Microsoft, SCOM , , , Leave a comment

xperf: error: NT Kernel Logger: Cannot create a file when that file already exists

My % Interrupt Time on one of my servers was exceeding 10%, yielding a SCOM alert. I went to dive in deeper and discovered it is a driver or hardware issue. To determine what driver might be causing the large amounts of interrupts I had to result to a tool called xperf, which is apart of the Windows Performance Toolkit. I ran into an issue where I could not run a kernel trace and this is what I have discovered…
Continue reading »

Microsoft, SCOM , , Leave a comment

OperationsManager Database Connectivity Issues After Migration

I was tasked with migration an OperationsManager database off to another SQL server on an SQL Instance other than the default “SQLSERVER” instance. I following the TechNet article to perform the migration but was receiving various database connectivity errors in the Operations Manager log on my RMS. Examples of errors occurring for me are below: Continue reading »

Microsoft, SCOM , , , 1 Comment

PowerShell Script To Restart Service And Dependents

Some of my Windows 2008 R2 servers have been reaching over our 80% committed memory threshold more often than preferred. There is a hotfix out as noted on Kevin Holman’s OpsMgr Blog – http://blogs.technet.com/b/kevinholman/archive/2010/06/09/wmi-leaks-memory-on-server-2008-r2-monitored-agents.aspx , however the server admins have not tested and deployed the hotfix yet so in the mean time I needed an efficient way to bounce the WMI service along with dependencies.

In case anyone else if having this issue… This is the script I am using as a Recovery Task with Winmgmt as its parameter to run and sorry if I made any mistakes this is only my third PowerShell script! Feel free to change and let me know if there is a better way! .. NOTE: You will probably need to sign the code unless you changed the PowerShell script execution policy to Unrestricted ! Continue reading »

Microsoft, PowerShell, SCOM , , , , , , 2 Comments

iPhone iOS 4 Keeps Saying Password Expired

For those that have iPhones and want to upgrade to iOS 4 and are using the a profile find solution below….

Continue reading »

Apple, iPhone , , , 2 Comments