Insights, news and announcements for Oracle Systems products

Ansible: Automate and Accelerate Deployments on Oracle Private Cloud Appliance

Sonit Tayal
Principal Product Manager

We are excited to announce that you can now use Ansible playbooks to automate repeatable IT tasks (like creating and deleting Virtual Machines, deploying databases and applications) on Oracle Private Cloud Appliance 2.3.1 and Oracle VM 3.4 and newer. Automation is a key requirement for achieving cloud like agility and Ansible is the tool of choice to automate and accelerate provisioning, configuration management and application deployment on remote systems. 

Ansible is an open-source IT automation engine that automates provisioning, configuration management, application deployment on remote systems. It is an agentless automation solution that works by executing code blocks called "modules" on remote systems over SSH and uses YAML based "playbooks" to describe automation jobs.

Why Ansible?

  • Ansible is the de-facto tool for cloud automation and can be used for automating deployments across Oracle PCA, Oracle VM and Oracle ZFSSA.
  • It is Agentless, which means it just needs to be installed on a central “Control Machine” and interfaces with the Oracle VM REST API to control deployments on PCA
  • It saves time and effort, so reduces OpEx – One of our retail customers saw savings of up to 90% in database deployment times on PCA with Ansible
  • Ansible playbook are a lightweight evolution of Oracle VM Templates

How does it work?

Ansible manages configuration and application deployment on the Oracle Private Cloud Applinace by connecting to the REST APIs for Oracle VM Manager (accessible by HTTPS over port 7002 as shown in figure).

Fig: Architecture diagram for Ansible managing Oracle PCA (Oracle VM 3.4)

The setup requires the following components:

  • Control Machine: The central machine where Ansible is installed. It is an Oracle Linux 7 system with Ansible package installed from ol7_developer_EPEL yum repository
  • Managed Nodes: The remote machines that Ansible communicates with and automates tasks on. PCA Management Node would be the managed node in this case. You must have a PCA 2.3.1 or newer for using this version of the REST APIs

Automating Infrastructure Lifecycle Management on PCA

The first custom Ansible module in a series of planned Infrastructure Lifecycle Management modules is now available for Oracle Private Cloud Appliance and Oracle VM. The Ansible module and accompanying playbooks automate

  • Creation of VMs attached to VNICs and disks of desired specifications
  • Deletion of an existing VM along with all the attached disks
  • Starting and stopping VMs 

Step-by-step procedures to execute the module on Oracle Private Cloud Appliance are in this whitepaper


  • Deploy a VM with 2 disks and 2 VNICs in 9 seconds as opposed to ~50 seconds using OVM GUI
  • Reduce DB deployment times by 90%
    This module can be used in conjunction with playbooks to automate deployment of DBs and applications.

Where to download from?

The Ansible module and accompanying playbooks can be downloaded as an RPM from OTN

Join the discussion

Comments ( 4 )
  • Philip Weston Saturday, November 9, 2019

    I have been trying to get the code in the white paper to run using Oracle Linux 7.7 on the ansible master and also the OVM manager but I keep getting this error:
    TASK [create VM] ********************************************************************
    fatal: []: FAILED! => {"changed": false, "module_stderr": "Shared connection to closed.rn", "module_stdout": "Traceback (most recent call last):rn File "/root/.ansible/tmp/ansible-tmp-1573319383.13-227803732298174/AnsiballZ_ovmm_vm.py", line 114, in rn _ansiballz_main()rn File "/root/.ansible/tmp/ansible-tmp-1573319383.13-227803732298174/AnsiballZ_ovmm_vm.py", line 106, in _ansiballz_mainrn invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)rn File "/root/.ansible/tmp/ansible-tmp-1573319383.13-227803732298174/AnsiballZ_ovmm_vm.py", line 49, in invoke_modulern imp.load_module('__main__', mod, module, MOD_DESC)rn File "/tmp/ansible_ovmm_vm_payload_FbMm5r/__main__.py", line 139, in rnImportError: No module named requests.packages.urllib3rn", "msg": "MODULE FAILUREnSee stdout/stderr for the exact error", "rc": 1}

    PLAY RECAP **************************************************************************

    Any idea what the problem is ?

    Many Thanks

    Phil Weston
  • Muhsin Tawafig Friday, January 24, 2020
    Excellent presentation. Although after going through the details and features of the module it proved to be very primitive . For example unable to take a template and add customize the network among the other available features provided by OVM guest tools .
    At the end I had to rewire it so it carries as much flexibility as possible more in the spirit of the Vmware and Ovirt VM life cycle modules .
  • Sonit Tayal Friday, January 24, 2020
    Hi Philip,
    I feel that your Ansible Control Machine doesn't have python-requests and urllib3.

    Please see Appendix 1 of white paper: https://www.oracle.com/technetwork/server-storage/vm/ansiblevmlifecyclemodule-5106627.pdf

    Prerequisites for Ansible Control Machine

    The following packages need to be installed on the Ansible Control Machine in order to initiate REST calls to PCA:

    Requests: HTTP library for python. Installed using$ yum install python-requests

    urllib3: HTTP client of python used by Requests to keep sessions aliveand HTTP connection pooling. Installed using $ yum install python-urllib3
  • Sonit Tayal Friday, January 24, 2020
    Hi Muhsin,
    I published an update to the Ansible module in November 2019 announced in this blog: https://blogs.oracle.com/oracle-systems/new-ansible-module%3a-automate-cloning-of-vms-on-oracle-private-cloud-appliance

    We are excited to announce a new Ansible module and playbooks to automate deployments on Oracle Private Cloud Appliance. This new module uses Ansible to automate cloning of Oracle VM Templates and VM Virtual Appliances (*.ova) to create and configure virtual machines on PCA. The functionality expands on the previously released Ansible modules and playbooks announced in this blog.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.