HP BL680c XenServer Administrator's Guide 4.1.0 - Page 39

Connecting Virtual Machines VMs to networks, 2.3. Creating VLANs

Page 39 highlights

Networking 4.2.2. Connecting Virtual Machines (VMs) to networks When a new VM is created via the CLI, it does not contain a virtual network interface (VIF). Adding a VIF and connecting it to the desired network must be done as additional steps. When creating VMs using XenCenter, the New VM wizard contains a page allowing creation of virtual network interfaces. Procedure 4.2. To add a new virtual interface to a VM via the CLI 1. Use xe vm-list to find the UUID of the VM to which you want to add the VIF. For example, if the VM is named windows, issue the following command to return the UUID of the VM: xe vm-list params=uuid name-label=windows 2. Add a VIF to the VM with the vif-create command, specifying the VM and network UUIDs. The UUID of the new virtual interface will be returned: xe vif-create vm-uuid= network-uuid= device=0 The device parameter is a number which uniquely identifies the virtual NIC (0, 1, 2, etc.) to a VM. 3. VIFs are automatically plugged into VMs when a VM is started, but if the VM is already running when the VIF is created, the VIF must be manually connected, or hot-plugged. Hot-plugging VIFs requires the XenServer Tools to be installed in the VM. Refer to the XenServer Virtual Machine Installation Guide for details on installing the XenServer Tools. To hot-plug a VIF to a VM use the vif-plug command: xe vif-plug uuid= 4.2.3. Creating VLANs Virtual Local Area Networks (VLANs) allow a single physical network to support multiple logical networks. To use VLANs with XenServer, the host's NIC must be connected to a VLAN trunk port. XenServer VLANs are represented by additional PIFs corresponding to a specified VLAN tag. XenServer networks can then be connected to the PIF representing the physical NIC to see all traffic on the NIC, or to a PIF representing a VLAN to see only the traffic with the specified VLAN tag. When using VLANs the XenServer Host handles all interpretation of the VLAN tags and does not include VLAN tags in packets routed to VMs. Procedure 4.3. To connect a network to an external VLAN via the CLI 1. Open the XenServer Host text console. 2. Create a new network for use with the VLAN. The UUID of the new network is returned: xe network-create name-label=network5 3. Use the pif-list command to find the UUID of the PIF corresponding to the physical NIC supporting the desired VLAN tag. The UUIDs and device names of all PIFs are returned, including any existing VLANs: 33

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108

Networking
33
4.2.2. Connecting Virtual Machines (VMs) to networks
When a new VM is created via the CLI, it does not contain a virtual network interface (VIF). Adding a VIF and
connecting it to the desired network must be done as additional steps. When creating VMs using XenCenter,
the New VM wizard contains a page allowing creation of virtual network interfaces.
Procedure 4.2. To add a new virtual interface to a VM via the CLI
1.
Use
xe vm-list
to find the UUID of the VM to which you want to add the VIF. For example, if the VM is
named
windows
, issue the following command to return the UUID of the VM:
xe vm-list params=uuid name-label=windows
2.
Add a VIF to the VM with the
vif-create
command, specifying the VM and network UUIDs. The UUID
of the new virtual interface will be returned:
xe vif-create vm-uuid=<VM UUID> network-uuid=<network UUID> device=0
The device parameter is a number which uniquely identifies the virtual NIC (0, 1, 2, etc.) to a VM.
3.
VIFs are automatically plugged into VMs when a VM is started, but if the VM is already running when
the VIF is created, the VIF must be manually connected, or
hot-plugged
. Hot-plugging VIFs requires the
XenServer Tools to be installed in the VM. Refer to the
XenServer Virtual Machine Installation Guide
for details on installing the XenServer Tools. To hot-plug a VIF to a VM use the vif-plug command:
xe vif-plug uuid=<VIF UUID>
4.2.3. Creating VLANs
Virtual Local Area Networks (VLANs) allow a single physical network to support multiple logical networks.
To use VLANs with XenServer, the host's NIC must be connected to a VLAN trunk port.
XenServer VLANs are represented by additional PIFs corresponding to a specified VLAN tag. XenServer
networks can then be connected to the PIF representing the physical NIC to see all traffic on the NIC, or to
a PIF representing a VLAN to see only the traffic with the specified VLAN tag.
When using VLANs the XenServer Host handles all interpretation of the VLAN tags and does not include
VLAN tags in packets routed to VMs.
Procedure 4.3. To connect a network to an external VLAN via the CLI
1.
Open the XenServer Host text console.
2.
Create a new network for use with the VLAN. The UUID of the new network is returned:
xe network-create name-label=network5
3.
Use the
pif-list
command to find the UUID of the PIF corresponding to the physical NIC supporting the
desired VLAN tag. The UUIDs and device names of all PIFs are returned, including any existing VLANs: