On this page
ovirt - oVirt/RHEV platform management
New in version 1.4.
Synopsis
- This module only supports oVirt/RHEV version 3. A newer module ovirt_vms supports oVirt/RHV version 4.
 - Allows you to create new instances, either from scratch or an image, in addition to deleting or stopping instances on the oVirt/RHEV platform.
 
Requirements
The below requirements are needed on the host that executes this module.
- ovirt-engine-sdk-python
 
Parameters
| Parameter | Choices/Defaults | Comments | 
|---|---|---|
| disk_alloc | 
       
  | 
      
        
        Define whether disk is thin or preallocated.
         | 
     
| disk_int | 
       
  | 
      
        
        Interface type of the disk.
         | 
     
| image | 
        
        The template to use for the instance.
         | 
     |
| instance_cores | Default: 
        1
         | 
      
        
        Define the instance's number of cores.
        
       aliases: vmcores  | 
     
| instance_cpus | Default: 
        1
         | 
      
        
        The instance's number of CPUs.
        
       aliases: vmcpus  | 
     
| instance_disksize | 
        
        Size of the instance's disk in GB.
        
       aliases: vm_disksize  | 
     |
| instance_dns  
        (added in 2.1)
         | 
      
        
        Define the instance's Primary DNS server.
        
       aliases: dns  | 
     |
| instance_domain  
        (added in 2.1)
         | 
      
        
        Define the instance's Domain.
        
       aliases: domain  | 
     |
| instance_hostname  
        (added in 2.1)
         | 
      
        
        Define the instance's Hostname.
        
       aliases: hostname  | 
     |
| instance_ip  
        (added in 2.1)
         | 
      
        
        Define the instance's IP.
        
       aliases: ip  | 
     |
| instance_key  
        (added in 2.1)
         | 
      
        
        Define the instance's Authorized key.
        
       aliases: key  | 
     |
| instance_mem | 
        
        The instance's amount of memory in MB.
        
       aliases: vmmem  | 
     |
| instance_name  
        required
         | 
      
        
        The name of the instance to use.
        
       aliases: vmname  | 
     |
| instance_netmask  
        (added in 2.1)
         | 
      
        
        Define the instance's Netmask.
        
       aliases: netmask  | 
     |
| instance_network | Default: 
        "rhevm"
         | 
      
        
        The logical network the machine should belong to.
        
       aliases: vmnetwork  | 
     
| instance_nic | 
        
        The name of the network interface in oVirt/RHEV.
        
       aliases: vmnic  | 
     |
| instance_os | 
        
        Type of Operating System.
        
       aliases: vmos  | 
     |
| instance_rootpw  
        (added in 2.1)
         | 
      
        
        Define the instance's Root password.
        
       aliases: rootpw  | 
     |
| instance_type | 
       
  | 
      
        
        Define whether the instance is a server, desktop or high_performance.
        
       
        high_performance is supported since Ansible 2.5 and oVirt/RHV 4.2.
        
       aliases: vmtype  | 
     
| password  
        required
         | 
      
        
        Password of the user to authenticate with.
         | 
     |
| region | 
        
        The oVirt/RHEV datacenter where you want to deploy to.
         | 
     |
| resource_type | 
       
  | 
      
        
        Whether you want to deploy an image or create an instance from scratch.
         | 
     
| sdomain | 
        
        The Storage Domain where you want to create the instance's disk on.
         | 
     |
| state | 
       
  | 
      
        
        Create, terminate or remove instances.
         | 
     
| url  
        required
         | 
      
        
        The url of the oVirt instance.
         | 
     |
| user  
        required
         | 
      
        
        The user to authenticate with.
         | 
     |
| zone | 
        
        Deploy the image to this oVirt cluster.
         | 
     
Examples
- name: Basic example to provision from image
  ovirt:
    user: admin@internal
    url: https://ovirt.example.com
    instance_name: ansiblevm04
    password: secret
    image: centos_64
    zone: cluster01
    resource_type: template
- name: Full example to create new instance from scratch
  ovirt:
    instance_name: testansible
    resource_type: new
    instance_type: server
    user: admin@internal
    password: secret
    url: https://ovirt.example.com
    instance_disksize: 10
    zone: cluster01
    region: datacenter1
    instance_cpus: 1
    instance_nic: nic1
    instance_network: rhevm
    instance_mem: 1000
    disk_alloc: thin
    sdomain: FIBER01
    instance_cores: 1
    instance_os: rhel_6x64
    disk_int: virtio
- name: Stopping an existing instance
  ovirt:
    instance_name: testansible
    state: stopped
    user: admin@internal
    password: secret
    url: https://ovirt.example.com
- name: Start an existing instance
  ovirt:
    instance_name: testansible
    state: started
    user: admin@internal
    password: secret
    url: https://ovirt.example.com
- name: Start an instance with cloud init information
  ovirt:
    instance_name: testansible
    state: started
    user: admin@internal
    password: secret
    url: https://ovirt.example.com
    hostname: testansible
    domain: ansible.local
    ip: 192.0.2.100
    netmask: 255.255.255.0
    gateway: 192.0.2.1
    rootpw: bigsecret
  Status
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Maintenance
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Author
- Vincent Van der Kussen (@vincentvdk)
 
Hint
If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
 https://docs.ansible.com/ansible/2.6/modules/ovirt_module.html