Configuring the Hyper-V Virtual Machines

This chapter includes the following sections:

Creating the VMs in Microsoft Hyper-V Manager

This procedure creates a VM using the New Virtual Machine Wizard in the Microsoft Hyper-V Manager. For more information on creating and configuring a new VM, see the Microsoft Windows documentation.

Perform this task for each VM in the Hyper-V cluster.

Before You Begin

In Microsoft Hyper-V Manager, create a virtual switch.

Procedure
    Step 1   In the Actions frame of Microsoft Hyper-V Manager, click New.
    Step 2   From the drop-down list, select Virtual Machine to launch the New Virtual Machine Wizard.
    Step 3   In the New Virtual Machine Wizard, click Next to create a VM with a custom configuration.
    Step 4   Complete the Specify Name and Location menu and click Next.
    Step 5   Complete the Assign Memory menu and click Next.
    Step 6   In the Configure Networking menu, select the virtual switch from the Connection drop-down list. and click Next.
    Step 7   Click Next.
    Step 8   Complete the Connect Virtual Hard Disk menu and click Next.
    Step 9   View the Summary and click Finish.

    Microsoft Hyper-V Manager displays a list of the VMs.

    Step 10   In the list of VMs, right-click the new VM and select Settings.
    Step 11   In the Navigation pane, click the Processor object and specify 4 virtual processors.
    Step 12   In the Navigation pane, expand the Network Adapter object and click Hardware Acceleration.

    The Hardware Acceleration pane appears.

    Step 13   Scroll to the bottom of the pane and check the check box for Enable SR-IOV.
    Step 14   Click Apply.
    Step 15   Click OK.
    Step 16   Open Powershell on the server and enter the following command: Set-VMNetworkAdapter -Name adapter-name -VMName vm-name - IovQueuePairsRequested rq-num

    Example:
    PS C:\> Set-VMNetworkAdapter -Name vmnic1 -VMName vm1 -IovQueuePairsRequested 4
    

    This command increases performance. The parameters of the command are as follows:

    • adapter-name—The name of the VM network adapter.
    • vm-name—The name of the VM.
    • rq-num—The number of queue pairs requested, which should be equal to or less than the number of receive queues in the Ethernet adapter policy and equal to or less than the number of virtual CPUs assigned to the VM.
    Step 17   Return to the Microsoft Hyper-V Manager session.
    Step 18   In the list of VMs, right-click the new VM and select Connect.

    A console session to the VM appears.

    Step 19   Click the green Start icon to start the VM.

    What to Do Next

    Attach a port profile to the VM NIC.

    Installing the VF Driver

    Perform this task on each VM to install the VF driver.

    Before You Begin

    The Cisco UCS B-Series Blade Server Software Bundle ISO file must be mounted on the server.

    Procedure
      Step 1   In Powershell on the VM, locate the CSCO_VIO_INSTALLER_version directory in the contents of the mounted ISO file.
      Step 2   Run CSCO_VIO_INSTALLER_64_version.msi as administrator.
      Step 3   Select Typical installation.
      Step 4   Click Next and follow the instructions to install the drivers.

      Managing the Port Profile

      Two methods are available for attaching the port profile to the VM network adapters:

      • You can use Cisco scripts with Microsoft Powershell.
      • You can use the Cisco Port Profile Management Snap-in that is installed with the Cisco VM-FEX Utilities.

      You can choose either method.

      Using Microsoft PowerShell

      Attaching the Port Profile with PowerShell

      Perform this task on the Hyper-V host server.

      After installing the Cisco VM-FEX Port Profile Utilities from the Cisco UCS B-Series Blade Server Software Bundle, you can find scripts for administering VM network adapters using Microsoft Windows PowerShell in the following directory:

      C:\Program Files\Cisco Systems\VIO Software\Utilities\Ethernet Utilities\Vmfex Utilities\Scripts
      Procedure
          Command or Action Purpose
        Step 1 powershell


        Example:C:\> powershell 

        Launch PowerShell on the server.

         
        Step 2 cd "C:\Program Files\Cisco Systems\VIO Software\Utilities\Ethernet Utilities\Vmfex Utilities\Scripts"


        Example:PS C:\> cd "C:\Program Files\Cisco Systems\VIO Software\Utilities\Ethernet Utilities\Vmfex Utilities\Scripts" 

        Changes the current directory to the directory that contains the PowerShell scripts.

         
        Step 3 . .\Backend.ps1


        Example:PS C:\Program Files\Cisco Systems\VIO Software\Utilities\Ethernet Utilities\Vmfex Utilities\Scripts> . .\Backend.ps1 

        Makes the scripts available in the current scope.

         
        Step 4 . .\Util.ps1


        Example:PS C:\Program Files\Cisco Systems\VIO Software\Utilities\Ethernet Utilities\Vmfex Utilities\Scripts> . .\Util.ps1 

        Makes the scripts available in the current scope.

         
        Step 5 cd \


        Example:PS C:\Program Files\Cisco Systems\VIO Software\Utilities\Ethernet Utilities\Vmfex Utilities\Scripts> cd \ 

        Changes the current directory to the top level directory.

         
        Step 6 Add-CiscoVmfexSwitchToCluster "switch-name" "cluster-id" "cluster-name"


        Example:PS C:\> Add-CiscoVmfexSwitchToCluster “VSwitch_1” "87654321-0123-4567-abcd-0123456789abcdef" “Cluster_1” 

        Attaches the virtual switch to the cluster. The parameters are as follows:

        • switch-name—The virtual switch name you configured in the Virtual Switch Manager.
        • cluster-id—The cluster ID that you configured when you created a cluster in Cisco UCS Manager.
        • cluster-name—The cluster name that you configured inCisco UCS Manager.
         
        Step 7 Get-VM


        Example:PS C:\> Get-VM 

        Displays a table of VMs. Note the VM Name in the first column.

         
        Step 8 Get-VMNetworkAdapter -VMName vm-name |fl


        Example:PS C:\> Get-VMNetworkAdapter -VMName vm1 |fl 

        Displays a list of network adapter properties for the VM. For the vm-name parameter, enter the VM name as it appears in the Name column of the VM table.

        In the network adapter properties list, note the Id and VMId properties.

         
        Step 9 $ProfileId = “{“+[System.Guid]::NewGuid().tostring()+”}”


        Example:PS C:\> $ProfileId = “{“+[System.Guid]::NewGuid().tostring()+”}” 

        Creates a globally unique identifier (Guid) string and assigns it to a variable named $ProfileId to be used as an identifier for the port profile. The variable name is arbitrary, but will be used in the next step.

         
        Step 10 Add-CiscoVmfexPortProfile "vmid" $ProfileId "profile-name" "adapter-id"


        Example:
        PS C:\> Add-CiscoVmfexPortProfile “8be79ffd-0bf2-4a93-b9ee-81878755b469” $ProfileId “MyPortProfile_1” “Microsoft:0D8E0F40-C010-45C2-91E7-C3E21043FE83\ 17F85D37-2ACD-42AD-981C-AC4BDAC0B8BD”
         

        Attaches the VM network adapter to the port profile. The parameters are as follows:

        • vmid—The VMId property from the network adapter properties list.
        • profile-name—The profile name that you configured inCisco UCS Manager.
        • adapter-id—The Id property from the network adapter properties list.
         
        Step 11 Perform steps 8 through 10 for each VM.   
        What to Do Next

        Reboot the Hyper-V host and test the IP connectivity of the host.

        Detaching the Port Profile with PowerShell

        (Optional) To detach the port profile using PowerShell, perform this task on the Hyper-V host server.

        Procedure
            Command or Action Purpose
          Step 1 powershell


          Example:C:\> powershell 

          Launch PowerShell on the server.

           
          Step 2 Delete-CiscoVmfexPortProfile "vmid" "adapter-id"


          Example:
          PS C:\> Delete-CiscoVmfexPortProfile “8be79ffd-0bf2-4a93-b9ee-81878755b469” “Microsoft:0D8E0F40-C010-45C2-91E7-C3E21043FE83\ 17F85D37-2ACD-42AD-981C-AC4BDAC0B8BD”
           

          Deletes the VM network adapter from the port profile. The parameters are as follows:

          • vmid—The VMId property from the network adapter properties list.
          • adapter-id—The Id property from the network adapter properties list.
           
          Step 3 Remove-CiscoVmfexSwitchFromCluster "switch-name"


          Example:PS C:\> Remove-CiscoVmfexSwitchFromCluster “VSwitch_1” 

          Removes the virtual switch from the cluster. The switch-name is the virtual switch name configured in the Virtual Switch Manager.

           

          Using the Cisco Port Profile Management Snap-in

          Attaching the Port Profile with the Port Profile Management Snap-in

          Procedure
            Step 1   On the server with the Port Profile Management Snap-in installed, double-click the desktop shortcut to launch the Cisco Vmfex Port-Profile Manager.
            Step 2   In the Actions pane, click Add UCSM.

            The UCSM Login dialog box appears.

            Step 3   In the UCSM Login dialog box, enter the IP Address, User Name, and Password for the Cisco UCS Manager (UCSM) system and click OK.

            The clusters and port profiles display in the center pane.

            Step 4   In the Actions pane, click Add Host.

            The Connect to Hyper-V Server dialog box appears.

            Step 5   In the Connect to Hyper-V Server dialog box, select Local Computer to add the current host or Another Computer to add a remote host.
            Step 6   If you selected Another Computer, enter the Host Name/IP, User Name, and Password for the remote host.

            The Host Name must be in the same domain as the Hyper-V host. If you enter an IP address instead of a host name, you must execute the following command in Powershell on the Hyper-V host:

            Set-Item WSMan:\localhost\Client\TrustedHosts <remote host ip>

            For example:

            Set-Item WSMan:\localhost\Client\TrustedHosts '192.0.20.1' -concatenate

            Step 7   Click OK.

            The center pane displays the host verification results. Any virtual switches attached to the host are listed under the host name in the Navigation pane.

            Step 8   To attach a virtual switch to a cluster, select Attach to Cluster under the switch name in the Actions pane.

            The Select Cluster dialog box appears.

            Step 9   In the Select Cluster dialog box, select a cluster and click OK.

            The cluster name appears with the virtual switch name in the Navigation and Actions panes. If no cluster name appears, the switch belongs to the default cluster.

            Step 10   To attach the VM network adapters to a port profile, select one or more VM network adapters in the center pane and click Attach/Modify Port Profile under the selected items in the Actions pane.

            The Select Port Profile dialog box appears, displaying all port profiles in the virtual switch.

            Step 11   In the Select Port Profile dialog box, select a port profile and click OK.

            The port profile name appears with each VM network adapter in the Navigation pane.


            What to Do Next

            Reboot the Hyper-V host and test the IP connectivity of the host.

            Detaching the Port Profile with the Port Profile Management Snap-in

            Procedure
              Step 1   On the server with the Port Profile Management Snap-in installed, double-click the desktop shortcut to launch the Cisco Vmfex Port-Profile Manager.
              Step 2   To detach the VM network adapters from a port profile, select one or more VM network adapters in the center pane and click Detach Port Profile under the selected items in the Actions pane.
              Step 3   To detach the virtual switch from a cluster, select Detach from Cluster under the switch name in the Actions pane.

              The virtual switch cannot be detached from the cluster unless all VM network adapters under the switch are detached from their port profiles.