qemu.pp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # == Class: nova::migration::qemu
  2. #
  3. # Sets qemu config that is required for migration
  4. #
  5. # === Parameters:
  6. #
  7. # [*configure_qemu*]
  8. # (optional) Whether or not configure qemu bits.
  9. # Defaults to false.
  10. #
  11. # [*migration_port_min*]
  12. # (optional) Lower limit of port range used for migration.
  13. # Defaults to 49152.
  14. #
  15. # [*migration_port_max*]
  16. # (optional) Higher limit of port range used for migration.
  17. # Defaults to 49215.
  18. #
  19. class nova::migration::qemu(
  20. $configure_qemu = false,
  21. $migration_port_min = 49152,
  22. $migration_port_max = 49215,
  23. ){
  24. include ::nova::deps
  25. Anchor['nova::config::begin']
  26. -> Augeas<| tag == 'qemu-conf-augeas'|>
  27. -> Anchor['nova::config::end']
  28. Augeas<| tag == 'qemu-conf-augeas'|>
  29. ~> Service['libvirt']
  30. if $configure_qemu {
  31. augeas { 'qemu-conf-migration-ports':
  32. context => '/files/etc/libvirt/qemu.conf',
  33. changes => [
  34. "set migration_port_min ${migration_port_min}",
  35. "set migration_port_max ${migration_port_max}",
  36. ],
  37. tag => 'qemu-conf-augeas',
  38. }
  39. } else {
  40. augeas { 'qemu-conf-migration-ports':
  41. context => '/files/etc/libvirt/qemu.conf',
  42. changes => [
  43. 'rm migration_port_min',
  44. 'rm migration_port_max',
  45. ],
  46. tag => 'qemu-conf-augeas',
  47. }
  48. }
  49. }