Hyper-V

Hyper-V Network and Storage Configuration

Configuring the Disk Quorum

This process assumes that you are going to use a disk based witness.

  1. Ge the list of all of your disks by running get-disk. And determine what disk is being used for your quorum. In this example it is disk 1
  2. Create the disk to be used by the quorum

    get-disk 1 | Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -UseMaximumSize | Format-Volume -FileSystem ReFS -NewFileSystemLabel “Quorum” -Confirm:$false

  3. Add the disk as a cluster disk

    get-disk 1 | Add-ClusterDisk

  4. Set the Cluster Quorum. This assumes that the name of the disk is Cluster Disk 1. To check, run get-clusterdisk and make sure it matches

    Set-ClusterQuorum -NodeAndDiskMajority “Cluster Disk 1”

  5. Rename the Resouce to something more meaningful

    (Get-ClusterResource -Name “Cluster Disk 1”).name = “Quorum”

Configure Kerberos authentication for live migration.

This allows the systems to be migrated even if a user is not logged into the system

  1. Open active directory users and computers
  2. Right click on the domain and choose find (make sure to choose from the object type. Or if you know where the computer is in the OU) go to the properties of the computer
  3. Go to the delegation tab
  4. Choose the option Trust this computer for delegation of specified services
  5. Choose the Use Kerberos only
  6. Click Add
  7. Enter the name(s) of the other computers in the cluster (not the current computer you got the properties for)
  8. Select Microsoft Virtual System Migration Service
  9. Repeat that for each computer
  10. Repeat that for each computer in the cluster

Configuring the network

Create a new VM Switch, this can only be down through powershell (with elevated permmisions), not the the GUI. You must follow these steps on each server.

You need to get a list of your network adapters. By Microsoft supported matrix, the second NIC needs to be used for management and everything

Get-NetApapter, this should return something like NIC1 or NIC2

The first vswitch will create is for Management, we will want to create 3 more: Live Migration, Cluster Share Volumes, Storage. Virtual Machine Access will go on NIC 1, and that will be done through the GUI as you add virtual machines

Create a vmSwitc; If you run these commands from a psession, the connection will time out for a couple of minutes then come back online

  1. You will need to run the bellow commands on each server in the cluster

    New-vmswitch –AllowManagementOS 0 –name “vSwitch” –netAdapterName “NIC2”

  2. Add a Network Adapter to the Switch, you will make one for each non-vmguest interface (NIC2)

    Add-VMNetworkAdapter -ManagementOS -Name “Management” -SwitchName “vSwitch”

    Add-VMNetworkAdapter -ManagementOS -Name “LiveMigration” -SwitchName “vSwitch”

    Add-VMNetworkAdapter -ManagementOS -Name “Cluster-CSV” -SwitchName “vSwitch”

    Add-VMNetworkAdapter -ManagementOS -Name “Storage” -SwitchName “vSwitch”

  3. Set the VLAN for the interfaces. This way they will communicate on their own vlan, and if needed a QoS service can be applied

    Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName LiveMigration -Access -VlanId 1000

  4. Set the Cluster-CSV VLAN

    Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName Cluster-CSV -Access -VlanId 1001

  5. Set The IP addresses
  6. Get the interface indexes so you map the right interface to the right network this will return the vEthernet adapters, you should have the following now, it may vary from machine to machine

get-NetIPInterface

Name InterfaceDescription ifIndex Status MacAddress LinkSpeed
vEthernet (Storage) Hyper-V Virtual Ethernet Adapter #5 49 Up 00-15-5D-09-2A-03 10 Gbps
vEthernet (Cluster-CSV) Hyper-V Virtual Ethernet Adapter #4 45 Up 00-15-5D-09-2A-02 10 Gbps
vEthernet (LiveMigration) Hyper-V Virtual Ethernet Adapter #3 40 Up 00-15-5D-09-2A-01 10 Gbps
vEthernet (Management) Hyper-V Virtual Ethernet Adapter #2 36 Up 00-15-5D-09-2A-00 10 Gbps
NIC2 Intel(R) Ethernet 10G 2P X520-k bNDC #2 13 Up 74-E6-E2-AE-19-63 1 Gbps
NIC1 Intel(R) Ethernet 10G 2P X520-k bNDC 12 Up 74-E6-E2-AE-19-61 1 Gbps
  1. Set the IP addresses, remember that 192.168.0.100 is used livemigration for and 101 is used for clusterCSV. is used for. Make sure to change their interface and ip address for each server

    New-NetIPAddress -InterfaceIndex 40 -IPAddress 192.168.100.1 -PrefixLength 24

    New-NetIPAddress -InterfaceIndex 45 -IPAddress 192.168.101.1 -PrefixLength 24

  2. Since we will not be using the Storage vmNetwork, we can disable it

    Disable-NetAdapter -Name “vEthernet (Storage)” -Confirm:$false

  3. The second vSwitch we will create is for client communications, and this will be on the other NIC (NIC1). In this step you will lose connection with remote management and should do this through the console level.

    New-vmswitch –AllowManagementOS 0 –name “ClientvSwitch” –netAdapterName “NIC1”

    Add-VMNetworkAdapter -ManagementOS -Name “Client” -SwitchName “ClientvSwitch”

  4. Disable DNS registration on the vEthernets except for the management interface. We want to keep DNS updating for this IP address so we can get to remote management if needed.

    Get-DnsClient | ?{($_.InterfaceAlias -like “vEthernet*”) –and ($_.InterfaceAlias –notlike “*Management*”)} | Set-DnsClient -RegisterThisConnectionsAddress:$false

End configuration for each server in the cluster

  1. Set the name on each network. We want to make sure each network is used for the right purpose in the cluster

    Get-ClusterNetwork | select Name,IPv4*

    This will return the Name and the IPv4Addresses used for each cluster network

  2. To help remember what is what, we will rename each clusterNetwork

    (Get-ClusterNetwork -Name “Cluster Network 2”).name = “Cluster-CSV”

    (Get-ClusterNetwork -Name “Cluster Network 3”).name = “LiveMigration”

  3. Set the live migration preferred network
    1. get a list of all the networks configurd for live migration: Get-VMMigrationNetwork
    2. Remove all the networks that are not part of the live migration network
    3. First make sure that you have the correct networks by running Get-ClusterNetwork if you don’t see just the three networks we condifured (Cluster Network 1, Cluster-CSV, and Live Migration

      Get-ClusterResourceType -Name “Virtual Machine” | Set-ClusterParameter -Name MigrationExcludeNetworks -Value ([String]::Join(“;”,(Get-ClusterNetwork | Where-Object {$_.Name -ne “LiveMigration”}).ID))

Some side notes on this

  1. For example, if you do not have an enbeded switch like in a blade chassis, where I set the VLAN, just change the VLAN ID to match what your network person said to use. This is actually true for any of the networks. So you can also do the same thing for the management network, client network, any network, they all use the same command
  2. Why is the format disk so complex? It is, you are right, so much easier to use diskpart and format commands from DOS. And think about the process you do from DOS, all commands can be done from within diskpart:
    1. Select the disk
    2. Initialize the disk
    3. Create a partition
    4. Format the disk
    5. But the object was 100% powershell. Let’s look at the entire command, and we will break it down backward, and remember what we do in diskpart. Within diskpart after you select the disk and initialize, that object is active. You then create the partition, remember you are already in the disk context. Once you create the partition, you are now in the partition object and when you do a format, it knows you are in a partition you want to format.
    6. Powershell works the same way, except you can do it all in one line.

    get-disk 1 | Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -UseMaximumSize | Format-Volume -FileSystem ReFS -NewFileSystemLabel “Quorum” -Confirm:$false

    1. Format-Volume requires an object

6 thoughts on “Hyper-V Network and Storage Configuration

  1. Keflex Clotrimazole Cream And Towin Priligy Precio 2012 Venta Kamagra [url=http://cialibuy.com]cialis[/url] Where Can I Get Nolvadex Viagra Online Generic Fast Delivery Original Viagra Rezeptfrei Bestellen

  2. Amoxil Etre Fastest Place Online To Order Clomid [url=http://drugsir.com]cialis no prescription[/url] Free Shipping Worldwide Levaquin Website Clomid Cuisine D Action No Prescriptions Online Pharmacy

  3. Thanks for another informative website. The place else
    may I am getting that type of information written in such an ideal method?
    I have a project that I’m just now working on, and I’ve been on the look out for such information.

  4. Isotretinoin price [url=http://addrall.com]buy alli online uk in stock[/url] Buy Fluconazole No Perscription Kamagra 100 Online Cephalexin Interaction

  5. Can You Drink Beer With Keflex Cipro Online No Prescription Overnight Generic Cialis Lowest Price [url=http://buyoxys.com]generic levitra for sale in us[/url] Cold Medicine And Amoxicillin

Leave a Reply

Your email address will not be published. Required fields are marked *