[Users] Add NIC directly to VM (Dedicated)
Dan Kenigsberg
danken at redhat.com
Sun Feb 10 12:13:15 UTC 2013
On Sun, Feb 10, 2013 at 12:19:57PM +0100, Matt . wrote:
> Hi,
>
> For setting up a firewall in a VM I would like to add 2 of my 4 nics
> directly to a VM.
>
> In my previous setup I thought I have done that, but at the moment I cannot
> figure this out and cannot find the docs to accomplish this.
>
> I would like to dedicate those 2 nics to my firewall VM's to avoid sharing
> them using a network per accident to other VM's.
>
> How is this be done at the moment ?
AFAIK it can be done only with a vdsm hook. You'd need to define your VM
with no interface at all, but instead, mark it with a special custom
property you define. Then, you should write a hook that adds the two
host interfaces to the VM, by means of either
http://libvirt.org/formatdomain.html#elementsNICSDirect or
http://libvirt.org/formatdomain.html#elementsNICSHostdev
Most probably, you would need to pin your firewall VM to a specific
host.
Writing a hook is not too complex, but it requires understanding of how
vdsm and libvirt works. You can take
http://gerrit.ovirt.org/gitweb?p=vdsm.git;a=tree;f=vdsm_hooks/vmfex as a
reference, or ask for specific guidance here.
Dan.
More information about the Users
mailing list