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

From innovaphone wiki
Jump to navigation Jump to search
m (typos)
Line 114: Line 114:
*[[#Download|Download]] the IPVA and extract the files.  
*[[#Download|Download]] the IPVA and extract the files.  
*Copy the files to the Hyper-V host machine
*Copy the files to the Hyper-V host machine
*Start-up a powershell session. Enter<code type="text">
*Start-up a powershell session. Enter(Note/hint: The Tab-key aides in path completion)<code type="text">
import-vm -Path 'C:\vms\vhd\Virtual Machines\A09F7653-BBD0-41AE-9A63-53921CE90E26.XML' -register
import-vm -Path 'C:\vms\vhd\Virtual Machines\A09F7653-BBD0-41AE-9A63-53921CE90E26.XML' -register
</code>
</code>

Revision as of 18:53, 12 April 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

More Information

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

Download

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.vmdk: The virtual boot harddisk (hd)
      • hd-cf.vmdk: The hd for emulation of a Compact Flash card
      • hd-flash.vmdk: The hd for emulation of flash memory
      • hd-dump.vmdk: 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, Hyper-V can be enabled underneath System/Programs & Features/Windows Features/.

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

Now configure an external virtual switch: 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
  • Create a new virtual switch
    • Name: Virtual Switch External
    • Description: Enter arbitrary text
    • Connection Type: Select External Network
    • Select a physical adapter from the drop-down list

Import An IPVA

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.

Windows Hyper-V 2012 Server 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.

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 managment 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-VM.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)

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"; Add-VMNetworkAdapter -VMName "$VMName" -IsLegacy $true -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 2012 commands for the powershel 2.0 is smaller and can be listed by

Get-Command -Module Hyper-V

Notes