Adding Clouds to SC App Controller 2012 SP1 with PowerShell

Last post I did was about how to get the connection to an remote SC App Controller Server with the SCAC PowerShell module.

Now I will show you how to add your Private and Public Cloud to your App Controller with the PowerShell cmdlets.

First off I will add my SC VMM server, and as you can see I first connect to the App Controller and then add the VMM server.

AddVMM

I do not know if it is my silverlight that has some issues or, but the web console did not reflect the addition of the VMM Server until I logged of and then on the App Controller portal

VMMingui
PS C:\> Add-SCACCloudSystem -VMM -Name VMM2012 -ServerName vmm2012.lumademo.local -Port 8100

Then I will add my Azure account and that is done by adding an subscription, here you will need the certificate with the private key for the management certificate that you uploaded to your Azure subscription. And yes I have cluttered out the password and subscription Id in the screendump so it is not your monitor that broke 😉

AddAzure
Azuregui
PS C:\> Add-SCACAzureSubscription -Name vNiklas -Id your-azure-subscription-id -ManagementCertificatePath C:\temp\certazure.pfx -ManagementCertificatePassword (ConvertTo-SecureString -AsPlainText "YourCertPassword" -Force)

Pretty easy and now I have two clouds in my App Controller, I can also add a SPF cloud connection from a third party vendor to get a truly hybrid cloud, that I have not set up yet though so it will have to be in another post.

Using SC App Controller 2012 SP1 PowerShell module remote

Today I have been exploring the System Center App Controller 2012 SP1 and the PowerShell module that it has.

There is not so many cmdlets in this but maybe it is enough… will find out soon 🙂

Screen Shot 2013-03-26 at 20.55.51

One cmdlet that is necessary is the Get-SCACServer if you are running the powershell module remote. Here comes the small problem when like me not using a certificate from a trusted CA like the AD CS or bought by a small amount of $$$ from verisign or other vendor of certs. As you can see on the next screendump I get a small error that the cmdlet does not like the certificate, well as there is no -force parameter on the cmdlet I went for another aproach and I added the self-signed cerificate from the App Controller server that was used in the IIS to the trusted root certificate authorities certificate store in the cert manager on the Management machine where I wanted to run the appcontroller PowerShell module. And now the cmdlet did not complain and I could get the App Controller server 🙂

Screen Shot 2013-03-26 at 21.43.22

Here you can see where I added the cerificate,

Screen Shot 2013-03-26 at 21.59.48

When using the App Controller PowerShell module locally on the same server as the App Controller Server resides this trust of the cert is already taken care of 🙂

A good post on how to create your own certificates for example using in management of your Azure or your IIS SSL you can find here on this link.

Downloading help for SC VMM 2012 SP1 PowerShell module

Today I wanted to use the help in SC Virtual Machine Manager PowerShell console and found that I had to download the updated help before I could see the whole, and of course I tried to do that but encountered the little error that follows in the screendump as you see,

Screen Shot 2013-03-25 at 10.35.55

I had used the PowerShell shortcut in the VMM Console, and was using my own login account, It is part of administrators/domain admins but still had not proper rights on the VMM server.

Screen Shot 2013-03-25 at 19.59.53

I opened a new PowerShell console by right click on the shortcut on the taskbar and chose Run-As Administrator and typed:

Screen Shot 2013-03-25 at 20.03.07
Import-Module virtualmachinemanager
Update-Help -Module virtualmachinemanager

And now I can see the full help 🙂

Screen Shot 2013-03-25 at 19.56.52

New book : Windows 2012 Hyper-V Install and Configuration Guide

HypVConfgInstallgd

Today I bought this book that is written by

  • Aidan Finn
  • Patrick Lownds
  • Michel Luescher
  • Damian Flynn

And in part one I found that Aidan had referred to one of my scripts for moving virtual machine storage without leaving anything behind,

cleaningvNiklas

since the book got into production I have made an update to do some checking and not deleting to much that could happend in the first version!

I feel really honored to be included within a such complete and thorough book about Hyper-V in Windows 2012!

It takes som extra days before it is going to start being delivered in Europe but You can as I by it directly from the Amazon US Kindle store and get it delivered to your App on a chosen device.

Failover Cluster not updated after vm storage migration in VMM 2012 SP1

I was talking to a customer today about an issue they had with their SC VMM 2012 SP1 and when they where doing some storage migrations between their CSV SAN volumes in the Hyper-V cluster.

Screen Shot 2013-03-19 at 22.24.56
Move-SCVirtualMachine -VM (Get-SCVirtualMachine VMtest) -VMHost (Get-VMHost HV02) -Path "C:\ClusterStorage\Volume2" -UseLAN

Everything looks good inside VMM and also the VM works nicely but when looking at the failover cluster manager the resource is not updated which resulted in failure in backup with DPM and probably more issues.

Here is a screendump of the VM in failover cluster manager and also an screendump of the VM in VMM after the migration, as you can see these values does not match

Screen Shot 2013-03-19 at 20.24.47
Screen Shot 2013-03-19 at 20.57.09

There is a way to solve this but that will mean that we have to use the failover cluster and Hyper-V cmdlets. Also should be noted that if we use the failover cluster manager it works so it is a bug in VMM.

So I opened a new PowerShell console and typed the following:

Get-VM VMtest -ComputerName HV02 | Update-ClusterVirtualMachineConfiguration -Cluster HVCL30

And here you can now see that the cluster resource reflects the right data

Screen Shot 2013-03-19 at 22.40.42

There is actually one more solution and that is to remove the VM from the cluster and then add it again but it is easier to just update the cluster virtual machine configuration 🙂

On the management computer I always install the RSAT tools for Hyper-V and also Failover Cluster along with the VMM console to be able to do all management from one place even if I cannot do it all in VMM.

SCVMM 2012 SP1 VM Network Name missing issue

Today when I was going to test the P2V functionality of the VMM 2012 SP1 I found a strange issue.

walking through the wizard for the p2v migration, it gave me an error that I first did not understand, but as it did not allow me to continue the wizard I had to start searching. Based on the object name VMNetwork I concluded that it probably had something to do with the VM Networks.

vmmp2verror

Using PowerShell with the VMM module and the cmdlet Get-SCVMNetwork gave me the following error, and that did not look so good, it should be working right?!

errorvmmpsnet

And looking in the VMM console over the VM networks showed me the following, and yes it is not possible to create a VM Network that has no name but somehow it had happend in my system!

beforevmnetworkconsole

When I restarted the VMM Console the whole list was empty so surely the system did not like this..

So how did I fix it? As all data except the library files are stored in the VMM database I went in there. Here is an excellent place for a reminder for you guys out there that not yet have set up any backup for your VMM servers and particularly the DB, DO IT!

Now my system is a test/lab so if I would break it there is no production systems that will be dependent of any errors or failures.

To be on the safe side I stopped the VMMService before I edited the database and that of course with PowerShell:

stopvmmsrvc

And when that was done I opened the SQL Management Studio and expanded the VMM database, they have a good best practice in naming the tables so it did not take so long time for me to find the one that I wanted to edit, in this case dbo.tbl_NetMan_VMNetwork , right click and chose the edit top 200 rows (if you have more than 200 vm networks you will have to do a query instead 🙂 )

editdbtable

And as you can see on the rows in this table there is one that has in a mysterious way gone blank on the name field, I edited it with the name “Internal” as that was the name I had before and then hit Enter, closed the table and then I started the VMMService again.

editdbtablerow

And in the VM Networks view of the VMM Console everything was back to normal again:

backtovmnetworkconsole

Now I will look at some logs and try to find out why the VM Network´s name disappeared in the first place 🙂