Deploying Hyper-V with Routing O R A C L E W H I T E P A P E R M A R C H

Similar documents
Veritas NetBackup and Oracle Cloud Infrastructure Object Storage ORACLE HOW TO GUIDE FEBRUARY 2018

Deploy VPN IPSec Tunnels on Oracle Cloud Infrastructure. White Paper September 2017 Version 1.0

Oracle Cloud Infrastructure Virtual Cloud Network Overview and Deployment Guide ORACLE WHITEPAPER JANUARY 2018 VERSION 1.0

Creating Custom Project Administrator Role to Review Project Performance and Analyze KPI Categories

Oracle CIoud Infrastructure Load Balancing Connectivity with Ravello O R A C L E W H I T E P A P E R M A R C H

Generate Invoice and Revenue for Labor Transactions Based on Rates Defined for Project and Task

Tutorial on How to Publish an OCI Image Listing

Establishing secure connectivity between Oracle Ravello and Oracle Cloud Infrastructure Database Cloud ORACLE WHITE PAPER DECEMBER 2017

Achieving High Availability with Oracle Cloud Infrastructure Ravello Service O R A C L E W H I T E P A P E R J U N E

Establishing secure connections between Oracle Ravello and Oracle Database Cloud O R A C L E W H I T E P A P E R N O V E M E B E R

Load Project Organizations Using HCM Data Loader O R A C L E P P M C L O U D S E R V I C E S S O L U T I O N O V E R V I E W A U G U S T 2018

Bastion Hosts. Protected Access for Virtual Cloud Networks O R A C L E W H I T E P A P E R F E B R U A R Y

April Understanding Federated Single Sign-On (SSO) Process

Oracle Cloud Applications. Oracle Transactional Business Intelligence BI Catalog Folder Management. Release 11+

JD Edwards EnterpriseOne Licensing

Deploying Custom Operating System Images on Oracle Cloud Infrastructure O R A C L E W H I T E P A P E R M A Y

Cloud Operations for Oracle Cloud Machine ORACLE WHITE PAPER MARCH 2017

RAC Database on Oracle Ravello Cloud Service O R A C L E W H I T E P A P E R A U G U S T 2017

Installation Instructions: Oracle XML DB XFILES Demonstration. An Oracle White Paper: November 2011

Oracle Secure Backup. Getting Started. with Cloud Storage Devices O R A C L E W H I T E P A P E R F E B R U A R Y

Siebel CRM Applications on Oracle Ravello Cloud Service ORACLE WHITE PAPER AUGUST 2017

Migrating VMs from VMware vsphere to Oracle Private Cloud Appliance O R A C L E W H I T E P A P E R O C T O B E R

Correction Documents for Poland

August 6, Oracle APEX Statement of Direction

Oracle Data Provider for.net Microsoft.NET Core and Entity Framework Core O R A C L E S T A T E M E N T O F D I R E C T I O N F E B R U A R Y

Oracle Fusion Configurator

Oracle DIVArchive Storage Plan Manager

Automatic Receipts Reversal Processing

Loading User Update Requests Using HCM Data Loader

Pricing Cloud: Upgrading to R13 - Manual Price Adjustments from the R11/R12 Price Override Solution O R A C L E W H I T E P A P E R A P R I L

An Oracle White Paper November Primavera Unifier Integration Overview: A Web Services Integration Approach

Configuring Oracle Business Intelligence Enterprise Edition to Support Teradata Database Query Banding

WebCenter Portal Task Flow Customization in 12c O R A C L E W H I T E P A P E R J U N E

Best Practice Guide for Implementing VMware vcenter Site Recovery Manager 4.x with Oracle ZFS Storage Appliance

Oracle Service Registry - Oracle Enterprise Gateway Integration Guide

An Oracle White Paper December, 3 rd Oracle Metadata Management v New Features Overview

Using Oracle In-Memory Advisor with JD Edwards EnterpriseOne

StarWind Virtual SAN Hyperconverged 2-Node Scenario with Hyper-V Server 2016

NOSQL DATABASE CLOUD SERVICE. Flexible Data Models. Zero Administration. Automatic Scaling.

Using the Oracle Business Intelligence Publisher Memory Guard Features. August 2013

Oracle Communications Interactive Session Recorder and Broadsoft Broadworks Interoperability Testing. Technical Application Note

An Oracle White Paper October The New Oracle Enterprise Manager Database Control 11g Release 2 Now Managing Oracle Clusterware

Leverage the Oracle Data Integration Platform Inside Azure and Amazon Cloud

Oracle WebLogic Portal O R A C L E S T A T EM EN T O F D I R E C T IO N F E B R U A R Y 2016

October Oracle Application Express Statement of Direction

Hard Partitioning with Oracle VM Server for SPARC O R A C L E W H I T E P A P E R J U L Y

Handling Memory Ordering in Multithreaded Applications with Oracle Solaris Studio 12 Update 2: Part 2, Memory Barriers and Memory Fences

Transitioning from Oracle Directory Server Enterprise Edition to Oracle Unified Directory

Migration Best Practices for Oracle Access Manager 10gR3 deployments O R A C L E W H I T E P A P E R M A R C H 2015

Oracle Data Masking and Subsetting

Creating Active Directory Domain Services in Oracle Cloud Infrastructure

Deploying Apache Cassandra on Oracle Cloud Infrastructure Quick Start White Paper October 2016 Version 1.0

Cisco vwlc on Microsoft Hyper-V Deployment Guide

CONTAINER CLOUD SERVICE. Managing Containers Easily on Oracle Public Cloud

VISUAL APPLICATION CREATION AND PUBLISHING FOR ANYONE

Extreme Performance Platform for Real-Time Streaming Analytics

Oracle VM 3: IMPLEMENTING ORACLE VM DR USING SITE GUARD O R A C L E W H I T E P A P E R S E P T E M B E R S N

Benefits of an Exclusive Multimaster Deployment of Oracle Directory Server Enterprise Edition

Oracle Clusterware 18c Technical Overview O R A C L E W H I T E P A P E R F E B R U A R Y

An Oracle White Paper October Deploying and Developing Oracle Application Express with Oracle Database 12c

Working with Time Zones in Oracle Business Intelligence Publisher ORACLE WHITE PAPER JULY 2014

How to Monitor Oracle Private Cloud Appliance with Oracle Enterprise Manager 13c O R A C L E W H I T E P A P E R J U L Y

An Oracle White Paper September Security and the Oracle Database Cloud Service

Oracle Exadata Statement of Direction NOVEMBER 2017

Integrating Oracle SuperCluster Engineered Systems with a Data Center s 1 GbE and 10 GbE Networks Using Oracle Switch ES1-24

PeopleSoft Fluid Navigation Standards

Best Practices for Deploying High Availability Architecture on Oracle Cloud Infrastructure

Technical White Paper August Recovering from Catastrophic Failures Using Data Replicator Software for Data Replication

An Oracle Technical Article March Certification with Oracle Linux 4

Oracle JD Edwards EnterpriseOne Object Usage Tracking Performance Characterization Using JD Edwards EnterpriseOne Object Usage Tracking

ORACLE FABRIC MANAGER

SonicMQ - Oracle Enterprise Gateway Integration Guide


Subledger Accounting Reporting Journals Reports

Dell EMC Ready Solutions for Microsoft WSSD QuickStart Configurations for ROBO and Edge Environments. Integration and Deployment Guidance

Oracle Financial Services Regulatory Reporting for US Federal Reserve Lombard Risk Integration Pack

Oracle Business Activity Monitoring 12c Best Practices ORACLE WHITE PAPER DECEMBER 2015

Oracle Enterprise Manager for Exadata Cloud

DATA INTEGRATION PLATFORM CLOUD. Experience Powerful Data Integration in the Cloud

Oracle Linux Management with Oracle Enterprise Manager 13c O R A C L E W H I T E P A P E R J U L Y

Oracle Virtual Directory 11g Oracle Enterprise Gateway Integration Guide

Corente Cloud Services Exchange

Oracle Service Cloud Agent Browser UI. November What s New

BraindumpsIT. BraindumpsIT - IT Certification Company provides Braindumps pdf!

Application Container Cloud

Sun Fire X4170 M2 Server Frequently Asked Questions

StorageTek ACSLS Manager Software Overview and Frequently Asked Questions

Technical Upgrade Guidance SEA->SIA migration

Oracle Grid Infrastructure 12c Release 2 Cluster Domains O R A C L E W H I T E P A P E R N O V E M B E R

Installing Oracle WebCenter Sites on Oracle Java Cloud Service

SOA Cloud Service Automatic Service Migration

Increasing Network Agility through Intelligent Orchestration

Oracle JD Edwards EnterpriseOne Object Usage Tracking Performance Characterization Using JD Edwards EnterpriseOne Object Usage Tracking

Oracle NoSQL Database For Time Series Data O R A C L E W H I T E P A P E R D E C E M B E R

An Oracle White Paper October Minimizing Planned Downtime of SAP Systems with the Virtualization Technologies in Oracle Solaris 10

Oracle Access Manager 10g - Oracle Enterprise Gateway Integration Guide

MySQL CLOUD SERVICE. Propel Innovation and Time-to-Market

Repairing the Broken State of Data Protection

TABLE OF CONTENTS DOCUMENT HISTORY 3


Transcription:

Deploying Hyper-V with Routing O R A C L E W H I T E P A P E R M A R C H 2 0 1 8

Disclaimer The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle. You can find the most recent versions of the Oracle Cloud Infrastructure white papers at https://docs.us-phoenix-1.oraclecloud.com/content/general/reference/aqswhitepapers.htm. 2 DEPLOYING HYPER-V WITH ROUTING

Table of Contents Overview 4 Prerequisites 5 Set Up the Oracle Cloud Infrastructure VCN and Deploy the Bare Metal Instance for Hyper-V 6 Configure Windows Server, Hyper-V, and Supporting Network Services 8 Install Hyper-V 8 Configure Hyper-V 11 Configure DNS and DHCP for Hyper-V Guests 13 Create the Initial Hyper-V Guests 16 Install and Configure Windows for hvnat and hvrouter Hyper-V guests 20 Configure the hvnat Guest 20 Configure the hvrouter Guest 23 Installing Guests 24 Enabling Connections Between Guests on Different Hyper-V Servers 25 Summary 26 3 DEPLOYING HYPER-V WITH ROUTING

Overview The original method for deploying Hyper-V was to map each secondary virtual network interface card (VNIC) to a single guest instance, similar to what was done originally with KVM. However, with the introduction of the Route to IP Target functionality within Oracle Cloud Infrastructure, it is possible to deploy Hyper-V by using a routed interface. This method not only simplifies the deployment of guests, but also allows you to deploy however many guests that will run and practically fit within a single bare metal instance. These guests now have access to the full range of Oracle Cloud Infrastructure services and are supported by the options given to Oracle Cloud Infrastructure virtual cloud networks (VCNs). The following diagram illustrates the endpoint architecture of the Hyper-V environment: The architecture has the following elements: A VCN with an CIDR of 10.50.0.0/24 A subnet within the VCN with an CIDR of 10.50.0.0/26 A bare metal Compute instance running Windows Server, Hyper-V, and supporting Networking services An internet gateway, security list, and route table that support the VCN Representative resources on the subnet that the guests within Hyper-V can access 4 DEPLOYING HYPER-V WITH ROUTING

The bare metal instance running Hyper-V has the following elements: An external vswitch with single root I/O virtualization (SR-IOV) enabled An internal vswitch for the guests Two special-purpose Hyper-V guests to act as routers for the internal guests A DHCP server on Windows Server, bound to the internal vswitch, providing address/network information to the Hyper-V guests A DNS server on Windows Server, bound to the internal vswitch, providing name resolution services to the Hyper-V guests A combination of services provided by Oracle Cloud Infrastructure and services provided by Windows Server and Hyper-V are used to create an environment that seamlessly gives guests running on Hyper-V the ability to interact with instances and services provided by Oracle Cloud Infrastructure, and gives guests running on Oracle Cloud Infrastructure the ability to interact with instances and services provided by Hyper-V. This white paper describes how to set up both the Oracle Cloud Infrastructure and Hyper-V environments to achieve the architecture outlined here. Note: This procedure was tested with both Windows Server 2012 R2 and Windows 2016 Datacenter. The instructions use Windows Server 2012 R2; for Windows 2016 Datacenter, substitute Windows 2016 for Windows 2012 R2. Prerequisites Before you begin, have the following items ready: Select an IP range, not part of the VCN IP range, that you want to use for the internal Hyper-V network. Identify the first three addresses of the IP range for use by Hyper-V: o o o Default gateway (NAT) VCN gateway (router) DNS/DHCP Have at least one public subnet available. If you want your guests to connect to the internet, the secondary VNICs used for routing must be on a public subnet. Get a copy of the device drivers for the X7 Broadcom network cards. Also include the Hyper-V driver for the card. This will be used only for the hvnat and hvrouter guest instances configured in this paper. 5 DEPLOYING HYPER-V WITH ROUTING

Set Up the Oracle Cloud Infrastructure VCN and Deploy the Bare Metal Instance for Hyper-V 1. Create a V2 (BM 2.x type) bare metal instance, and attach at least one block storage volume to it. For instructions, see the following topics: Deploying bare metal instances: https://docs.us-phoenix- 1.oraclecloud.com/Content/Compute/Tasks/launchinginstance.htm Deploying block storage volumes: https://docs.us-phoenix- 1.oraclecloud.com/Content/Block/Concepts/overview.htm 2. After the instance is provisioned, provision a VNIC for the secondary NIC (NIC 1) on the bare metal instance. For instructions on how to deploy secondary VNICs, see https://docs.us-phoenix-1.oraclecloud.com/content/network/tasks/managingvnics.htm. Do not select the Skip Source/Destination Check option. This VNIC should be on the public subnet; however, you do not need to assign a public IP address to this interface. We recommend that you manually assign the private IP address, but it is not required. Note the IP address of the NIC. 3. Create two secondary VNICs for the secondary NIC (NIC 1). 6 DEPLOYING HYPER-V WITH ROUTING

Be sure to select the Skip Source/Destination Check option for both VNICs created in this step. The VNICs created here should be on a public subnet to allow access to the internet by the guests; public IP addresses should be assigned to these interfaces. We recommend that you manually assign the private IP addresses, but it is not required. Make note of the MAC and private IP addresses, and the VLAN ID of these secondary VNICs. 4. Select one of the secondary VNICs as the route target, and note the IP address of the selected target. 5. Open the route table of the VCN where the Hyper-V server is being configured, and add a route rule. Enter the private IP address that you just selected as the route target for the IP address range selected for the Hyper-V deployment. For example, 192.168.11.0/24 was selected as the address space for Hyper-V. A secondary VNIC on the Hyper-V server was selected with IP address of 10.50.0.69. The resulting route table entry would look as follows: For information about managing route tables, see https://docs.us-phoenix- 1.oraclecloud.com/Content/Network/Tasks/managingroutetables.htm. 6. Open the security list for the subnet. If you have configured a global security list for the VCN, consider using that security list instead. 7. Add an entry that allows traffic from the Hyper-V internal network to be accepted by instances within the VCN. For example, if the VCN has a global security list that covers the entire VCN, the entry added to the global security list would look as follows: For information about how to manage and update security lists, see https://docs.usphoenix-1.oraclecloud.com/content/network/concepts/securitylists.htm. 7 DEPLOYING HYPER-V WITH ROUTING

Configure Windows Server, Hyper-V, and Supporting Network Services This section provides instructions for installing and configuring Hyper-V, configuring DNS and DHCP for Hyper-V guests, creating the initial Hyper-V guests, and installing and configuring Windows for the Hyper-V guests. Install Hyper-V 1. Log in to the provisioned Windows bare metal instance. 2. Configure the second NIC with the IP address information. Set the default gateway to the one identified for the subnet, and set the DNS server to 169.254.169.254. 3. In Windows Firewall, enable ICMP for the bare metal instance. The firewall rule for ICMP is labeled File and Printer Sharing (Echo Request - ICMPv4-In). 4. Verify that both interface IP addresses are visible on the subnet. You can do this by logging in to another system on the subnet and pinging the IP address of each NIC. 5. Mount and format the block volume on the bare metal instance. 6. Verify that the MTU for each NIC is set to 9014. A. Access the properties of each network adapter. B. Click Configure. C. On the Advanced tab, ensure that the value of Jumbo Packet is 9014. 8 DEPLOYING HYPER-V WITH ROUTING

Note: Do not restart the system yet. 7. Install the following Windows features: DHCP DNS Hyper-V The Hyper-V installation requires a reboot of the instance, so be sure to install it last. 9 DEPLOYING HYPER-V WITH ROUTING

You can perform this installation by using PowerShell. A script to perform these operations might look like the following one: $instance=$(convertfrom-json $(Invoke-WebRequest ( http://169.254.169.254/opc/v1/instance/ )).Content) $vnics=$(convertfrom-json $(Invoke-WebRequest ("http://169.254.169.254/opc/v1/vnics/ )).Content) $secondvnic="" $secondadapter="" $primaryadapter="" foreach ($vnic in $vnics) { if ($vnic.nicindex -eq 1 -and $vnic.vlantag -eq 0) { $secondvnic = $vnic foreach ($phys in Get-NetAdapter) { $vnicmac = $secondvnic.macaddr.replace(":","-").toupper() if ($vnicmac -eq $phys.macaddress) { $secondadapter=$phys } else { $primaryadapter=$phys } } } } Update-Help -Force:$true $netprefix=$secondvnic.subnetcidrblock.split("/")[1] New-NetIPAddress -InterfaceIndex $secondadapter.ifindex -IPAddress $secondvnic.privateip -PrefixLength $netprefix -DefaultGateway $secondvnic.virtualrouterip Start-Sleep 10 Set-DnsClientServerAddress -InterfaceIndex $secondadapter.ifindex - ServerAddresses "169.254.169.254" Set-NetAdapterAdvancedProperty -Name * -RegistryKeyword "*JumboPacket" - RegistryValue 9014 -NoRestart Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" $nrtargetportal=$(new-iscsitargetportal -TargetPortalAddress 169.254.2.2) Get-IscsiTarget -IscsiTargetPortal $nrtargetportal Connect-IscsiTarget - IsPersistent $true $nrdisk=get-disk Where-Object {$_.IsSystem -eq $false} Initialize-Disk -Number $nrdisk.number New-Partition -DiskNumber $nrdisk.number -UseMaximumSize - AssignDriveLetter $nrpart=$(get-partition -DiskNumber $nrdisk.number where-object {$_.Type -match "Basic"}) Format-Volume -Partition $nrpart -NewFileSystemLabel "hvsystem" - Confirm:$false Install-WindowsFeature -Name "DHCP" -IncludeManagementTools Install-WindowsFeature -Name "DNS" -IncludeManagementTools Install-WindowsFeature -Name "Hyper-V" -IncludeManagementTools - IncludeAllSubFeature -Restart 10 DEPLOYING HYPER-V WITH ROUTING

8. After the instance reboots, log back in. Configure Hyper-V 1. Open the Hyper-V Manager. 2. Open the Virtual Switch Manager and create a new external vswitch named External. Enable the Allow management operating system to share this network adapter and Enable single-root IOV virtualization (SR-IOV) options. 11 DEPLOYING HYPER-V WITH ROUTING

3. Create a new internal vswitch named Internal. Do not enable any other feature. 4. Open the network configuration for the instance. There should be four network interfaces, and two of them should be vethernet interfaces. Open the configuration for the vethernet interface with the name of the internal vswitch. 5. Configure the internal vethernet adapter with the Hyper-V address that you identified for DNS/DHCP. Do not set a default gateway on this interface. 6. Change the MTU on both vethernet adapters to 9014, using the same procedure that you did for the NICs. Do not reboot at this time. 12 DEPLOYING HYPER-V WITH ROUTING

Configure DNS and DHCP for Hyper-V Guests 1. Open the DNS management application, right-click the server, and select Properties. 2. On the Forwarders tab, click Edit and create an entry for 169.254.169.254. The FQDN will not resolve, which is a normal condition. Save the configuration and restart DNS. 3. Open the DHCP management application. 13 DEPLOYING HYPER-V WITH ROUTING

4. Expand the server, right-click IPv4, and select New Scope. 5. Create the scope by using the IP address range selected for Hyper-V. Be sure to start with the address immediately following the three that you are using for this process. 6. After the scope is created, expand the scope in the left navigation pane, right-click the Scope Options folder, and select Configure Options. 14 DEPLOYING HYPER-V WITH ROUTING

7. In the Scope Options dialog box, select the DNS option and enter the IP address that you selected for the DHCP/DNS. 8. Under Available Options, select 121 Classless Static Routes, and add the following routes (at a minimum). If you have other VCNs or networks via dynamic routing gateways (DRGs), also enter them here via the VCN gateway/router address. Destination Mask Router 0.0.0.0 0.0.0.0 IP address previously selected for the default gateway/nat VCN network space Netmask of the VCN IP address previously selected for the VCN gateway/router 15 DEPLOYING HYPER-V WITH ROUTING

9. Save the configuration and restart DHCP. Create the Initial Hyper-V Guests 1. Open Hyper-V Manager and create two new VMs, one named hvnat and one named hvrouter. Define the following characteristics for the VMs: Generation 2 VM Minimum memory of 4196 MB (dynamic memory) Network connection to the external vswitch 100G of space for the VMDK, located on the block storage device (typically the D: drive) 2. After it is created, select the hvnat VM and select Settings. 3. Get the information for the secondary VNIC that is not selected as the route target, and then perform the following steps in the Settings dialog box: A. In the left navigation pane, click Network Adapter External. B. Select the Enable virtual LAN identification check box. C. Enter the VLAN ID of the secondary VNIC. 16 DEPLOYING HYPER-V WITH ROUTING

4. In the left navigation pane, click Hardware Acceleration (under Network Adapter External), and then select the Enable SR-IOV check box. 17 DEPLOYING HYPER-V WITH ROUTING

5. In the left navigation pane, click Advanced Features (under Network Adapter External). In the MAC Address section on the right, select the Static option, and then enter the MAC address associated with the secondary VNIC being used. 6. In the left navigation pane, click Add Hardware and then select Network Adapter. 7. Add an internal network adapter, keeping all of the default settings. 8. Save the configuration. 9. Repeat the preceding six steps for the hvrouter VM. The configuration items for the preceding three sections can also be completed using PowerShell. The following sample script (hvrouting.ps1) provides a template for executing these steps: Function ConvertTo-NetMask($cidr) { $mask=[convert]::tostring(([math]::pow(2,$cidr) - 1) -shl (32 - $cidr), 2) $netmask = @() for($x = 0; $x -lt 4; $x++) { $netmask += [Convert]::ToUInt32($mask.Substring((8 * $x),8),2).tostring() } return [String]::Join(".", $netmask) } $instance=$(convertfrom-json $(Invoke-WebRequest ( http://169.254.169.254/opc/v1/instance/ )).Content) $vnics=$(convertfrom-json $(Invoke-WebRequest ("http://169.254.169.254/opc/v1/vnics/ )).Content) $secondvnic="" $adapter="" $hvvnics=@() $internalipbase="192.168.11.0/24" $hvip="192.168.11.3" $beginiprange="192.168.11.4" $endiprange = "192.168.11.254" foreach ($vnic in $vnics) { if ($vnic.nicindex -eq 1 -and $vnic.vlantag -eq 0) { $secondvnic = $vnic 18 DEPLOYING HYPER-V WITH ROUTING

} foreach ($phys in Get-NetAdapter) { $vnicmac = $secondvnic.macaddr.replace(":","-").toupper() if ($vnicmac -eq $phys.macaddress) { $adapter=$phys break } } } elseif ($vnic.nicindex -eq 1 -and $vnic.vlantag -gt 0) { $hvvnics+=$vnic } New-VMSwitch -Name "External" -AllowManagementOS $true -NetAdapterName $adapter.interfacealias -EnableIov $true New-VMSwitch -SwitchType Internal -Name "Internal" $intadapter=$(get-netadapter Where-Object {$_.Name -match "internal"}) $extadapter=$(get-netadapter Where-Object {$_.Name -match "external"}) New-NetIPAddress -InterfaceIndex $intadapter.ifindex -IPAddress $hvip - PrefixLength $internalipbase.split("/")[1] Set-DnsServerForwarder -IPAddress 169.254.169.254 sleep 30 Add-DhcpServerv4Scope -Name "Internal" -EndRange $endiprange -StartRange $beginiprange -SubnetMask $(ConvertTo-NetMask ([Convert]::ToInt16($internalIpBase.split("/")[1]))) Set-DhcpServerv4OptionValue -ScopeId $internalipbase.split("/")[0] -DnsServer $hvip Set-DhcpServerv4Binding -InterfaceAlias $intadapter.interfacealias -BindingState $true Set-DhcpServerv4Binding -InterfaceAlias $extadapter.interfacealias -BindingState $false New-Item -ItemType Directory -Path "D:\Virtual Machines" $hvnetguests=@("hvnat","hvrouter") $count=0 foreach ($guest in $hvnetguests) { New-Item -ItemType Directory -Path ("D:\Virtual Machines\" + $guest) New-VM -Name $guest -MemoryStartupBytes (4* [Math]::Pow(1024,3)) -NewVHDPath ("D:\Virtual Machines\" + $guest + "\" + $guest + ".vhdx") -NewVHDSizeBytes (100 * [Math]::Pow(1024, 3)) -Generation 2 -SwitchName "External" Add-VMDvdDrive -VMName $guest Set-VMFirmware -VMName $guest -BootOrder @($(Get-VMDvdDrive -VMName $guest), $(Get-VMHardDiskDrive -VMName $guest)) Set-VM -Name $guest -DynamicMemory -MemoryMinimumBytes (4* [Math]::Pow(1024,3)) Set-VMNetworkAdapter -VMName $guest -StaticMacAddress $hvvnics[$count].macaddr -IovWeight 100 Set-VMNetworkAdapterVlan -VMName $guest -Access -VlanId $hvvnics[$count].vlantag Add-VMNetworkAdapter -VMName $guest -SwitchName "Internal" $count++ } Set-NetAdapterAdvancedProperty -Name * -RegistryKeyword "*JumboPacket" - RegistryValue 9014 19 DEPLOYING HYPER-V WITH ROUTING

Install and Configure Windows for hvnat and hvrouter Hyper-V guests 1. Install Windows 2012 R2 on both the hvnat VM and the hvrouter VM. 2. Perform the following steps on each guest: A. Install the driver for the X7 network interface. This driver will be identified in Device Manager as an unknown network device. B. Identify the interface associated with the secondary VNIC. To do this, look at the MAC address of the virtual NIC in the instance. C. Configure the IP address, subnet mask, and default gateway of the secondary VNIC with the information identified for the particular instance. D. Configure the second interface with the IP address selected for the function. The hvnat guest should not be the route target for the VCN and should get the Hyper-V address associated with the default gateway/nat. The hvrouter guest should have the secondary VNIC associated with the route target address and should get the Hyper-V address associated with the VCN gateway/router. The interface with the Hyper-V address should not get a default gateway configured, but should have the DNS address assigned. The DNS address should be the internal address associated with the DNS/DHCP function for Hyper-V. E. Verify that each instance can ping the subnet default gateway on the VCN and the internal DNS/DHCP address, and can get to the internet. F. Apply all current Windows patches to the operating system. Configure the hvnat Guest Before performing these steps, ensure that all networking on the hvnat guest has been configured and is functional. Tests of the network should include being able to communicate with both instances on the VCN side of the hvnat guest and network targets on the internal Hyper-V side. A simple ping test should suffice. 1. On the hvnat instance, install the Routing and Remote Access service (RRAS), routing only. Perform this step by using the following PowerShell command, run as Administrator: Install-WindowsFeature -Name Routing -IncludeSubFeature - IncludeManagementTools -Confirm:$false 20 DEPLOYING HYPER-V WITH ROUTING

2. Open the Routing and Remote Access tool. 3. Right-click the server and select Configure and Enable Routing and Remote Access. 4. On the welcome page of the Routing and Remote Access Server Setup Wizard, click Next. 5. On the Configuration page, select Network address translation (NAT), and then click Next. 6. On the NAT Internet Connection page, select the interface that has the VCN IP address for the internet-facing interface, and then click Next. 21 DEPLOYING HYPER-V WITH ROUTING

7. Click Finish. 8. If you get the following warning, you can ignore it and click OK. A dialog box is displayed, indicating that the configuration is being committed. This process might stop responding. If the dialog box does not disappear after 10 or so minutes, restart the instance. 9. In the Routing and Remote Access tool, expand the server and click NAT. The right side of the window should display entries similar to the following ones: 22 DEPLOYING HYPER-V WITH ROUTING

10. Verify that you can still ping the VCN subnet default gateway via the Hyper-V address. In the following example, the VCN gateway is 10.50.0.65 and the Hyper-V address for hvnat is 192.168.11.1. You can open a PowerShell window and issue the following commands: The ping -S command sends the ping from the designated interface. Note: You can t ping the VCN interface of the hvnat VM from any instance on the subnet or VCN. This is normal. Configure the hvrouter Guest Before performing these steps, ensure that all networking on the hvrouter guest has been configured and is functional. Tests of the network should include being able to communicate with both instances on the VCN side of the hvrouter guest and network targets on the internal Hyper-V side. A simple ping test should suffice. 1. Log in to the hvrouter instance. 2. Open a PowerShell window as Administrator. 23 DEPLOYING HYPER-V WITH ROUTING

3. Identify the interface index numbers by running the following command: Get-NetAdapter Note the ifindex numbers for each of the Hyper-V interfaces. 4. Configure forwarding on each interface by running the following command for each interface number identified: Set-NetIPInterface -InterfaceIndex <ifindex_number> -Forwarding Enabled 5. Test to ensure that you can ping the Hyper-V interface from an instance on the VCN subnet. The configuration is now complete. Installing Guests Guest instances can be installed by using the normal process associated with building Hyper-V guests. Following are exceptions to this rule: Guests should be configured with access only to the internal Hyper-V network vswitch and not the external vswitch. Guests should always use DHCP. If static addressing is required, either register the MAC address of the guest as a DHCP reservation within the Hyper-V based DHCP server, or configure the guest with the following information and add the exclusion to DHCP: o o o o o IP address: Assigned IP address Netmask: Netmask for IP subnet. Default gateway: Hyper-V address of the hvnat instance DNS: Hyper-V address of the hypervisor (DNS/DHCP above) Manually add a route to the VCN subnet(s), and/or other internal networks, via the VCN gateway (hvrouter) address. 24 DEPLOYING HYPER-V WITH ROUTING

Enabling Connections Between Guests on Different Hyper-V Servers This process allows isolated guests on one Hyper-V server to interact fully with isolated guests on another. This configuration is illustrated in the following diagram: This process can be applied to all Hyper-V servers running within the same VCN. The instructions assume that you have two Hyper-V servers, Svr1 and Svr2, with two different IP address ranges for their guests. Both Hyper-V servers must be configured using the process described in this document before attempting this procedure. You should identify the guest IP subnet, associated netmask, and hvrouter IP address for each Hyper-V server before starting this process. 1. Open the DHCP server on Svr1. 2. Select the scope that you created in Configure DNS and DHCP for Hyper-V Guests. 3. Open the Scope Options dialog box and select 121 Classless Static Routes. 4. Enter the following route information: Destination: IP subnet for the guests located on Svr2 Mask: IP subnet mask for the guests on Svr2 Router: IP address of hvrouter created on Svr1 5. Save the configuration and restart DHCP. 6. Renew the DHCP leases on all guests running on Svr1. 7. Open the DHCP server on Svr2. 25 DEPLOYING HYPER-V WITH ROUTING

8. Select the scope that you created in Configure DNS and DHCP for Hyper-V Guests. 9. Open the Scope Options dialog box and select 121 Classless Static Routes. 10. Enter the following route information: Destination: IP subnet for the guests on Svr 1 Mask: IP subnet mask for the guests on Svr1 Router: IP address of hvrouter created above for Svr2 11. Save the configuration and restart DHCP. 12. Renew the DHCP leases on all guests running on Svr2. Assuming that you have created the security lists and entries in the route table for the VCN per Hyper-V server, you should now be able to communicate between guests residing in each Hyper-V server. This model can be extended to additional servers simply by adding their routing information to each other Hyper-V server that needs to participate in the relationship. Summary Following this procedure allows the use of Hyper-V within the Oracle Cloud Infrastructure environment, with some limitations. Guests of this type of deployment can participate and communicate with resources located within the environment as equal partners to those instances that are deployed using Oracle Cloud Infrastructure native methods. 26 DEPLOYING HYPER-V WITH ROUTING

Oracle Corporation, World Headquarters Worldwide Inquiries 500 Oracle Parkway Phone: +1.650.506.7000 Redwood Shores, CA 94065, USA Fax: +1.650.506.7200 C O N N E C T W I T H U S blogs.oracle.com/oracle facebook.com/oracle twitter.com/oracle oracle.com Copyright 2018, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only, and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document, and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 0318 Deploying Hyper-V with Routing March 2018 Author: Steven B. Nelson