W3cubDocs

/Ansible

ovirt - oVirt/RHEV platform management

New in version 1.4.

Synopsis

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 (on host that executes module)

  • python >= 2.6
  • ovirt-engine-sdk-python

Options

parameter required default choices comments
disk_alloc
no thin
  • thin
  • preallocated
define if disk is thin or preallocated
disk_int
no virtio
  • virtio
  • ide
interface type of the disk
image
no
template to use for the instance
instance_cores
no 1
define the instance's number of cores
aliases: vmcores
instance_cpus
no 1
the instance's number of cpu's
aliases: vmcpus
instance_disksize
no
size of the instance's disk in GB
aliases: vm_disksize
instance_dns
(added in 2.1)
no
define the instance's Primary DNS server
aliases: dns
instance_domain
(added in 2.1)
no
define the instance's Domain
aliases: domain
instance_hostname
(added in 2.1)
no
define the instance's Hostname
aliases: hostname
instance_ip
(added in 2.1)
no
define the instance's IP
aliases: ip
instance_key
(added in 2.1)
no
define the instance's Authorized key
aliases: key
instance_mem
no
the instance's amount of memory in MB
aliases: vmmem
instance_name
yes
the name of the instance to use
aliases: vmname
instance_netmask
(added in 2.1)
no
define the instance's Netmask
aliases: netmask
instance_network
no rhevm
the logical network the machine should belong to
aliases: vmnetwork
instance_nic
no
name of the network interface in oVirt/RHEV
aliases: vmnic
instance_os
no
type of Operating System
aliases: vmos
instance_rootpw
(added in 2.1)
no
define the instance's Root password
aliases: rootpw
instance_type
no server
  • server
  • desktop
define if the instance is a server or desktop
aliases: vmtype
password
yes
password of the user to authenticate with
region
no
the oVirt/RHEV datacenter where you want to deploy to
resource_type
no
  • new
  • template
whether you want to deploy an image or create an instance from scratch.
sdomain
no
the Storage Domain where you want to create the instance's disk on.
state
no present
  • present
  • absent
  • shutdown
  • started
  • restarted
create, terminate or remove instances
url
yes
the url of the oVirt instance
user
yes
the user to authenticate with
zone
no
deploy the image to this oVirt cluster

Examples

# Basic example provisioning from image.

ovirt:
    user: [email protected]
    url: https://ovirt.example.com
    instance_name: ansiblevm04
    password: secret
    image: centos_64
    zone: cluster01
    resource_type: template"

# Full example to create new instance from scratch
ovirt:
    instance_name: testansible
    resource_type: new
    instance_type: server
    user: [email protected]
    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"

# stopping an instance
ovirt:
    instance_name: testansible
    state: stopped
    user: [email protected]
    password: secret
    url: https://ovirt.example.com

# starting an instance
ovirt:
    instance_name: testansible
    state: started
    user: [email protected]
    password: secret
    url: https://ovirt.example.com

# starting an instance with cloud init information
ovirt:
    instance_name: testansible
    state: started
    user: [email protected]
    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

This is an Extras Module

For more information on what this means please read Extras Modules

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/ovirt_module.html