How to migrate Windows Server 2012 R2 Hyper-v to 2016

We are ready to make the jump from Windows Server 2012 HYPER-V to 2016? I think it's the right time. Windows Server 2016 has new features that can use ,and improvements from Windows Server 2012 

We can use multiple ways to make the move. The most important is first to design and write in your paper how can proceed with the upgrade to avoid downtime of your production environment.

Today i will describe how can upgrade a single Windows Server 2012 HYPER-V to 2016. 

Unfortunately the only way to do the migration is after working hours because you can avoid the downtime.

But this article can follow step by step to avoid problems, reduce downtime and your time that need for the migration

How to upgrade Windows Server 2012 R2 OS to 2016

It's very very important before start the migration of the OS to follow some steps

  1. Keep notes if you don't have documentation of your HYPER-V Server configuration like:
    • Virtual Switches.
    • Network interfaces that mapped in Virtual Switches.
    • Ip Addresses of Network Interfaces.
    • Name of Network Interfaces if you have change it.
    • Virtual Network Interfaces
    • VLAN that apply in every Network Interface
    • Any other configuration that maybe has apply in your HYPER-V Server
    •  
  2. Prepare the Virtual Machines
    • Backup all your Virtual Machines
    • Be sure that all the Virtual Machines included in separated Disk of the OS Disk (C:)
    • Shutdown all the Virtual Machines
    • Delete any checkpoint from Virtual Machines
    •  
  3. Do a clean installation of Windows Server 2016. Don't proceed with in-place upgrade of your OS. It's very important to know that the backbone of your Virtual Machines it's clean without old configuration that maybe cause problems in the future.

 

How to prepare Windows Server 2016 after finish the upgrade

After the installation of Windows Server 2016 finish successful it's time to start build from the scratch all the configuration that can give us a healthy HYPER-V Host.

  • Proceed with all Windows Updates for Windows Server 2016
  • Configure ip addresses of your Network Interfaces.
  • Join the Server in your Domain
  • Install the Hyper-v Role
    • If you like the GUI you can open the Article How to install HYPER-V - Part 1 which explain step by step how to install the HYPER-V Role.
    • From powershell you can write the following command to install HYPER-V Role and Management Tools
      Install-WindowsFeature -Name Hyper-V -ComputerName HOSTNAME -IncludeManagementTools -Restart
  • Configure Iscsi Connections or any configuration related with your Storage that keep the Virtual Machines.
  • If you use Iscsi then after finish the the Iscsi Configuration you can get Online the Disk from GUI or Powershell
    • From GUI right click in Start - - -Disk Management
    • Find the new Disk. Right click and select Online.

 

 

  • From Powershell you can run the following commands to get Online the new Disk
  • Type get-Disk to view all the Disks. The Disk with status Offline it's the disk that you want to get Online
    get-disk

 

  • Identify the Number of the new Disk and run the following commands to get Online the Disk. Just replace the number with the number of the disk that identify in your system
    Set-Disk -Number 1 -IsOffline $false
    Set-Disk -Number 1 -Isreadonly $false
  • Type again get-disk and you can see now that is Online

 

  • Configure Virtual Switches of your HYPER-V
    • From GUI you can open the article How to install the first Virtual Machine in HYPER-V - Part 3 which explain step by step how to configure the Virtual Switch in HYPER-V.
    • From Powershell you can type the following command to create a new Virtual Switch. 
    • Note that the Virtual Switch must has the same Name with the Virtual Switch in Windows Server 2012.
    • Also the -AllowManagementOS must be set to $false only if you have second Network Interface for the Virtual Machines. Unless must be set to $true
      New-VMSwitch -Name 'New Virtual Switch' -NetAdapterName 'VM' -AllowManagementOS $false

 

  • Import Virtual Machines in new HYPER-V
    • Now it's time to start import all the Virtual Machines in the new HYPER-V Host.
    • From GUI you can read the article Export & Import Virtual Machine in HYPER-V which explain step by step how can import a Virtual Machine. Because the Virtual Machine will be in same place use the Import Type Register​​
  • Upgrade Configuration Version
    • After finish with the import of the Virtual Machines you must upgrade the Configuration Version of every Virtual Machine to enable the new features in Windows Server 2016 HYPER-V.
      • Hot-Add and Hot-Remove of memory and network adapters
      • Production Checkpoints/Disable Checkpoints
      • Key Storage Drive (Gen 1)
      • Shielded VM (Gen 2)
      • Virtual Trust Platform Module (vTPM) (Gen 2)
      • Linux Secure Boot
      • PowerShell Direct
    • If you need more details i found a very interesting article HYPER-V VM CONFIGURATION VERSION SUPPORTED FEATURES from Thomas Maurer that describe the new features base on the Configuration Version.
    • The Configuration Number is available only in Windows Server 2016. When import the VM from Windows Server 2012 HYPER-V the Configuration Version is 5.0.
    • From  HYPER-V Manager you can see the Configuration Version.
    • Select the VM.
    • Right Click and select Upgrade Configuration Version

 

  • Click Yes in the Warning

 

  • As you can see now the Configuration Version Number change to 8.0
  • From Powershell you can run the following command to update the Configuration Version in every VM. Change the Name with the Name of your Virtual Machine
    Update-VMVersion -Name DC1

 

  • After finish you can type from powershell the following command to see that the Configuration Version Number is 8.0 instead of 5.0
    get-vm

 

That's it. With the above steps you can avoid a lot of issues that increase the time that you need to finish the migration.

Remember that it's a single HYPER-V and must be ready as soon as possible.

I invite you to follow me on Twitter , Google+ or Facebook. If you have any questions, send email to me at info@askme4tech.com.

Have a nice weekend!!