Configuring Virtual Machine Tracker

This chapter contains the following sections:

Information About Virtual Machine Tracker

Guidelines and Limitations for VM Tracker

VM Tracker has the following guidelines and limitations:

  • show commands with the internal keyword are not supported.

  • For all ports on which VM Tracker is enabled, you must not perform any Layer 2 or Layer 3 configuration that is related to switchports and VLANs.

  • VM Tracker supports up to four vCenter connections.

  • VM Tracker supports high availability and the fault tolerance features of vCenter.

  • VM Tracker is only supported on ESXi 5.0, 5.1, 5.5, and 6.0 versions of VMware vCenter.

  • You must connect a host directly to the port of a Cisco Nexus 9000 Series switch. Host connectivity through fabric interconnect, another switch, or chassis is not supported.


    Note


    Connecting a host through a fabric extender (FEX) is supported by a Cisco Nexus 9000 Series switch.


  • When VMware Distributed Resource Scheduler (DRS) is enabled, VMTracker cannot immediately detect when the VM is powered on. However when VMTracker later performs a full sync with VMware VCenter, the VM becomes recognized by VMTracker. Disabling VMware DRS avoids this issue.

Enabling Virtual Machine Tracker

By default, the VM Tracker feature is enabled on all interfaces.

SUMMARY STEPS

    1.    switch# configure terminal

    2.    switch(config)# [no] feature vmtracker


DETAILED STEPS
     Command or ActionPurpose
    Step 1switch# configure terminal  

    Enters global configuration mode.

     
    Step 2switch(config)# [no] feature vmtracker  

    Enables the VM Tracker feature on all interfaces.

    The no form of the command disables the VM Tracker feature on all interfaces.

     

    This example shows how to enable VM Tracker:

    switch# configure terminal
    switch(config)# feature vmtracker
    switch(config)#

    Creating a New Connection to vCenter

    SUMMARY STEPS

      1.    switch# configure terminal

      2.    switch(config)# [no] vmtracker connection connection-name

      3.    switch(config-vmt-conn)# [no] remote {ip address ip_address | port port_number | vrf}

      4.    switch(config-vmt-conn)# username username password password

      5.    switch(config-vmt-conn)# [no] connect


    DETAILED STEPS
       Command or ActionPurpose
      Step 1switch# configure terminal  

      Enters global configuration mode.

       
      Step 2 switch(config)# [no] vmtracker connection connection-name
       

      Enters VM Tracker connection configuration mode for the connection name specified.

      The no form of the command disables the connection.

       
      Step 3switch(config-vmt-conn)# [no] remote {ip address ip_address | port port_number | vrf}
       

      Configures remote IP parameters.

       
      Step 4switch(config-vmt-conn)# username username password password
       

      Verifies the username and password to connect to vCenter.

       
      Step 5switch(config-vmt-conn)# [no] connect
       

      Connects to vCenter.

      The no form of the command disconnects VM Tracker from vCenter.

       

      This example shows how to create a new connection to VMware vCenter:

      switch# configure terminal
      switch(config)# vmtracker connection conn1
      switch(config-vmt-conn)# remote ip address 20.1.1.1 port 80 vrf management
      switch(config-vmt-conn)# username user1 password abc1234
      switch(config-vmt-conn)# connect

      Synchronizing Information with VMware vCenter

      By default, VM Tracker tracks all asynchronous events from VMware vCenter and updates the switchport configuration immediately. Optionally, you can also configure a synchronizing mechanism that synchronizes all host, VM, and port group information automatically with VMware vCenter at a specified interval.

      Command

      Purpose

      [no] set interval find-new-host val

      Sets the interval, in seconds, for finding hosts that are newly connected to vCenter. The no form of the command disables the previously configured interval.

      The default duration is 3600 seconds.

      [no] set interval sync-full-info val

      Sets the interval, in seconds, for synchronizing all host, VM, and port group related information with vCenter. The no form of the command disables the previously configured interval.

      The default duration is 3600 seconds.

      vmtracker connection connection-name refresh

      Synchronizes all host, VM, and port group related information with vCenter immediately for the specified connection.

      This example shows how to set an interval for finding hosts that are newly connected to vCenter:

      switch(config-vmt-conn)# set interval find-new-host 300

      This example shows how to set an interval for synchronizing all host, VM, and port group information with vCenter:

      switch(config-vmt-conn)# set interval sync-full-info 120

      This example shows how to immediately synchronize all host, VM, and port group information with vCenter:

      switch(config-vmt-conn)# vmtracker connection conn1 refresh

      Compatibility Checking on a VPC Topology

      On a VPC topology, VM Tracker performs a Type 2 compatibility checking. The checking ensures that for a particular connection name, the following fields match across the VPC peers:

      • The vCenter IP address that VM Tracker should connect to.

      • The vCenter port number that VM Tracker should connect on.

      • The allowed VLAN range for that particular connection.

      • The username/password combination that VM Tracker should use to connect to the vCenter Server.

      To determine if the VPC checking was successful, use the show vpc consistency-parameters global command.

      The following is an example of VPC checking:

      switch# show vpc  consistency-parameters global 
      
          Legend:
              Type 1 : vPC will be suspended in case of mismatch
      
      Name                        Type  Local Value            Peer Value             
      -------------               ----  ---------------------- -----------------------
      Vlan to Vn-segment Map      1     No Relevant Maps       No Relevant Maps      
      STP Mode                    1     Rapid-PVST             Rapid-PVST            
      STP Disabled                1     None                   None                  
      STP MST Region Name         1     ""                     ""                    
      STP MST Region Revision     1     0                      0                     
      STP MST Region Instance to  1                                                  
       VLAN Mapping                                                                  
      STP Loopguard               1     Disabled               Disabled              
      STP Bridge Assurance        1     Enabled                Enabled               
      STP Port Type, Edge         1     Normal, Disabled,      Normal, Disabled,     
      BPDUFilter, Edge BPDUGuard        Disabled               Disabled              
      STP MST Simulate PVST       1     Enabled                Enabled               
      Interface-vlan admin up     2     1-8                    1-8                   
      Interface-vlan routing      2     1-8                    1-8                   
      capability                                                                     
      vmtracker connection        2     conn1, 10.193.174.215, conn1, 10.193.174.215,
      params                             80, 1-4094             80, 1-4094           
      Allowed VLANs               -     1-100                  1-100                 
      Local suspended VLANs       -     -                      -                     
      switch# 
      
      
      

      Verifying the Virtual Machine Tracker Configuration

      Use the following commands to display and verify VM Tracker configuration information:

      Command

      Purpose

      show running-config vmtracker [all]

      Displays the VM Tracker configuration.

      show vmtracker [connection conn_name] {{info [interface intf_id ]{summary | detail | host | vm | port-group}} | event-history}
      Displays the VM Tracker configuration based on the following:
      • Connection
      • Interface
      • Event history
      show vmtracker [connection conn_name] status

      Displays the IP address and connection status of the vCenter connection specified.

      show logging level vmtracker

      Displays the logging level of the syslog messages for VM Tracker.

      Enabling Virtual Machine Tracker on Specific Interfaces

      When VM Tracker is enabled by using the [no] feature vmtracker command, it is enabled on all interfaces by default. You can optionally disable and enable it on specific interfaces by using the [no] vmtracker enable command.

      SUMMARY STEPS

        1.    switch# configure terminal

        2.    switch(config)# interface type slot/port

        3.    switch(config-if)# [no] vmtracker enable


      DETAILED STEPS
         Command or ActionPurpose
        Step 1switch# configure terminal  

        Enters global configuration mode.

         
        Step 2switch(config)# interface type slot/port  

        Enters the interface configuration mode for the specified interface.

         
        Step 3switch(config-if)# [no] vmtracker enable  

        Enables the VM Tracker feature on the specified interface.

        The no form of the command disables the VM Tracker feature on the specified interface.

         

        This example shows how to enable VM Tracker on a specified interface:

        switch# configure terminal
        switch(config)# interface ethernet 1/3/1
        switch(config-if)# vmtracker enable

        Configuring Dynamic VLAN Creation

        Enabling Dynamic VLAN Creation

        Dynamic creation and deletion of VLANs globally is enabled by default. When dynamic VLAN creation is enabled, if a VM is moved from one host to another and the VLAN required for this VM does not exist on the switch, the required VLAN is automatically created on the switch. You can also disable this capability. However, if you disable dynamic VLAN creation, you must manually create all the required VLANs.

        Before You Begin

        Ensure that the VM Tracker feature is enabled.

        SUMMARY STEPS

          1.    switch# configure terminal

          2.    switch(config)# vmtracker connection connection-name

          3.    switch(config-vmt-conn)# [no] autovlan enable


        DETAILED STEPS
           Command or ActionPurpose
          Step 1 switch# configure terminal
           

          Enters global configuration mode.

           
          Step 2switch(config)# vmtracker connection connection-name
           

          Enters VM Tracker connection configuration mode for the connection name specified.

           
          Step 3switch(config-vmt-conn)# [no] autovlan enable
           

          Enables dynamic VLAN creation and deletion.

          The no form of the command disables dynamic VLAN creation and deletion.

           

          This example shows how to enable dynamic VLAN creation:

          switch# configure terminal
          switch(config)# vmtracker connection conn1
          switch(config-vmt-conn)# autovlan enable

          Configuring an Allowed VLAN List

          By default, all VLANs can be configured dynamically on interfaces. You can also define a restricted list of such VLANs.

          Before You Begin

          Ensure that the VM Tracker feature is enabled.

          SUMMARY STEPS

            1.    switch# configure terminal

            2.    switch(config)# vmtracker connection connection-name

            3.    switch(config-vmt-conn)# allowed-vlans {allow-vlans | add add-vlans | except except-vlans | remove remove-vlans | all}


          DETAILED STEPS
             Command or ActionPurpose
            Step 1 switch# configure terminal
             

            Enters global configuration mode.

             
            Step 2switch(config)# vmtracker connection connection-name
             

            Enters VM Tracker connection configuration mode for the connection name specified.

             
            Step 3switch(config-vmt-conn)# allowed-vlans {allow-vlans | add add-vlans | except except-vlans | remove remove-vlans | all}
             

            Configures a list of VLANs that can be dynamically configured on interfaces.

             

            This example shows how to configure a list of allowed VLANs:

            switch# configure terminal
            switch(config)# vmtracker connection test
            switch(config-vmt-conn)# allowed-vlans 100-101
            

            Example Configuration for Virtual Machine Tracker

            This example shows how to create a connection with vCenter:

            switch# configure terminal
            switch(config)# feature vmtracker
            switch(config)# vmtracker connection test
            switch(config-vmt-conn)# remote ip address 20.1.1.1 port 80 vrf management
            switch(config-vmt-conn)# username user1 password abc@123
            switch(config-vmt-conn)# connect
            switch(config-vmt-conn)# show vmtracker status
            
            
            Connection           Host/IP                             status
            -----------------------------------------------------------------------------
            test                 20.1.1.1                      						Connected
            
            switch(config-vmt-conn)# show vmtracker info detail
            ------------------------------------------------------------------------------
            Interface       Host            VMNIC   VM         State PortGroup  VLAN-Range
            ------------------------------------------------------------------------------
            Ethernet1/3/1   20.2.2.2  						vmnic4  No-OS1     on    PGroup100  100
            
            ------------------------------------------------------------------------------
            
            
            switch(config-vmt-conn)# show running-config vmtracker
            !Command: show running-config vmtracker
            !Time: Mon Mar 10 09:07:47 2014
            version 6.0(2)U3(1)
            feature vmtracker
            vmtracker connection test
            remote ip address 20.1.1.1 port 80
            username user1 password abc@123
            connect
            
            
            switch(config-vmt-conn)# show running-config interface ethernet 1/3/1
            !Command: show running-config interface Ethernet1/3/1
            !Time: Mon Mar 10 09:09:13 2014
            version 6.0(2)U3(1)
            interface Ethernet1/3/1
            switchport mode trunk
            switchport trunk allowed vlan 1,100
            
            
            

            Note


            VLAN 1 is the native VLAN on interface Ethernet1/3/1.

            This example shows how to verify VM Tracker information after you power off the VM on vCenter:

            switch(config-vmt-conn)# show vmtracker info detail
            ------------------------------------------------------------------------------
            Interface       Host            VMNIC   VM         State PortGroup  VLAN-Range
            ------------------------------------------------------------------------------
            Ethernet1/3/1   20.2.2.2  						vmnic4  No-OS1     off   PGroup100  100
            
            ------------------------------------------------------------------------------
            
            
            switch(config-vmt-conn)# show running-config interface ethernet 1/3/1
            !Command: show running-config interface Ethernet1/3/1
            !Time: Mon Mar 10 09:09:13 2014
            version 6.0(2)U3(1)
            interface Ethernet1/3/1
            switchport mode trunk
            switchport trunk allowed vlan 1, 100
            
            
            
            

            This example shows how to verify VM Tracker information after you add a new VLAN through vCenter:

            switch(config-vmt-conn)# show vmtracker info detail
            ------------------------------------------------------------------------------
            Interface       Host            VMNIC   VM         State PortGroup  VLAN-Range
            ------------------------------------------------------------------------------
            Ethernet1/3/1   20.2.2.2  						vmnic4  No-OS1     on    PGroup100  100
            Ethernet1/3/1   20.2.2.2  						vmnic4  No-OS1     on    PGroup103  103
            
            ------------------------------------------------------------------------------
            
            
            switch(config-vmt-conn)# show running-config interface ethernet 1/3/1
            !Command: show running-config interface Ethernet1/3/1
            !Time: Mon Mar 10 09:11:06 2014
            version 6.0(2)U3(1)
            interface Ethernet1/3/1
            switchport mode trunk
            switchport trunk allowed vlan 1,100,103
            
            
            

            This example shows how verify VM Tracker event-history information:

            switch(config-vmt-conn)# show vmtracker event-history
            ------------------------------------------------------------------------------
            Event History (Connection:test NumEv:6 IP:20.1.1.1)
            ------------------------------------------------------------------------------
            EventId    Event Msg
            ------------------------------------------------------------------------------
            77870      Reconfigured No-OS1 on 20.2.2.2 in N3K-VM
            77867      No-OS1 on  20.2.2.2 in N3K-VM is powered on
            77863      Reconfigured No-OS1 on 20.2.2.2 in N3K-VM
            77858      No-OS1 on  20.2.2.2 in N3K-VM is powered off
            
            
            

            This example shows how to disconnect from vCenter:

            switch(config)# vmtracker connection test
            switch(config-vmt-conn)# no connect
            switch(config-vmt-conn)# show vmtracker status
            Connection           Host/IP                             status
            -----------------------------------------------------------------------------
            test                 20.1.1.1						                      No Connect
            
            switch(config-vmt-conn)# sh running-config interface ethernet 1/3/1
            !Command: show running-config interface Ethernet1/3/1
            !Time: Mon Mar 10 09:15:43 2014
            version 6.0(2)U3(1)
            interface Ethernet1/3/1
            switchport mode trunk
            switchport trunk allowed vlan 1
            
            switch(config-vmt-conn)# show vmtracker info detail
            ------------------------------------------------------------------------------
            Interface       Host            VMNIC   VM         State PortGroup  VLAN-Range
            ------------------------------------------------------------------------------
            
            ------------------------------------------------------------------------------