Uploading own images to MetaCloud
THIS PART OF WIKI IS OUTDATED AND UNDER CONSTRUCTION. PLEASE BE PATIENT.
How to upload your own images?
Prerequisite: you have OpenNebula client tools configured correctly (MetaCloud access through command line).
This tutorial will show you how to upload your own image into MetaCloud. Before you can work with your own OS images via OpenNebula's web interface Sunstone or command line utilities ONE tools, you have to upload the images to the storage.
GridFTP (preferred)
Prerequisite: You have client grid certificate and key in pem format, you requested GridFTP account, you have successfully installed CA from IGTF.
This method requests your grid certificate present in your PC and a knowledge of GridFTP. If you are using certificate in Metacentrum this would probably be the easiest way to upload your image. This method uploads image directly to our server, where you can either via Sunstone interface or ONE tools add it to MetaCloud.
- Create the folder ~/.globus, put your own client certificates.
~/.globus/usercert.pem # x509 certificate, chmod 644 ~/.globus/userkey.pem # rsa private key, no password, chmod 600
- Install the certificates of trusted authorities in /etc/grid-security/certificates, MetaCloud uses certificates signed by TERENA eScience SSL CA.
Initialize client proxy certificate
grid-proxy-init (there is -debug parameter for basic problem debugging)
Copy the image to storage server (which is different from MetaCloud storage server)
globus-url-copy file:///<ABSOLUTE_PATH_TO_THE_IMAGE_ON_YOUR_DISK>/<FILE> gsiftp://carach4.ics.muni.cz:50000/home/<YOUR_LOGIN>/
Warning: Do not forget the slash in the end of the command!
List storage space
globus-url-copy -list gsiftp://carach4.ics.muni.cz:50000/home/<YOUR_LOGIN>/
If this error occurs
globus_gsi_gssapi: SSLv3 handshake problems: Couldn't do ssl handshake OpenSSL Error: s3_clnt.c:2985: in library: SSL routines, function SSL3_SEND_CLIENT_VERIFY: EVP lib OpenSSL Error: rsa_sign.c:127: in library: rsa routines, function RSA_sign: digest too big for rsa key
please re-generate the proxy certificate with RSA key at least 1024 bits long (implicit 512 bits is not enough)
grid-proxy-init -bits 1024 #or 2048
a) If you want to use web interface to upload the image from storage to MetaCloud, just follow these steps.
The image uploaded with GridFTP can be added to MetaCloud in menu Images (1) -> New (2) (Img. 1). Next check option "Provide a path" (3) and enter the path to your private GridFTP folder and name of the image you uploaded there (4) (Img. 2).
b) If you want to use ONE tools to upload the image from storage to MetaCloud, follow the MetaCloud management via command line.
cat debian.one NAME = "Debian6" PATH = /home/<YOUR_LOGIN>/<FILE> #Path in storage server TYPE = OS DESCRIPTION = "Your description of OS image"
oneimage create debian.one ID: 0
Publicly available image (alternative)
You also can upload your image to MetaCloud if it is available in public hosting. It must however:
- Be in RAW format
- Not be compressed
- And the link must begin with http://, not https://
To add the image click on Images (1) -> New (2) (Img. 3). Next check the option "Provide a path" (3) and enter the link to your image (4) (Img. 4).
Upload in Sunstone
To add the image click on Images(1) -> New (2) (Img. 5). Then fill in the name, check the "Upload (3)" option and set the path to your local image file on your hard drive (4) (Img. 6).
Warning: The size of the image uploaded in Sunstone is limited to 10GiB. In addition, there might be some upload size restrictions in your browser.
OCCI interface (alternative)
The most effective way to upload your image is by using OCCI interface. It is implemented by utilities:
- occi-compute
- occi-network
- occi-storage
We are going to use the last one. But first you have to create a text file with XML content – template, which contains certain information about uploaded image.
cat debian.occi <STORAGE> <NAME>Name of your image</NAME> <DESCRIPTION>Description of your image</DESCRIPTION> <TYPE>OS</TYPE> <URL>file:///<ABSOLUTE_PATH_TO_THE_IMAGE>/<FILE></URL> </STORAGE>
Uploading the image after creating the template is just a matter of one command.
occi-storage create debian.occi
Output of this command after successful upload should look like this:
<STORAGE href='https://carach1.ics.muni.cz:9443/storage/0'> <ID>0</ID> <NAME>Name of your image</NAME> <TYPE>OS</TYPE> <DESCRIPTION>Description of your image</DESCRIPTION> <PUBLIC>NO</PUBLIC> <PERSISTENT>NO</PERSISTENT> <SIZE>41943040</SIZE> </STORAGE>
You can also view the list of available images.
occi-storage list <STORAGE_COLLECTION> <STORAGE href='carach1.ics.muni.cz/storage/0' name='suse-test'/> <STORAGE href='carach1.ics.muni.cz/storage/9' name='Ubuntu_raw_test'/> </STORAGE_COLLECTION>
Or you can delete the image according to its ID.
occi-storage delete 9
EC2 API (alternative)
If needed, it is possible to use alternative way to upload your image. This way however is not recommended, the image can not be named, because the name is generated automatically. On the other hand it is the fastest way and you do not have to create any template.
econe-upload /<ABSOLUTE_PATH_TO_THE_IMAGE>/<FILE> Success: ImageId ami-00000001
How to check the successful upload?
Again we can use either web interface, where everything is clearly shown in "Images" section. Or ONE tools by entering a simple command:
$ oneimage list ID USER GROUP NAME SIZE TYPE REGTIME PER STAT RVMS 0 <YOUR_LOGIN> users Debian 4G OS 01/13 07:36:49 No rdy 0
MS Windows
Using the images of Microsoft Windows operating system is limited because of the possible problems with license. Nevertheless if you are interested in using such images in our cloud, please contact us at cloud@metacentrum.cz.