How to add an additional vif to VM in XenServer

Last updated on September 15, 2020 by Dan Nanni

XenServer allows us to dynamically create and attach new resources such as virtual network interfaces or disk storage to an existing VM. For this, you can use the xe command line, which is available in XenCenter or on standalone Linux as part of xAPI. In the following, I describe how you can add an additiona virtual network interface (vif) to a XenServer VM.

Here I assume that you know the name-label of the VM.

Create a network for the new interface to be attached to with the following command. It will return the UUID of the created network (network-uuid). Remember network-uuid as it is used later.

$ xe network-create name-label="alice-network"

Find out UUID of the VM (vm-uuid) with the following command.

$ xe vm-list name-label=<vm's name-label>

Create eth1 interface for the VM by using network-uuid and vm-uuid information with the following command. Upon success, this will return the UUID of the new interface (vif-uuid).

$ xe vif-create vm-uuid=<vm-uuid> network-uuid=<network-uuid> device=1 mac=random

Finally, hot-plug the created interface to the VM.

$ xe vif-plug uuid=<vif-uuid>

Now eth1 should be visible from inside the VM.

Note that you still need to configure eth1 from within VM to make it active.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean