Guest Environments Bundles and Bodies

Table of Contents

See the guest_environments promises documentation for a comprehensive reference on the body types and attributes used here.

To use these bodies, add the following to your policy:

body file control
    inputs => { "" }

environment_resources bodies


Prototype: kvm(name, arch, cpu_count, mem_kb, disk_file)

Description: An environment_resources body for a KVM virtual machine.

The env_spec attribute is set to a KVM XML specification.


  • name: The name of the virtual machine
  • arch: The architecture
  • cpu_count: The number of CPUs the virtual machine should have
  • mem_kb: The amount of RAM in kilobyte
  • disk_file: The file on the host system for the virtual machine's harddrive


bundle agent manage_vm
      environment_host      => atlas,
      environment_type      => "kvm",
      environment_state     => "create",
      environment_resources => kvm("PSQL1, "x86_64", "4", "4096", "/var/lib/libvirt/images/psql1.iso")


body environment_resources kvm(name, arch, cpu_count, mem_kb, disk_file)
      env_spec =>
      "<domain type='kvm'>
    <type arch='$(arch)'>hvm</type>
    <disk type='file' device='disk'>
      <source file='$(disk_file)'/>
      <target dev='vda' bus='virtio'/>
    <interface type='network'>
      <source network='default'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>