If you hate the Oracle OVM CLI and having to use expect scripts you may want to look into the web services API. Note it looks like SOAP will be decommissioned soon so use REST.
s.auth = ( 'admin' , 'pwd_removed' ) |
s.headers.update({ 'Accept' : 'application/json' , 'Content-Type' : 'application/json' }) |
baseUri = 'https://ovmm:7002/ovm/core/wsapi/rest' |
r = s.get(baseUri + '/Server' ) |
print '{:20} {:20}' . format (i[ 'serverRunState' ],i[ 'name' ]) |
print '{:20} {:20}' . format (i[ 'vmRunState' ],i[ 'name' ]) |
Output:
$ python ovm_using_rest.py |
/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py:794: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html |
TEMPLATE EXALYTICS_BASE_LINUX_OEL5_GUEST_VM_TEMPLATE_2.2.0.0.0.el5 |
TEMPLATE EXALYTICS_BASE_LINUX_OEL6_GUEST_VM_TEMPLATE_2.2.0.0.0.el6 |
STOPPED EXALYTICS_BASE_LINUX_OEL5_GUEST_VM_TEMPLATE_2.0.1.4.0 |
TEMPLATE OBIEE12C_TEMPLATE.0 |