Hyper-V VM´s BIN files, to be or not to be in clusters

If you create lots of VM´s with large amount of RAM memory assigned to them and start to wonder why you have used some of the storage on the volumes then this is because if you have set up a VM without changing anything you get a bin file in the VM folder that corresponds to the size of the allocated RAM. This file is used to save the VM`s RAM to disk when the VM is going into saved state!

Screen Shot 2015-02-19 at 12.23.41

In an environment where you have all VM´s as clustered resources you will not need to be able to use the saved state when shutdown the host as you will live migrate the VM´s when doing stuff with the HW.

The setting is easily found in Hyper-V Manager for an already deployed VM:

Screen Shot 2015-02-19 at 12.22.06

It is not so easily found in System Center VMM when checking the VM properties, but when deploying a new VM you find it in the wizard:

Screen Shot 2015-02-19 at 12.29.26

If you want to change the setting for your VM´s running in a cluster via VMM you will have to use PowerShell and it is quite easy to do that with a one-liner, first you see the setting with the PowerShell command Get-SCVirtualMachine and then you can configure it with Set-SCVirtualMachine :

Screen Shot 2015-02-19 at 12.40.18
Screen Shot 2015-02-19 at 13.29.46

And now when checking the folder for the VM the BIN file has magically shrunk to 4KB 🙂

Screen Shot 2015-02-19 at 13.44.03

Error dialog when opening VMM console after update to VMM 2012 R2 UR5

I have updated a VMM server with the latest UR5 and now when opening the console the following error appears

Screen Shot 2015-02-18 at 11.17.31

This was quite easily handled as you can see the folder is there but looking a bit further I found that authenticated users of the had no NTFS rights on the particular folder.

Screen Shot 2015-02-18 at 11.21.33

After updating and adding authenticaded users as described in the release notes of the UR5 and giving it access to HostSIdeAdapters I did not get any error messages after starting the console

VM Storage Migration in VMM 2012 R2 leaves unwanted leftovers

I have been playing around with a case where we have been upgrading and creating a new Windows Server 2012 R2 Hyper-V cluster and adding CSV volumes to it, and when first volume became full we started to storage migrate the VM´s to another volume but for some reason the files where left behind so I created my own PowerShell function to handle that as the built-in does not have that parameter and for some reason leaves leftovers?!

As you can see when I have done a live storage migration within a Hyper-V host with the GUI in VMM it leaves both vhdx and xml of the VM, and that can be troublesome when someone tries to import that VM while the other is already running and also you do not gain that space you thought would be reclaimed because you did a live storage migration.

Screen Shot 2015-02-16 at 15.38.54

No problem to move but as you can see in the volume that I migrated from:

Screen Shot 2015-02-16 at 15.06.32

And the volume that I migrated to:

Screen Shot 2015-02-16 at 15.06.55

I have been reproducing the migration with either just folders or both folders and vhdx/xml files still at the source..

When I run my function it cleans the source if i use the parameter -deletesource

Screen Shot 2015-02-17 at 15.51.08

Here is the PowerShell function for you to try:

Good luck in your automation 🙂

Mass-VDI reconfiguration on vSphere with PowerCLI

A colleague asked me if there was an easy way to reconfigure VM´s that was on different hosts with PowerCLI, for some reason the VM´s had been configured with too many vCPU´s and the customer wanted a way to reconfigure the running VM´s.

I made a very easy PowerCLI script to solve this, maybe there is other solutions that might be better/more beautiful but this one solved the issue 🙂

You save this as a script and then run it with the starting name of the VM´s you want to configure, and as you can see you have to already have connected to the vcenter with Connect-VIServer before running it:

Screen Shot 2015-02-16 at 10.25.27

happy automating 🙂

New version of Microsoft Assessment and Planning 9.2

Screen Shot 2015-02-12 at 16.04.28

Yesterday Microsoft released a new version of Microsoft Assessment and Planning toolkit 9.2 and the new key features are

  • Azure VM Capacity assessment to include assessment for A8 and A9 Azure VMs
    MAP 9.2 updated Windows Azure VM Capacity assessment to include assessment for A8 and A9 Azure VMs. A8 and A9 Azure VMs are processor intensive and thus have a base processor of an Intel Xeon E5-2670 2.6 GHz.
  • Included Windows Server 2008(x86/x64) under Legacy Server Discovery
    Windows Server 2008(x86/x64) included under Legacy Server Discovery in addition to Windows Servers 2000, 2003 and Itanium. For example, before MAP 9.2 the discovery of the Legacy Servers which were added are Windows Server 2000, Windows Server 2003(x86/x64) and Itanium Windows Server. Now MAP 9.2 includes the discovery of Windows Server 2008(x86/x64) as well to the collection of Legacy Server Discovery.
  • Improved Legacy Server Discovery reporting by including OS Architecture
    In this version of MAP we included OS Architecture(32 or 64 bit) as an expansion in the Legacy Server Discovery reporting.
  • Collection of additional performance counters and included CPU speed
    In this version of MAP we added four new performance counters Disk Queue Length, Disk Read Queue Length, Disk Write Queue Length, Disk Bytes/sec and expanded performance collection process to accomodate the new counters and assessment process. Added CPU Speed(GHz) to Performance Metric Summary report.

You can download the new version from the Microsoft download here.

Handy way to use PowerShell with VMM 2012 R2

After working with a customer and showing them the PowerShell scripts and functions I had made for automating their VMM 2012 R2 environment I realized that I needed a way to actually let them easily get them loaded and ready for use.

As you might know, you can store scripts within your VMM Library and also run them from the same place! So I thought of saving the functions there and making an initiator script that would load the functions that I had created so they could use them right away.

Really easy script that looks in the functions folder and import all functions, and as it is dynamic it will load all functions available in the folder at the time it is executed:

And when you put it in your VMM library it looks like this, I have added some description to make it more clear what it does 😉

Screen Shot 2015-02-06 at 13.24.40


And you can then run it from the console with the Run button and once the PowerShell console is loaded you can see which functions have been loaded and what names they have 🙂

Screen Shot 2015-02-06 at 13.50.07


And in the folder I have added the files containing the functions that I made with .psm1 ending ( I am converting some of the scripts that I made earlier to functions and will add them later, that is why it is quite few yet). You will also have to check and edit the permissions on the share and the SCVMM_Library folder so the user trying to run the script will be able to.

Screen Shot 2015-02-06 at 14.53.50


Also, I added the server in trusted sites otherwise I got this digital signed error and I do not at this moment have a cert to sign the scripts

digitalsignederror

So to get around that one you add in Internet Explorer Trusted SItes: *://vmm02.vmmserver.se (or of course what your VMM server FQDN is)

Screen Shot 2015-02-06 at 14.25.07

Last of all, to be able to run some of the functions that need elevation you can start the VMM GUI Console with “Run As Administrator” but you still use your Windows Credentials:

Screen Shot 2015-02-06 at 14.21.05

Happy automating within VMM 🙂

And yes SMA has been thought of but right now the customer do not need that extra complexity with WAP,SMA,SPF and runbook workers…..

Download the new DPM 2012 R2 UR4 Eval VHD with Powershell and BITS

I was at a customer today and we decided to evaluate System Center DPM for their Hyper-V platform.

I was going to download the Eval VHD that so nicely have been updated with the latest UR4 but I got an irritating error, I reached out on twitter and it was not just me and the internet connection/Firewall I was using causing this as others where also having the same issue 🙁

Screen Shot 2015-02-04 at 13.55.58

I later tried this evening and now it worked, they had changed the file extension for download to .ZIP instead of VHD

By using powershell you can just send your req to BITS and sit down and relax until it is finished and then you can evaluate DPM 🙂

Happy backuping and ” Real Men don’t take backup! – Or do they? ”