Reference12r2:Concept IPVA On Hyper-V: Difference between revisions

From innovaphone wiki
Jump to navigation Jump to search
Line 36: Line 36:
*Right-Click Hyper-V-Manager/<Local Machine>/
*Right-Click Hyper-V-Manager/<Local Machine>/
*Select ''Manager for virtual switches'' or ''Virtual Switch Manager...''
*Select ''Manager for virtual switches'' or ''Virtual Switch Manager...''
*Create a new virtual switch
*Create a new virtual switch via the ''Create Virtual Switch''-button
**Name: ''Virtual Switch External''
**Name: ''Virtual Switch External''
**Description: Enter arbitrary text
**Description or Note: Enter arbitrary text
**Connection Type: Select ''External Network''
**Connection Type: Select ''External Network''
**Select a physical adapter from the drop-down list
**Select a physical adapter from the drop-down list

Revision as of 12:51, 4 November 2016

Applies To

Tools clipart.png FIXME: This is preliminary content and subject of change

This information applies to

  • IPVA
  • Firmware Version 12r2
  • Microsoft Hyper-V
    • Hyper-V on Windows 8.1
    • Hyper-V on Windows 10
    • Hyper-V Server 2012 R2
    • Hyper-V Server 2016 CTP4

More Information

This article explains deployment of the IPVA for the Hyper-V family of Microsoft virtualizer products.

Download

Tools clipart.png FIXME: For 12r2 builds either contact TechServ or watch out within the 'unofficial builds' download section

Download the IPVA.

  • The compressed archive ipva-vhd.zip contains 2 subdirectories:
    • Virtual Machines This directory contains the manifest file (configuration/meta data) of the virtual machine
    • Virtual Hard Disks This directory contains 4 files representing the 4 IDE disks of the virtual machine
      • hd-boot.vhd: The virtual boot harddisk (hd)
      • hd-cf.vhd: The hd for emulation of a Compact Flash card
      • hd-flash.vhd: The hd for emulation of flash memory
      • hd-dump.vhd: The hd serving as a store for a crash dump

Hyper-V on Windows Client Machines

From on Windows 8 up to now Windows 10 (Pro), Hyper-V can be enabled underneath System/Programs & Features/Windows Features/.

  • There, activate the Hyper-V checkmark(s).
  • Reboot

Create The Virtual Switch

Now a virtual switch of the type external needs to be created. The IPVA's manifest file configures a network adapter that instructs Hyper-V to bind that adapter on a virtual switch named Virtual Switch External.

  • Start Start/Programs/Windows Management Tools/Hyper-V-Manager.
    • The Hyper-V Manager Application is going to start up.
  • Right-Click Hyper-V-Manager/<Local Machine>/
  • Select Manager for virtual switches or Virtual Switch Manager...
  • Create a new virtual switch via the Create Virtual Switch-button
    • Name: Virtual Switch External
    • Description or Note: Enter arbitrary text
    • Connection Type: Select External Network
    • Select a physical adapter from the drop-down list

Networking Implications For The Windows Host

The creation of the Virtual Switch External alters the networking adapter configuration of the windows host.

  • The old network adapter Ethernet remains, however its property/network checkmarks will all be disabled, except for Hyper-V Extensible Virtual Switch.
  • A completely new network adapter vEthernet (Virtual Switch External) will be created. All previously enabled checkmarks from the Ethernet adapter will also be enabled. The checkmark Hyper-V Extensible Virtual Switch will be disabled.
  • The windows host is going to be communicating over the new adapter vEthernet (Virtual Switch External).
  • During the configuration changes take effect, a Yes/No-Box is likely to be displayed

Apply Networking Changes -- Pending changes may disrupt network connectivity. This computer may lose its network connection while the changes are applied. This may affect any network operations in progress. These changes also may overwrite some static changes. If that happens you must reapply the static changes to restore network connectivity..

Import An IPVA

The import is the easiest procedure for guest creation. Download the IPVA and extract the files.

  • Start Start/Programs/Windows Management Tools/Hyper-V-Manager.
  • Right-Click Hyper-V-Manager/<Local Machine>/
  • Select Import Virtual Machine
  • Browse to the directory where the downloaded package was extracted to. Browse to the subdirectory Virtual Machines and click Ok.
  • Select an Import Type. A Direct Registration means to import the virtual machine in-place. I.e. the files will remain at their location.
  • Finish the import.
    • The newly imported IPVA appears within the Virtual Computer list of the local machine.

Create An IPVA Guest From Scratch

An IPVA guest can be created manually from scratch by means of the 4 *.vhd disk following the given recipe:

  • Add a new virtual machine
    • Right-Click Hyper-V-Manager/<Local Machine>.
    • Select New/Virtual Computer.
    • Enter a Name and the storage path for the virtual machine.
    • As Generation select Generation 1
    • Assign the desired amount of RAM. 64MB suffice as minimum.
    • Configure the network. Select the Virtual Switch External created earlier.
    • Connect virtual harddisk. Select Connect virtual harddisk later.
    • Click Finish
  • Remove unneeded components
    • Right-Click the newly created entry in the list entitled Virtual Computer.
    • Select Settings
    • Remove the DVD Drive
    • Remove the Network Adapter
    • Click Apply
  • Connect the harddisks
    • Click IDE Controller 0/Add/Harddisk.
    • Browse to hd-boot.vhd
    • Click IDE Controller 0/Add/Harddisk.
    • Browse to hd-cf.vhd
    • Click IDE Controller 1/Add/Harddisk.
    • Browse to hd-flash.vhd
    • Click IDE Controller 1/Add/Harddisk.
    • Browse to hd-dump.vhd
  • Connect the Network Adapter
    • Click Add Hardware
    • Select Network Adapter
    • As Virtual Switch select Virtual Switch External created earlier.
  • Assign the boot medium
    • Click BIOS/Boot Sequence
    • Move-up IDE to the very front
  • Click Ok
Hyper-V-Manager, Manual creation of an IPVA guest

Windows Hyper-V Server 2012 R2 (Core Installation)

This free product lacks a GUI. Instead, Microsoft offers RSAT, the Remote Server Administration Tools. The RSAT do also contain a Hyper-V-Manager, however it practically appeared impossible to prepare a proper versioned client machine, in order to get the RSAT-stack working. The Hyper-V core server comes with a minimal setup console and an administrator command line, targeting the Hyper-V administration by means of Windows powershell commands (Hyper-V CmdLets). This section focusses on this latter administration means.

Hyper-V 2012 R2, Administrator Console & Sconfig

Sconfig

Sconfig addresses the textual menu with the blue background color.

  • Option 1): If unsure, the server may simply be left as member in the regular WORKGROUP
  • Option 2): Configure the NetBIOS computer name (<NBNAME>).
  • Option 4): Enable Remote Management.
  • Option 7): Enable Remote Desktop (RDP) for all client versions.

Firewall

There are specific management steps necessary to even allow for RDP. Although not recommended a quick disabling of the firewall avoids warm-up troubles

  • To disable the firewall:
    • Click into the Administrator command line console.
    • Enter powershell and confirm. Enter

netsh advfirewall set allprofiles state off

Remote Desktop(RDP)

Now it is possible to setup a Remote Desktop Session to the Hyper-V server.

  • Login as administrator or <NBNAME>\administrator

In order to move files from/to the Hyper-V server

  • A network mount of the server's c-drive may be established:
    • On the client machine place a command within a command line window

net use * \\<IP of Hyper-V server>\c$ /u:<NBNAME>\administrator

  • Or the client machines c-drive may be projected into the RDP-session
    • Connection Settings/Options/Local Ressources/Further../Local Drive

Create The Virtual Switch

As above a virtual switch named Virtual Switch External is required and must be bound on a physical network adapter.

  • The physical adapters can be listed by means of a regular ipconfig /all
  • Create and edit a powershell script named create-switch.ps1
  1. Create-Switch.ps1:
  2. Example
  3. PS C:\vms> .\create-switch.ps1
  4. Supply values for the following parameters:
  5. PhysAdapterName: Ethernet 2
  6. Creating virtual switch 'Virtual Switch External' on physical Adapter Ethernet 2
  7. Name SwitchType NetAdapterInterfaceDescription
  8. ---- ---------- ------------------------------
  9. Virtual Switch External External Intel(R) Ethernet Connection I217-LM

param( [Parameter(Mandatory=$true)] [string]$PhysAdapterName )


$VirtualSwitchName = "Virtual Switch External" echo "Creating virtual switch '$VirtualSwitchName' on physical Adapter $PhysAdapterName"; New-VMSwitch -Name "$VirtualSwitchName" -NetAdapterName "$PhysAdapterName"

  • Invoke the script from within a powershell session by means of .\create-switch.ps1
  • The script will ask for the name of the physical network adapter.
  • It is assumed the name be Ethernet 2. So, enter

Ethernet 2

  • Or invoke the script with

.\create-switch.ps1 -PhysAdapterName "Ethernet 2"

Import An IPVA

It is assumed the downloaded files reside underneath c:\vms as c:\vms\vhd\Virtual Machines, c:\vms\vhd\Virtual Hard Disks.

  • Download the IPVA and extract the files.
  • Copy the files to the Hyper-V host machine
  • Start-up a powershell session. Enter(Note/hint: The Tab-key aides in path completion towards the xml-file )

import-vm -Path 'C:\vms\vhd\Virtual Machines\A09F7653-BBD0-41AE-9A63-53921CE90E26.XML' -register

  • The output may look like

Name State CPUUsage(%) MemoryAssigned(M) Uptime Status


----- ----------- ----------------- ------ ------

IPVA-VHD Off 0 0 00:00:00 Operating normally This method imports the guest machine without altering file locations.

Create An IPVA Guest From Scratch

An IPVA guest can be created by means of the 4 *.vhd Disk Files. It is assumed the 4 disk files reside as c:\vms\ipva01\hd-boot.vhd, c:\vms\ipva01\hd-cf.vhd,...

  • Create and edit a powershell script named create-vm.ps1
  1. Create-VM.ps1:
  2. Example: powershell /ExecutionPolicy Unrestricted .\create.vm.ps1 -VMName 'ipva01' -RootDir 'c:\vms'"
  3. will create a vm 'ipva01' in the directory 'c:\vms\ipva01'

param( [Parameter(Mandatory=$true)] [string]$VMName, [Parameter(Mandatory=$true)] [string]$RootDir )

echo "Creating $VMName in directory $RootDir";

New-VM -VMName "$VMName" -Generation 1 -MemoryStartupBytes 67108864 -BootDevice IDE -Path "$RootDir/$VMName"; Remove-VMNetworkAdapter -VMName "$VMName" Add-VMNetworkAdapter -VMName "$VMName" -DynamicMacAddress -SwitchName 'Virtual Switch External'; Remove-VMScsiController -VMName "$VMName" -ControllerNumber 0 Remove-VMDvDDrive -VMName "$VMName" -ControllerNumber 1 -ControllerLocation 0; Add-VMHardDiskDrive -VMName "$VMName" -ControllerType IDE -ControllerNumber 0 -ControllerLocation 0 -Path "$RootDir/$VMName/hd-boot.vhd"; Add-VMHardDiskDrive -VMName "$VMName" -ControllerType IDE -ControllerNumber 0 -ControllerLocation 1 -Path "$RootDir/$VMName/hd-cf.vhd"; Add-VMHardDiskDrive -VMName "$VMName" -ControllerType IDE -ControllerNumber 1 -ControllerLocation 0 -Path "$RootDir/$VMName/hd-flash.vhd"; Add-VMHardDiskDrive -VMName "$VMName" -ControllerType IDE -ControllerNumber 1 -ControllerLocation 1 -Path "$RootDir/$VMName/hd-dump.vhd";

  • Invoke the script by means of

.\create.vm.ps1 -VMName "ipva01" -RootDir "c:\vms"

Starting An IPVA

Within a powershell session

  • enter

start-vm ipva01

  • or

start-vm -vmname ipva01

Further Hyper-V CmdLet Commands

See [1]. That documentation addresses the latest CmdLets. The set of Hyper-V Server 2012 commands for the powershell 2.0 is smaller and can be listed by

Get-Command -Module Hyper-V

Increase Amount of RAM

Set RAM to 512MB for a guest ipva01

Stop-Vm ipva01 Set-VMMemory -vmname ipva01 -StartupBytes 536870912 Start-Vm ipva01

Windows Hyper-V Server 2016 (Core Installation)

The powershell instructions from above Windows Hyper-V Server 2012 R2(Core_Installation) are generally applicable for the Hyper-V 2016 server.

Activating The Hyper-V Role

The Hyper-V role wasn't enabled after installation.

  • To install the Hyper-V server role including the powershell CmdLets, enter from a powershell command line

Install-WindowsFeature Hyper-V -IncludeManagementTools


Known Issues

Windows Host Cannot Access IPVA Guest

The IPVA guest machine may not be network-accessible from the host machine executing the hypervisor. In contrast, the guest is accessible from other hosts.

  • The cause might be that a 'Legacy Network Adapter'[2] was configured instead of a 'Network Adapter'.
    • Ensure a regular 'Network Adapter' provides connectivity
  • VMware Player/Workstation interferes
    • Ensure the Windows host machine solely runs Hyper-V. Uninstall any VMware Player/Workstation product.

Hyper-V and VMware Cannot Co-Exist

Hyper-V and VMware are mutually exclusive. Either Hyper-V or VMware can be run on a single windows host machine. Do not try to install both hypervisor products. E.g. a VMware Player installation may complain: VMware Player and Hyper-V are not compatible. Remove the Hyper-V role from the system before running VMware Player.

Hyper-V & VMware Player are incompatible

Notes

  1. Hyper-V Cmdlets: https://technet.microsoft.com/de-de/library/hh848559.aspx
  2. Legacy Network Adapter => deutsch: Ältere Netzwerkkarte