The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • about.me

    Mikael Nystrom

    Mikael Nystrom

    OS Deployment Geek, Virtualization and System Center

    Mikael Nystrom is a Microsoft MVP and Principal Architect at TrueSec

  • Archives

  • Meta

Archive for the ‘Hyper-V’ Category

PowerShell is King – Compress, Compact, Optimize VHD and VHDX files

Posted by Mikael Nystrom on June 15, 2015

I was reading a thread at Facebook in our user group, someone was trying to compress/compact/optimize a VHD(VHDX files but the result was depressing, the amount of reclaimed space was zero and that is kind of low… Now there is a good explanation for that, when using the UI there is no way to configure it and the UI also don’t inform you that the ONLY way to get it small is to mount it in Read Only mode. It really has to be mounted, otherwise there is now way to see “inside” the disk and to get rid of all the Zero blocks. It does not hurt if you also run defrag and cleanup inside the VM before, but the most important thing is that it needs to be mounted.

The documentation for the PowerShell command says:

image

The Script:

So, to make things easy for my friends in the User Group I created a simple script that will find the disks for the VM, check if the VM is running and if not mount each file in read only mode with no drive letter, optimize the VDH and dismount it. So the output of the script looks like this when running using –verbose

image

and here is how the script looks like:

image

and you can download the script here…http://1drv.ms/1IES3pB

/mike

Posted in Hyper-V, PowerShell | Tagged: , , | 1 Comment »

Windows Server vNext – Hyper-V in Hyper-V

Posted by Mikael Nystrom on May 1, 2015

Yes, it is true

image

Continue reading the story at the source for much more information!!!

http://www.hyper-v.nu/archives/hvredevoort/2015/05/nested-hypervisor-in-windows-server-vnext/

Posted in Hyper-V, Windows Server vNext | Tagged: , | Leave a Comment »

Nice to Know – HP FlexFabric 10GB 2-port 534FLB Adapter can cause network issues using NVGRE

Posted by Mikael Nystrom on February 5, 2015

Today I was working at a customer site, setting up a NVGRE Gateway in a Fabric domain. Install, configuration, all went nice and smooth until we should test and verify that the VM’s could access the network, found a miss configuration and then, hey it was working, well TCP was working but NOT UDP, wtf??? Some troubleshooting (Google and Bing and some cursing) and it seems to be some various obscure things, some hotfixes but then we found something that actually worked…

The issue: Encapsulated Task Offloading

I’m pretty sure that the idea behind it is all good, but of course as all “great” things, it does not work in this combination.

imageimage
Here you can se the setting that needs to be disabled and you can also see the driver version and date that was in place.

The Solution: Disable it!

But, if you disable it on every hyper-v host (not only the hosts running the NVGRE gateway), it starts working. At the time we could not find any other solution then to disable it.

In this case the customer (and you know how you are) was kind enough to let me post the script that was used to disable this “amazing” technology.

image

or here in plain text form


$Nics = Get-NetAdapterAdvancedProperty -DisplayName “Encapsulated Task Offload”

foreach($Nic in $Nics)
{
Set-NetAdapterEncapsulatedPacketTaskOffload -Name $Nics.Name -EncapsulatedPacketTaskOffloadEnabled:$false
}


/Mike

Posted in Fabric, Hyper-V, SCVMM, System Center Configuration Manager 2012 R2 | Tagged: , , | Leave a Comment »

Nice to Know – Improve Bare Metal Deployment success rate in System Center Virtual Machine Manager

Posted by Mikael Nystrom on November 5, 2014

Bare Metal Deployment in SCVMM is a bit different compared to everything else, since it is using a push method. So instead of having some kind of client application controlling the deployment, the SCVMM server is controlling the OS Deployment. There could be issues, since SCVMM is building team and switches and there is a chance that SCVMM will loose connectivity to the host and the Bare Metal Deployment stops. In many case that is related to DNS and DNS cache, since that is the method used to be able to connect to the host during deployment. By decreasing the DNS cache timeout on the SCVMM server the success rate will improve very, very much.

How to fix it?

Logon to your SCVMM server and execute the following PowerShell commands to set the DNS Cache to a minimum and restart the DNS Cache services

New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" -Name "MaxCacheTtl" -Value 5 -PropertyType "DWORD" -Force
New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" -Name "MaxNegativeCacheTtl" -Value 5 -PropertyType "DWORD" -Force
Restart-Service -Name Dnscache -Force -Verbose

/mike

Posted in Hyper-V, OS Deployment, SCVMM | Tagged: , , , | Leave a Comment »

Nice to Know–Microsoft Virtual Machine Converter 3.0 released to web

Posted by Mikael Nystrom on October 13, 2014

image

Now with P2V, yes!

New Features in MVMC 3.0
The 3.0 release of MVMC adds the ability to convert a physical computer running Windows Server 2008 or above server operating systems or Windows Vista or above client operating systems to a virtual machine running on Hyper-V host.

Standard stuff is:

  • Converts virtual disks that are attached to a VMware virtual machine to virtual hard disks (VHDs) that can be uploaded to Microsoft Azure.
  • Provides native Windows PowerShell capability that enables scripting and integration into IT automation workflows.
    Note The command-line interface (CLI) in MVMC 1.0 has been replaced by Windows PowerShell in MVMC 2.0.
  • Supports conversion and provisioning of Linux-based guest operating systems from VMware hosts to Hyper-V hosts.
  • Supports conversion of offline virtual machines.
  • Supports the new virtual hard disk format (VHDX) when converting and provisioning in Hyper-V in Windows Server® 2012 R2 and Windows Server 2012.
  • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.1, and VMware vSphere 4.1 hosts Hyper-V virtual machines.
  • Supports Windows Server® 2012 R2, Windows Server® 2012, and Windows® 8 as guest operating systems that you can select for conversion.
  • Converts and deploys virtual machines from VMware hosts to Hyper-V hosts on any of the following operating systems:
  • Windows Server® 2012 R2
  • Windows Server® 2012
  • Windows Server 2008 R2 SP1
  • Converts VMware virtual machines, virtual disks, and configurations for memory, virtual processor, and other virtual computing resources from the source to Hyper-V.
  • Adds virtual network interface cards (NICs) to the converted virtual machine on Hyper-V.
  • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.0, and VMware vSphere 4.1 hosts to Hyper-V.
  • Has a wizard-driven GUI, which simplifies performing virtual machine conversions.
  • Uninstalls VMware Tools before online conversion (online only) to provide a clean way to migrate VMware-based virtual machines to Hyper-V.
    Important MVMC takes a snapshot of the virtual machine that you are converting before you uninstall VMware Tools, and then shuts down the source machine to preserve state during conversion. The virtual machine is restored to its previous state after the source disks that are attached to the virtual machine are successfully copied to the machine where the conversion process is run. At that point, the source machine in VMware can be turned on, if required.
    Important MVMC does not uninstall VMware Tools in an offline conversion. Instead, it disables VMware services, drivers, and programs only for Windows Server guest operating systems. For file conversions with Linux guest operating systems, VMware Tools are not disabled or uninstalled. We highly recommend that you manually uninstall VMware Tools when you convert an offline virtual machine.
  • Supports Windows Server and Linux guest operating system conversion. For more details, see the section “Supported Configurations for Virtual Machine Conversion” in this guide.
  • Includes Windows PowerShell capability for offline conversions of VMware-based virtual hard disks (VMDK) to a Hyper-V–based virtual hard disk file format (.vhd file).
    Note The offline disk conversion does not include driver fixes.

Posted in Hyper-V, SCVMM | Tagged: , | 1 Comment »

Nice to Know–Deploying Windows Server Technical Preview on HP Proliant Microserver Gen 8

Posted by Mikael Nystrom on October 11, 2014

I use the HP Microserver Gen 8’s at home, since they are quiet and act as a full-grown server with full iLO support, dual network adapters and then some. I can basically do all kinds of testing with new operating systems and system center management platforms without upsetting my family to much and that is very practical.

During the deployment of Windows Server Technical Preview everything worked as expected. After the installation I added the Hyper-V role to start testing to deploy VM’s. I booted up the MDT Boot image, selected the Task Sequence and the install was working great, but hey, the network performance???

According to ImageX it will take 45 minutes to lay down the image! That cannot be correct, there is something wrong here. That kind of slow performance over the network just have to be an issue.. and it is…

You need to update the network driver for the built-in network adapters in HP Proliant Microserver Gen 8.

The built in driver is a Broadcom Nextreme driver and that does not work correctly with Hyper-V

Download the HP Ethernet 1 GB 2-port 332i Adapter driver from HP and install that instead, the 45 minutes is now just 5 minutes…

image

image

Happy Deployment.
/mike

Posted in Drivers, HP, Hyper-V, Windows Server vNext | Tagged: , , , | 2 Comments »

PowerShell is King – vNext Hyper-V gets support for Network Device Naming

Posted by Mikael Nystrom on October 4, 2014

And that my friends is GREAT. Basically that means you can create a a VM Network Adapter in Hyper-V while the VM is running (also a new feature), give it a name and enable Device Naming on the VM Network Adapter and then inside the VM find the Network Adapter using PowerShell and configure it without using the Mac Address as the identification.

Create the Network Adapter:

  • Create the NIC while the VM is running (just for the fun of it) using PowerShell
    • Add-VMNetworkAdapter -VMName SRV101 -SwitchName UplinkSwitch -Name MikesNIC01 -Verbose
  • Enable Device Naming
    • Set-VMNetworkAdapter -VMName SRV101 -Name MikesNIC01 -DeviceNaming On -Verbose
  • Verify Device Naming using PowerShell, or Settings, or directly in the Hyper-V Manager
    • Get-VMNetworkAdapter -VMName SRV101 | Format-List Name, DeviceNaming

image

Log in to the VM:

Using PowerShell you can now get the network adapter name in the VM with the name gave network adapter in the parent partition.

  • Get-NetAdapterAdvancedProperty -Name * | Where-Object -FilterScript {$_.DisplayValue -LIKE “Mike*”}

You can also see this as properties in the Network Adapter.

image

Summary:

This gives us an easier way to automate the creation/configuration of VMs when it comes to handing over a task from the host to a VM when building solutions.

/mike

Posted in Hyper-V, PowerShell, Windows Server vNext | Tagged: , , | Leave a Comment »

Issue – Emulex Nic in Windows Server 2012 R2 with VMQ still does not work

Posted by Mikael Nystrom on September 3, 2014

Today, working at a customer deploying Hyper-V hosts with Emulex CNA1100 we run into issues (did not surprise me, since the issue have been around for more than a year, but I still try and test to see if it ever gets better).

The issue is that VMQ still needs to be disabled on every Emulex NIC. That bad thing is that the issue has been around for a very, very long time. It took a very long time for the vendor to acknowledge the issue and now they state that there is a solution soon to be released. I really hope that, but I have heard it before…

Read more here:

http://blogs.emulex.com/implementers/2014/06/19/microsoft-windows-20122012-r2-hyper-vms-losing-network-connectivity-workaround/

My simple recommendation is to disable VMQ in all Emulex Network adapters if they are installed in Windows Server 2012 R2 or buy something that works and use VMQ.

When they release something that actually works I will remove this blog post.

/m

Posted in Hyper-V | Tagged: | 5 Comments »

PowerShell is King – Create the “missing” VM on all the lab machines

Posted by Mikael Nystrom on July 9, 2014

Lets assume that you are running a class and suddenly someone raise the hand and say “I’m missing one of the VMs…” That is far from god, but wait a minute, what about PowerShell to the rescue?, of course, so here it is:

image

Code snip below:


$servers = 1..21 | ForEach-Object {
“VIAMONSTRA{0:D3}” -f $_
}

foreach ($Server in $Servers)
{
Invoke-Command -ComputerName $Server -ScriptBlock {
HostName
$VMName = “FS01″
$VMMemory = 2048MB
$VMDiskSize = 60GB
$VMNetwork = “Internal”
$VMLocation = “C:\VMs”
New-VM -Name $VMName -Generation 2 -MemoryStartupBytes $VMMemory -SwitchName $VMNetwork -Path $VMLocation -NoVHD | Out-Null
New-VHD -Path “$VMLocation\$VMName\Virtual Hard Disks\$VMName-Disk1.vhdx” -SizeBytes $VMDiskSize | Out-Null
Add-VMHardDiskDrive -VMName $VMName -Path “$VMLocation\$VMName\Virtual Hard Disks\$VMName-Disk1.vhdx” | Out-Null
}
}

 


Posted in Hyper-V, PowerShell | Tagged: , , | Leave a Comment »

Nice to Know–After a long time, Emulex now finally admit that there is an issue in the firmware and help is soon to appear

Posted by Mikael Nystrom on June 22, 2014

The combo of Hyper-V, VMQ, Emulex and lost network connectivity has been a nightmare for a long time. We have tried it all and the ONLY solution that works has been to disable VMQ, which sucks. Just a couple of days ago Emulex posted a note where they state that “some customers” (that is BS!) have reported loss of network connectivity. But there is light in the tunnel, they are working on new firmware so stay tuned for that. The new firmware is about to released mid-July 2014.

You should read the entire story and you can do that here:

http://blogs.emulex.com/implementers/2014/06/19/microsoft-windows-20122012-r2-hyper-vms-losing-network-connectivity-workaround/

/mike

Posted in Emulex, Hyper-V, VMQ, Windows Server 2012 R2 | Tagged: , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 5,296 other followers