disk.rst 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. =============================
  2. Virtual Machine Disk Profiles
  3. =============================
  4. Salt Virt allows for the disks created for deployed virtual machines
  5. to be finely configured. The configuration is a simple data structure which is
  6. read from the ``config.option`` function, meaning that the configuration can be
  7. stored in the minion config file, the master config file, or the minion's
  8. pillar.
  9. This configuration option is called ``virt.disk``. The default ``virt.disk``
  10. data structure looks like this:
  11. .. code-block:: yaml
  12. virt.disk:
  13. default:
  14. - system:
  15. size: 8192
  16. format: qcow2
  17. model: virtio
  18. .. note::
  19. The format and model does not need to be defined, Salt will
  20. default to the optimal format used by the underlying hypervisor,
  21. in the case of kvm this it is :strong:`qcow2` and
  22. :strong:`virtio`.
  23. This configuration sets up a disk profile called default. The default
  24. profile creates a single system disk on the virtual machine.
  25. Define More Profiles
  26. ====================
  27. Many environments will require more complex disk profiles and may require
  28. more than one profile, this can be easily accomplished:
  29. .. code-block:: yaml
  30. virt.disk:
  31. default:
  32. - system:
  33. size: 8192
  34. database:
  35. - system:
  36. size: 8192
  37. - data:
  38. size: 30720
  39. web:
  40. - system:
  41. size: 1024
  42. - logs:
  43. size: 5120
  44. This configuration allows for one of three profiles to be selected,
  45. allowing virtual machines to be created with different storage needs
  46. of the deployed vm.