Archive for the ‘Tools’ Category

A gathering of links, part 3   Leave a comment


Sorry for the lack of content. I have something I can write about, I think, but work is getting in the way.

For now, a gathering of links instead.

Cripes! I need to do these more often, this took me forever.

If you find these useful, please rate this blog post or leave a comment. There’s really no need for me to spend my morning doing this if no-one’s going to read it. 🙂

Advertisements

Some unusual behaviour from Best Practice Analyzer   Leave a comment


A customer of mine recently ran a Best Practices Analyzer scan on his new Hyper-V 2012 setup in order to make sure everything was by the book.

Besides a couple of minor issues one warning stood out to him: “The memory configuration for one or more virtual machines might require the use of Smart Paging if the virtual machine is rebooted, and the specified location for the Smart Paging file is the system disk of the server running Hyper-V.”

He was sure there was no way the Smart Paging file wasn’t located on his CSV’s and decided to check. Sure enough, it’s located on a CSV:

Smart Paging file location

The only hit I get when searching for this exact error message is a TechNet Wiki article telling you not to store the Smart Paging file on the system disk. Thanks, I guess. 🙂

We’ve come to the conclusion that this is a bug in the BPA as it complains on all his VMs, despite them all being correctly configured.

Has any one of you reading this encountered this behaviour?

Posted 17 September, 2013 by martinnr5 in FYI, Technical, Tools

Tagged with , ,

DPM storage calculations   Leave a comment


I’m posting this as I couldn’t find a good single point of reference for how to calculate how much storage your DPM implementation might need.

First off; here are the formulas that DPM uses to calculate default storage space if you want to do the math yourself. Sometimes this is the fastest way if you only need a rough estimate for a simple workload. These don’t take data growth into consideration though.

If you need more complex calculations there are a couple of calculators for DPM:

As mentioned above none of these are for DPM 2012 but if all you need is an accurate estimate of how much storage a DPM implementation will use they’ll do just fine.

Something else worth mentioning is that they don’t take into consideration the new limits of Hyper-V in Windows Server 2012 but if you need to protect a cluster larger than 16 nodes you’d probably want to do the math on your own just to be sure anyhow. 🙂

The first calculator is the most detailed but only covers Exchange up to version 2007. I never use this my self.

The DPM Volume Sizing Tool is actually a set of scripts and Excel sheets that you use to gather actual data from your environment if you want to, along with a couple of Word documents on how to get the ball rolling.

The latest version of the stand alone calculators for DPM 2010 are more detailed than the DPM Volume Sizing Tool but the Exchange calculator is not as detailed as the older one for Exchange and DPM 2007. In addition, these only cover a few of the workloads that DPM can protect.

Personally I do the math myself and if I need to use a calculator I manually enter values into the Excel calculator from the DPM Volume Sizing Tool as this calculator both handles all workloads that DPM can protect and also gives me a good summary of the storage needed.

It’d be nice to see Microsoft develop a single Excel calculator for all workloads and DPM 2012 but that doesn’t seem likely so we’ll make do with what we got.

Posted 12 September, 2013 by martinnr5 in Documentation, Elsewhere, Technical, Tools

Tagged with , ,

“Clipboard” disks in Hyper-V   Leave a comment


With Windows Server 2012 R2 we’ll be getting a complete RDP experience when connecting to a VM through Hyper-V Manager, Failover Cluster Manager or VMM which means that we’ll get an easy way to copy content to a VM that’s otherwise isolated from a network.

There are still a couple of reasons why you’d want an alternative though and I’d like to present mine.

I’m certain that I’m not the only one looking for a solution to this problem and I’m equally sure that I’m not the only one who thought that hot-adding and removing disks to the SCSI-controller in a VM and then mounting and unmounting the VHD/VHDX to the host is an interesting way to do it.

I’d also be very surprised if I’m the only one who scripted this to some degree but as I wanted to write some PowerShell I haven’t checked if anyone else has done this.

So, here’s my version of a script for managing what I call “clipboard” disks. I’m not that good with PowerShell so it’s rather crude and although I’ve added what I think is enough for a version 1.0 there’s still lots of room for improvement so feel free to provide feedback in the comments.

Download from SkyDrive: ClipboardDisk.zip

<#
.AUTHOR
 Martin Edelius, 2013-07-12. Find me at https://hypervaccordingtome.wordpress.com/

.SYNOPSIS
 Allows you to attach and remove a VHDX to a running VM as well as to the host the VHDX is located on in a controlled manner.

.DESCRIPTION
 The script requires you to create a base clipboard VHDX, formatted and ready to use, located in an appropriate place on the Hyper-V host.

 If the VM you select to connect a VHDX to doesn't have a unique clipboard disk the script will create one based on the base clipboard disk.

 The script toggles the clipboard disk between being attached to the VM and to the host until you manually exit the loop.

 The script also provides options for removing the clipboard disk from all VMs and also to unmount them all from the host.

 In order to locate the clipboard disk the script uses location 63 on SCSI-controller 0 of the VM which means that A) you need a SCSI-controller and B) that location has to be empty.
 
.EXAMPLE
 PS> ClipboardDisk.ps1
 
 This starts the script which from here on is interactive. The script doesn't accept any parameters.
  
.NOTES
 You must be running as a user that has permissions to attach a VHDX to a VM and also permissions to mount a VHDX to the host.

 Feel free to modify and distribute this script to your hearts content but if you do any major modifications I want you to post a comment to this post: http://wp.me/p1vNsA-2u with a link back to your modified script so that others may benefit from it.

 Finally; you're using this completely on your own risk, I take no responsibility for any damage this script may do. If something breaks, you own both parts.
#>

# Path to the base clipboard disk that is used for new, unique clipboard disks
# Do not forget the trailing '\'!
$BaseClipboardDiskPath = "C:\VHD\Clipboards\";

# Name of the base clipboard disk that is used for new, unique clipboard disks
$BaseClipboardDiskName = "Clipboard - base.vhdx";

## PLEASE DO NOT MODIFY BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING! ##

# Select action
Write-Host("Select option:`n1. Toggle clipboard disk for VM (default)`n2. Unmount all disks from host`n3. Disconnect clipboard disk from all VMs");
$Action = Read-Host("[Enter = default]");

# Set default behaviour
if($Action.Length -eq 0)
{
    $Action = 1;
}

switch($Action)
{
    1 # Toggle clipboard disk
    {
        # Loop through VMs and list their names and corresponding numbers
        $VmInfo = @{};

        $VMs = Get-VM;

        # Make sure that we actually have any VMs to list
        if($VMs.Length -eq 0)
        {
            Write-Host("`nCouldn't find any VMs, do you have correct permissions to list them?`n");
        }
        else
        {
            Write-Host(" ");   # Just to introduce a newline, for readability's sake.
            $VMidx = 1;
            foreach($VM in $VMs)
            {
                Write-Host($VMidx.ToString() + ": " + $VM.Name);
                $VmInfo.Add($VMidx++, $VM.Name);
            }

            # Grab the index of the VM we want to attach a clipboard disk to
            do
            {
                $VMidx = Read-Host("Choose VM (1 - " + $VmInfo.Count + ")");
            }
            while($VMidx.Length -le 0 -and $VMidx -le 0);

            # Grab the name of the VM from the info hashtable
            $VMname = $VmInfo.Get_Item([int]$VMidx);

            # Do we have a unique clipboard disk for this VM?
            $VMDiskPath = "$BaseClipboardDiskPath$VMname.VHDX";

            if(!(Test-Path $VMDiskPath))
            {
                # Create new clipboard disk
                Write-Host("`nCreating unique clipboard disk: $VMDiskPath");
                Copy-Item "$BaseClipboardDiskPath$BaseClipboardDiskName" -Destination $VMDiskPath;
            }
            else
            {
                Write-Host("`nUnique clipboard disk exists: $VMDiskPath");
            }

            # This runs in a loop that only exits when the user enters the letter 'q'
            do
            {
                # Grab all disks attached to this VM
                $VMHDAttached = $false;
                $VMHardDisks = Get-VM -Name $VMName | Get-VMHardDiskDrive

                # We need a way to identify the clipboard disk so it always attaches to SCSI-controller 0, position 63
                foreach($VMHardDisk in $VMHardDisks)
                {
                    if($VMHardDisk.ControllerType -eq "SCSI" -and $VMHardDisk.ControllerNumber -eq 0 -and $VMHardDisk.ControllerLocation -eq 63)
                    {
                        $VMHDAttached = $true;
                    }
                }

                # Did we find one at our designated clipboard position?
                if($VMHDAttached)
                {
                    # Disk is attached so lets remove it and then mount it to our host
                    Remove-VMHardDiskDrive -ControllerLocation 63 -ControllerNumber 0 -ControllerType SCSI -VMName $VMName;
                    Write-Host("`nDisk removed from VM!");
                    Mount-VHD $VMDiskPath;
                    Write-Host("Disk mounted to host!");
                }
                else
                {
                    Write-Host(" ");   # Need to introduce a newline, for readability's sake.
                    # Unmount disk from host and then attach to VM
                    if((Get-VHD -Path $VMDiskPath).Attached -eq $true)
                    {
                        # Only dismount if it's attached to the host to begin with. Duh.
                        Dismount-VHD $VMDiskPath;
                        Write-Host("Disk unmounted from host!");
                    }
                    Add-VMHardDiskDrive -VMName $VMName -ControllerLocation 63 -ControllerNumber 0 -ControllerType SCSI -Path $VMDiskPath
                    Write-Host("Disk attached to VM!");
                }

                $subAction = Read-Host("'Q' to quit loop, [Enter] to toggle");
            }
            while($subAction.ToUpper() -ne 'Q');
        }
    }

    2 # Unmount all VHDs from host
    {
        $VHDs = Get-VHD "$BaseClipboardDiskPath*.VHDX";

        foreach($VHD in $VHDs)
        {
            if($VHD.Attached -eq $true)
            {
                # Only dismount if it's attached to the host to begin with. Duh.
                Dismount-VHD $VHD.Path;
                Write-Host($VHD.Path +" unmounted from host!");
            }
        }

        Write-Host("`nDone!`n");
    }

    3 # Disconnect clipboard VHD from all VMs
    {
        $VMs = Get-VM;

        foreach($VM in $VMs)
        {
            $VMHardDisks = $VM| Get-VMHardDiskDrive;

            # We need a way to identify the clipboard disk so it always attaches to SCSI-controller 0, position 63
            foreach($VMHardDisk in $VMHardDisks)
            {
                if($VMHardDisk.ControllerType -eq "SCSI" -and $VMHardDisk.ControllerNumber -eq 0 -and $VMHardDisk.ControllerLocation -eq 63)
                {
                    Remove-VMHardDiskDrive $VMHardDisk;
                    Write-Host("`nDisk disconnected from VM " + $VM.Name +"!");
                }
            }
        }
        Write-Host("`nDone!`n");
    }
}

Posted 12 July, 2013 by martinnr5 in Technical, Tools

Tagged with , ,

Infrastructure Planning and Design Guide for System Center 2012 – Virtual Machine Manager now available   Leave a comment


The Infrastructure Planning and Design Guide for System Center 2012 – Virtual Machine Manager is now available for download.

I haven’t taken a look at it myself but hope to be able to do so tomorrow.

Here’s a short description of it from the official announcement:

This guide outlines the elements that are crucial to an optimized design of Virtual Machine Manager. It leads you through a process of identifying the business and technical requirements for managing virtualization, designing integration with Operations Manager if required, and then determining the number, size, and placement of the VMM servers. This guide helps you to confidently plan for the centralized administration of physical and virtual machines.

Posted 24 July, 2012 by martinnr5 in Documentation, Tools

Tagged with ,

Why System Center Orchestrator?   1 comment


Why System Center Orchestrator?

A customer of mine recently asked me why he needed System Center Orchestrator (I believe we’re abbreviating it SCORCH, although I think SCOR is a better homonym (and why is abbreviate a long word?)).

In reality he was most likely asking me why he needed automation as he pointed out that if they really needed to automate anything they’d done it 4 years ago with a bunch of PowerShell scripts and a custom made web application. Instead of opening up that can of worms (I’ll gladly do that later though) I’m going to compare SCORCH to his solution.

Based on my own rather limited knowledge of SCORCH and the very in-depth knowledge of one of my colleuages I’d say that there are a number of reasons why you should use SCORCH over a home made automation engine.

It’s Microsoft

Yeah, I know a lot of you think this should be on the minus side of the equation but to be honest, Microsoft has gotten their act together quite a bit over the years and we all know that they’re in this for the long run.

Microsoft have a ton of resources – be it marketing, developers, money or industry klout – so when they have their collective hive mind set on something, they make it happen (see the Xbox as a perfect example).

Another reason for this to be in the PRO camp is that Microsoft is responsible for the entire System Center suite, along with Hyper-V, which makes it a lot easier to get all the components to co-operate and even though SCORCH isn’t entirely in sync with the rest of the System Center products, it will be soon enough.

It hasn’t always been Microsoft

Thanks to SCORCH starting out as Opalis and then being bought by Microsoft there is a lot of functionality and connectors that Microsoft probably might not have put in there if they’d written this from scratch.

They are, as I mentioned above, getting their act together though and might just have gotten around to it sooner or later but in that case it’d be criminal of them not to focus on their own line-up of products first and then add support for the competitors products a lot further down the line.

It’s easy to get started

Easy being relative, of course, but if you compare it to writing everything from scratch SCORCH is a lot easier to get up and running thanks to the plethora of connectors and OOtB functionality you get.

Powerful and flexible yet simple

SCORCH is powerful and flexible when you need it to be and simple when you don’t. Even though you will be forced to write your own custom scripts from time to time the graphical interface of the editor in SCORCH is hard to beat when designing complex runbooks.

Self documenting

In a way at least. Having a graphical overview of your runbook and the scripts, linked together, makes it a lot easier to understand what the heck is going on compared to a folder with a bunch of PowerShell scripts – no matter how intelligently you name the scripts.

You’re not alone

There are thousands of users of SCORCH that share knowledge and ideas through multiple forums, not the least through Microsofts own channels. Microsoft even provides support themselves if you want to pay for it.

An off the shelf product

This is actually a very important point that ties in with the previous one. SCORCH being an off the shelf product means that any SCORCH consultant knows how it works. Sure, the actual functionality of the runbooks and custom scripts still needs to be figured out but he or she will hit the ground running with SCORCH.

Not so with the home built shack of scripts and web applications. On the contrary I’m betting that the consultant that’ll have to figure this solution out will break one or both legs when he or she hits the ground.

Future proof

SCORCH relies a lot on the same technologies as a home made solution does (PowerShell, IIS, etc) so from that point of view we can’t argue that the home made solution is any less future proof than SCORCH but I’d argue that SCORCH as a whole is more future proof.

Microsoft is going to evolve SCORCH and in the process they’ll make sure that as many dependencies surrounding it will be evolved as well or at least work with the latest version of SCORCH.

They will not care about your own home brewed concoction of scripts and .NET pages.

It’s included in System Center

There are of course organisations that don’t use System Center but the majority that do use it would likely benefit from automatization. With the new licensing model you get SCORCH “for free” when you buy System Center so price isn’t an issue either.

Are there any cons?

The only actual negative aspect of running SCORCH is that you need another server for this but as long as you adhere to the private cloud principles, adding another server shouldn’t task your IT department at all.

You already own a Datacenter license of Windows Server so if you virtualize your SCORCH server there are no additional cost for licensing either.

Conclusion

SCORCH is a very competent, flexible, well designed, interoperational, powerful and reliable automation engine that works exceptionally well with the rest of System Center.

The new System center licensing model gives you all System Center products for one price so most larger organisations probably already own SCORCH along with the other System Center applications.

Being a Microsoft product there are a ton of consultants that can help you out when needed as well as a large community and professional support options straight from Microsoft.

If you’re going to automate – and you are if you know what’s good for you – there’s a very good chance that SCORCH is the best solution for you.

Resources

Posted 24 July, 2012 by martinnr5 in Opinion, Tools

Tagged with , ,

Server Core and SQL Server   Leave a comment


As I’ve mentioned in the past I’m not a supporter of Server Core as a Hyper-V plattform but when it comes to other roles I see it as a great option.

I’m currently building a new lab at my new employer and one of the things I wanted to try out was running SQL Server 2008 R2 on Server Core R2. It’s not totally straightforward, and most importantly not supported by Microsoft, but Joachim Nässlander has all the details in his blog.

The only thing that tripped me up, because I didn’t read the comments as I normally would, is that for the full version of SQL you need to add the “/IAcceptSQLServerLicenseTerms=true” to the install script.

Posted 26 September, 2011 by martinnr5 in Elsewhere, Tools

Tagged with ,

%d bloggers like this: