nic.rst 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. .. _vm-nic-profiles:
  2. ================================
  3. Virtual Machine Network Profiles
  4. ================================
  5. Salt Virt allows for the network devices created for deployed virtual machines
  6. to be finely configured. The configuration is a simple data structure which is
  7. read from the ``config.option`` function, meaning that the configuration can be
  8. stored in the minion config file, the master config file, or the minion's
  9. pillar.
  10. This configuration option is called ``virt:nic``. By default the ``virt:nic``
  11. option is empty but defaults to a data structure which looks like this:
  12. .. code-block:: yaml
  13. virt:
  14. nic:
  15. default:
  16. eth0:
  17. bridge: br0
  18. model: virtio
  19. .. note::
  20. The model does not need to be defined, Salt will default to the optimal
  21. model used by the underlying hypervisor, in the case of kvm this model
  22. is :strong:`virtio`
  23. This configuration sets up a network profile called default. The default
  24. profile creates a single Ethernet device on the virtual machine that is bridged
  25. to the hypervisor's :strong:`br0` interface. This default setup does not
  26. require setting up the ``virt:nic`` configuration, and is the reason why a
  27. default install only requires setting up the :strong:`br0` bridge device on the
  28. hypervisor.
  29. Define More Profiles
  30. ====================
  31. Many environments will require more complex network profiles and may require
  32. more than one profile, this can be easily accomplished:
  33. .. code-block:: yaml
  34. virt:
  35. nic:
  36. dual:
  37. eth0:
  38. bridge: service_br
  39. eth1:
  40. bridge: storage_br
  41. single:
  42. eth0:
  43. bridge: service_br
  44. triple:
  45. eth0:
  46. bridge: service_br
  47. eth1:
  48. bridge: storage_br
  49. eth2:
  50. bridge: dmz_br
  51. all:
  52. eth0:
  53. bridge: service_br
  54. eth1:
  55. bridge: storage_br
  56. eth2:
  57. bridge: dmz_br
  58. eth3:
  59. bridge: database_br
  60. dmz:
  61. eth0:
  62. bridge: service_br
  63. eth1:
  64. bridge: dmz_br
  65. database:
  66. eth0:
  67. bridge: service_br
  68. eth1:
  69. bridge: database_br
  70. This configuration allows for one of six profiles to be selected, allowing
  71. virtual machines to be created which attach to different network depending
  72. on the needs of the deployed vm.