How do I get started with the command line interface for Oracle VM Manager?
Answer by Gregory King, Principal Best Practices Consultant, Oracle VM Product Management:
Oracle VM 3 ships with an automation tool that system administrators are going to love! Beginning with the latest version of 3.2, our Oracle VM 3 product comes with a built-in command line interface (CLI) that allows system administrators to create automated solutions using their favorite shell or scripting language. For example, you can create a bash or ksh script using calls to the CLI to gather information about objects and attributes managed by the Oracle VM Manager. You can also include CLI calls to change objects and attributes as well as initiate tasks such as putting a server into maintenance mode and then starting a software update using our built-in Server Update Manager.
Check Your Access to the CLI
The CLI is started automatically when the Oracle VM Manager is started during boot or whenever you execute “service ovmm start” on the server where Oracle VM Manager is installed. Test the ability to connect to the CLI first by logging in using ssh. You can execute the ssh session from any server with an ssh client – you should really test the login from the server where the automation scripts will reside. Perhaps you want to write the scripts and keep them on the same server where Oracle VM Manager is installed or perhaps you want to keep the scripts on a management/administration server where you keep all your other management scripts – the choice is really up to you.
Let’s assume for our example you are going to keep the scripts on a Linux server named “myserver”. Simply execute the ssh command shown below to test your login. The CLI will prompt you for a password – this is the same password you use for the admin user when you log into the Oracle VM Manager.
You can see a list of available commands by typing either help or “?” at the command prompt as shown below.
You will most likely want to add ssh keys on the Oracle VM Management server to allow your script to execute without prompting for a password. If your scripts are going to be executed as root from myserver, then add the public keys from myserver:/root/.ssh/*.pub into a single file named ovmcli_authorized_keys and copy the file to the oracle home directory on mymanager:/home/oracle/.ssh/ovmcli_authorized_keys. Make sure the ovmcli_authorized_keys file is owned by oracle and the group is dba – I always change the permissions to 644, but I’m not sure that is actually needed. The CLI will prompt for a password the first time after copying the file to that directory, but will not prompt again afterwards.
Thanks Greg. For more information on Oracle VM 3.2, have a read through Honglin's excellent blog entry on this very blog.
We'll see you next week!