Category: Hyper-V

System Center Virtual Machine Manager (SCVMM) 2016 – Error 2912 – Unknown error (0x80041008)

Problem: Cannot to deploy a logical switch (vSwitch) to a Windows Server 2016 node.

Environment: 2x10GB Network Cards – IBM Flex Chassis (not that matters…)

Error:

An internal error has occurred trying to contact the ‘hypervserver01.domain.com’ server: : .

WinRM: URL: [http://hypervserver01.domain.com:5985], Verb: [INVOKE], Method: [GetFinalResult], Resource: [http://schemas.microsoft.com/wbem/wsman/1/wmi/root/scvmm/AsyncTask?ID=1001]

Unknown error (0x80041008)

Recommended Action
Check that WS-Management service is installed and running on server ‘hypervserver01.domain.com’. For more information use the command “winrm helpmsg hresult”. If ‘hypervserver01.domain.com’ is a host/library/update server or a PXE server role then ensure that VMM agent is installed and running. Refer to http://support.microsoft.com/kb/2742275 for more details.

Solution: In my case, I tried the following. Ultimately, it came down to my last case (enabling the physical network card).

  • Disable Windows Firewalls on both SCVMM and the Hyper-V 2016 server
  • Change the default WinRM port to 5985
winrm set winrm/config/Listener?Address=*+Transport=HTTP '@{Port="5985"}'

  • Enable the secondary physical port
Advertisements

Hyper-V 2016 Linux Ubuntu PXE Network Boot Error

If you’re like me, you want to run Linux on your Hyper-V 2016 host, in my case I am attempting to run a Linux Ubuntu 16.04.1. Booting from an ISO, I kept getting the same error over and over. “PXE Network Boot using IPv4 ( ESC to cancel ) Performing DHCP Negotiation….“. After realizing it wasn’t the ISO media. It wasn’t the size of the VHDX. It wasn’t the memory/vCPU or vNIC configuration. It wasn’t even due to the fact it was a Generation 1 or Generation 2 VM…. It was Secure Boot function.

1 2

Solution

  1. Stop the VM
  2. Go to its Settings
  3. Within Hardware > Select Security > Disable/UncheckEnable Secure Boot” > Start your machine back up!

3

Yay!

How to upload Custom Images to Microsoft Azure using PowerShell

In this post, I am going to show how to upload a custom image used in Windows Hyper-V (2016) to Azure cloud. I will be using a combination of the UI in Hyper-V and PowerShell in Azure Resource Manager. I will be working with Azure Resource Manager (ARM) and with Hyper-V 2016 with a custom image of Windows Server 2008 R2 SP1.

Okay, let’s get started.

Prepare On-Premises Virtual Machine Image

First, we need an image to work with. As mentioned, I am using a Windows Server 2008 R2 SP1 (yes, 2008 — needed it for a customer). The VM is Generation 1, which is not only a requirement for Windows 2008, but also a requirement for Azure, as it currently does not support Generation 2 VMs. See HERE to read more on preparing a Windows VHD.

Next, we need to install Hyper-V role on the VM. Since this is a nested VM, we will first need to enable nested-virtualization on the Hyper 2016 box. See a previous post on how to go about this HERE. Once that is complete, go ahead and install the Hyper-V role.

Next, we now need to SysPrep our VM. From an Administrative command prompt, navigate to %windir%\system32\sysprep and then execute the command “sysprep.exe”. Here, we will be using OOBE and enabling “Generalize”, also “Shutdown” the VM once SysPrep completes.

Once the VM is SysPrep’ed, we now need to compact the VHDx (remember Hyper-V 2016 here) and also will need to convert the VHDx to a VHD. This is due to the limitation of Azure at the moment, as it only supports Gen1 VMs and VHD’s.

Go into Hyper-V and within the VM properties, edit the Virtual hard disk. Then we will need to compact the virtual hard disk. Go ahead and do that..

Great, now we need to convert the VHDx to a VHD. Time for PowerShell!

Convert-VHD –Path “<source VHDX path>" –DestinationPath "<destination VHD path>" -VHDType Fixed -Verbose


Let this run (I let it go over night.. it was getting late =) )

Great, now we are ready to move on to Azure and more PowerShell.

Build Azure Container and Upload Image to Azure

First, we need to download  and install the latest AzureRM bits module locally to the Hyper-V box (if you have done this.. jump down a few lines…)

Install-Module AzureRM -Force

Next, since there was a recent update to the AzureRm module, I now need to update the module path location.

$env:PSModulePath = $env:PSModulePath + "; C:\Program Files\WindowsPowerShell\Modules"

Next, we will need to import the AzureRm module.

Import-Module AzureRM -Force

Next, we’ll need to log-in into our Azure account, and specify the subscription to want to work with. In my case, there are multiple Azure subscriptions tied to my email.

Login-AzureRmAccount
Get-AzureRmSubscription
#select the subsciption you will be working with -- if you have one, you can skip this line
Select-AzureRmSubscription -SubscriptionId "<ID>"

Next, we will create a resource group and storage account, and bind the account the group.

New-AzureRmResourceGroup -Name "ResourceGroupName" -Location "Canada East"
New-AzureRmStorageAccount -ResourceGroupName "ResourceGroupName" -Name "StorageAccountName" -Location "Canada East" -SkuName "Standard_LRS" -Kind "Storage"

If you want to change the storage type, to let’s say Geo-redundant, here are the other types of storage:

Valid values for -SkuName are:

  • Standard_LRS – Locally redundant storage.
  • Standard_ZRS – Zone redundant storage.
  • Standard_GRS – Geo redundant storage.
  • Standard_RAGRS – Read access geo redundant storage.
  • Premium_LRS – Premium locally redundant storage.

Now, we need to create a Container and grab the URL needed to upload our image. I did this through the Azure Resource Manager (ARM) Portal since I couldn’t figure out the PowerShell cmdlet (Get-AzureStorageBlob) — if you can get this to work, please let me know!

You can get the URL from the Web UI when you go into the Storage Account >> Blobs >> Container (in my case, I called it “VHD”) >> Properties.

Now we are ready to upload our image/VHD to Azure! For me this took about 2 hours, uploading a 80GB file @ 9-10MBs.

$rgName = "ResourceGroupName"
$AzureVHDURL = "URL"
$LocalVHDPath = "LocalPathtoVHD"
Add-AzureRmVhd -ResourceGroupName $rgName -Destination $AzureVHDURL -LocalFilePath $LocalVHDPath

Great, now we just need to register the VHD disk to the Gallery, and we can begin creating machines based off our image that is now in the cloud! — Another post! 🙂

Step-by-Step – Installing System Center Virtual Machine Manager (SCVMM) 2016

Finally got some time to installing and play around with SCVMM (System Center Virtual Machine Manager) 2016 this weekend. Along with the installation and configuration, I figured to snapshot the installation and configuration. Below are the steps I have taken to get a PoC (Proof of Concept) of SCVMM installed.

For this installation, I will be installing SCVMM 2016 on Windows Server 2016 (with UI) and on a virtualized machine within a Hyper-V (2016) environment. There is no fancy storage here, so I will omit that for this configuration/blog post.

Prerequisites, you will need some service accounts:

  • SCVMM Service Account
  • SCVMM Administrator Account
  • SCVMM Administrator Group
  • SQL Service Account

You can use PowerShell to quickly create the accounts, see here:

#create scvmm service accounts
New-ADUser -Name "SCVMM_SA" -GivenName SCVMM -Surname SA -SamAccountName scvmm_sa -UserPrincipalName scvmm_sa@ravilocal.com; -AccountPassword (ConvertTo-SecureString “Passw0rd” -AsPlainText -Force) -PassThru | Enable-ADAccount
New-ADUser -Name "SCVMM_ADMIN" -GivenName SCVMM -Surname ADMIN -SamAccountName scvmm_admin -UserPrincipalName scvmm_admin@ravilocal.com; -AccountPassword (ConvertTo-SecureString “Passw0rd” -AsPlainText -Force) -PassThru | Enable-ADAccount

#create scvmm admins security group, add scvmm_sa and scvmm_admin to the group
New-ADGroup SCVMM_ADMINS -GroupScope Global -GroupCategory Security
Add-ADGroupMember SCVMM_ADMINS -Members SCVMM_SA
Add-ADGroupMember SCVMM_ADMINS -Members SCVMM_ADMIN

#create sql sa account
New-ADUser -Name "SQL_SA" -GivenName SQL -Surname SA -SamAccountName sql_sa -UserPrincipalName sql_sa@ravilocal.com -AccountPassword (ConvertTo-SecureString “Passw0rd” -AsPlainText -Force) -PassThru | Enable-ADAccount

Once you have done this, I then added the SCVMM accounts to the Local Administrators group on the server.

Next, you will need to prep you server with the Windows Automated Deployment Kit (ADK) and SQL Command Line Utilities.

Download the Windows ADK for Windows 10.

You will need to install the Deployment Tools and Windows Preinstallation Environment  (Windows PE) features.

0

Then I downloaded the SQL Server Command Line Utilities 11 along with ODBC Driver 11 for SQL Server. Both of these downloads can be found below.

Once complete, I then installed a new SQL instance on my SQL 2016 SP1 machine, called it “SCVMM16“.

After that, then I was rebooted my SCVMM server, and I was ready to start the SCVMM 2016 install.

Executing the Setup.exe as the Local Administrator

1

2

3

Connect to a SQL instance. If you need to know the SCVMM SQL requirements, go HERE.

4

Since this is a PoC, and not being prepped for a Production environment, I can go ahead and skip the Distributed Key Management, although this is required and recommended if you’re deploying in a HA/Production environment.

5

Double check the default ports are open for the install, or update the ports as needed to correspond to your environment.

6

Since this a fresh install, and I did not setup an external SAN storage, I will keep this as default, and configure later.

7

Double check and confirm the summary details before proceeding — no going back after this….

8

Once you’re ready, go ahead and hit Install. For me, the install took about 15 minutes.. Good time for a walk and fresh air. 🙂

9

 

Sweet!! Now we are ready to roll.

Next steps (I will do that next and blog soon…)

  • Configure SCVMM 2016
    • Deploy the SCVMM agent to our Hyper-V host(s)
    • Configure the Library Share/PXE
    • Configure the Fabric/Network/etc.,
  • Install Update Rollup 2 (UR2)

Until then, happy SCVMM’ing!

Step-by-Step: Setup and Configure Azure Site Recovery (ASR) with Windows Server 2016 Hyper-V using ARM

Not too long ago, Microsoft announced the support of Windows 2016 and Azure Site Recovery (ASR). Microsoft’s announcement can be found HERE.

With that said, I decided to setup ASR with my Hyper-V 2016 environment. Rather than the typical blog posts (screenshots etc.,) I decided to create a step-by-step video that demonstrates how to setup ASR with Windows Server 2016 and Hyper-V. That video can be found HERE at Channel 9.

In addition this post is a series of blog posts for Azure Site Recovery (ASR).