MetaCloud access through command line
THIS PART OF WIKI IS OUTDATED AND UNDER CONSTRUCTION. PLEASE BE PATIENT.
ONE tools
Prerequisite: OpenNebula account
ONE tools are part of OpenNebula client tools, which are distributed as part of OpenNebula system. It is a set of unix command line utilities, written in Ruby, providing an alternative to Sunstone interface. After first installation and setup are OpenNebula client tools ready and there is no need to install them again in the future. OpenNebula client tools consists of these parts:
- ONE tools
ONE tools are important for the access to MetaCloud. OCCI and EC2 API are used for uploading images and are described in Uploading own images to MetaCloud. Despite, it is important to install and setup correctly all three APIs now.
Prerequisite: Unix-type operating system (Windows with Ruby not tested), basic knowledge of such system and editing configuration files
- Append the following to ~/.bashrc, or /home/your_login/.bashrc. End of the file should look something like this:
export ONE_HOST=https://cloud.metacentrum.cz export ONE_XMLRPC=$ONE_HOST:6443/RPC2
- There are the environment variables of your terminal with Bash interpreter defined in this file. Variables are divided into three sections, based on the interface used for communication with OpenNebula. Please, check if the name of the server is correct (you do not have to pay attention to the ports).
- Install Ruby and Rubygems
- Install the following dependencies and ruby gems
sudo apt-get install libexpat1-dev libcurl4-openssl-dev rake libxml2-dev libxslt1-dev gcc libopenssl-ruby make
sudo gem install opennebula-cli -v '~> 5.2.1'
- Restart the terminal. That way new environment variables are used and ONE tools are ready to use.
- It is possible that you received an error if you have Ruby 1.9.3+ installed.
"SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed"
- Ruby can't find the certificate TERENA-eScience-SSL-CA.pem in /etc/ssl/certs. It can be resolved by following procedure – Metacentrum certificate installation:
sudo -s
wget -q https://dist.eugridpma.info/distribution/igtf/current/GPG-KEY-EUGridPMA-RPM-3
gpg --with-fingerprint GPG-KEY-EUGridPMA-RPM-3 pub 1024D/3CDBBC71 2005-07-12 EUGridPMA Distribution Signing Key 3 <info@eugridpma.org> Key fingerprint = D12E 9228 22BE 64D5 0146 188B C32D 99C8 3CDB BC71
apt-key add GPG-KEY-EUGridPMA-RPM-3
echo "deb http://dist.eugridpma.info/distribution/igtf/current igtf accredited" > /etc/apt/sources.list.d/eugridpma.list apt-get update apt-get install ca-policy-igtf-classic ca-policy-igtf-mics ca-policy-igtf-slcs
ln -s /etc/grid-security/certificates/9d772be7.0 /etc/ssl/certs/9d772be7.0 ln -s /etc/grid-security/certificates/20ce830e.0 /etc/ssl/certs/20ce830e.0 ln -s /etc/grid-security/certificates/TERENA-eScience-SSL-CA.pem /etc/ssl/certs/TERENA-eScience-SSL-CA.pem
- Now the environment is configured for work with MetaCloud via command line. More information about how to work with MetaCloud via command line can be found in the MetaCloud management via command line section.
When using ruby 1.8.7, u may can see following harmless warning, please ignore it.
warning: peer certificate won't be verified in this SSL session
Warning
You can't upload any files on the server via ONE tools. You can find out more about this in the Uploading own images to MetaCloud section.