cc_staff
1,486
edits
No edit summary |
|||
Line 110: | Line 110: | ||
Once this is done, users can log into the VM with their private keys as usual (see [[ssh keys]]). | Once this is done, users can log into the VM with their private keys as usual (see [[ssh keys]]). | ||
=Downloading an image into a local VirtualBox= | |||
The first step is to install the glance client. If you don't have pip get it with | |||
{{Command|sudo apt-get install python-dev python-pip}} | |||
note that this is the command on Ubuntu/Debain other Linux flavors will have similar but different commands see [http://docs.openstack.org/user-guide/common/cli_install_openstack_command_line_clients.html]. Then install the client with | |||
{{Command|pip install python-glanceclient}} | |||
As mentioned in the [[OpenStack#Command Line Clients]] section you will need to download the OpenStack RC file and source it. Glance can list the available images on your OpenStack account with | |||
{{Command|glance image-list}} | |||
producing something like: | |||
+--------------------------------------+---------------------------------------+-------------+------------------+-------------+--------+ | |||
| ID | Name | Disk Format | Container Format | Size | Status | | |||
+--------------------------------------+---------------------------------------+-------------+------------------+-------------+--------+ | |||
| 982761b2-c77b-4852-8ae3-bf98b32b8894 | Hadoop-2.2.4 | qcow2 | bare | 10253107200 | active | | |||
| b7bd3033-9836-406d-a8f2-2e91978026b4 | hadoopmaster | qcow2 | bare | 3493527552 | active | | |||
| 2c751755-854d-49c3-af82-d501e51e7159 | hadoopmaster-active | qcow2 | bare | 13134004224 | active | | |||
| c41012f4-ed82-4478-a81f-5efb96a31b1a | hadoopmaster-old | qcow2 | bare | 3493527552 | active | | |||
| 78e61a3f-b546-441a-b476-a7077b04ca36 | hadoopslave | qcow2 | bare | 3490971648 | active | | |||
| 516845c3-b256-4c6d-a2cb-e31e822c7e34 | hadoopslave1-active | qcow2 | bare | 8345026560 | active | | |||
| 1546bd86-5314-4fce-9576-e2f6930dad30 | hadoopslave1-old | qcow2 | bare | 3490971648 | active | | |||
| baf78e8d-8288-4854-a66b-812cdf3ccbca | TestVM | qcow2 | bare | 13167616 | active | | |||
| 2faf97d7-5b0b-44ce-8024-3bef5a634570 | test_ubuntu_initial | qcow2 | bare | 1799487488 | active | | |||
| 308b6614-396a-4360-9c33-4e86f41ea0ec | trusty | qcow2 | bare | 256180736 | active | | |||
| 9b3c3fda-2aca-43b5-a3e7-662a94f5e7fb | Ubuntu_14.04_Trusty-amd64-20150708 | qcow2 | bare | 257884672 | active | | |||
| f93e66cf-fec1-4460-8fc7-506e716fbf30 | ucernvm-prod.1.18-10 | raw | bare | 20971520 | active | | |||
+--------------------------------------+---------------------------------------+-------------+------------------+-------------+--------+ | |||
You can then download a particular image with | |||
{{Command|glance image-download --file ./<file-name-for-image>.qcow2 2c751755-854d-49c3-af82-d501e51e7159}} | |||
where the last argument is the <code>ID</code> of the image you wish to download taken from the table listed with the <code>glance image-list</code> command. For more detailed instructions on the above steps see [https://raymii.org/s/tutorials/Openstack_Glance_Image_Download.html]. | |||
Then to use this image in VirtualBox you will need to convert the image in the qcow2 format to the vmdk format. This can be done with the <code>qemu-img</code> tool. This can be installed with something like | |||
{{Command|sudo apt-get install qemu-img}} | |||
then do the conversion with | |||
{{Command|qemu-img convert -f qcow2 vdisk.qcow2 -O vmdk vdisk.vmdk}} | |||
Then you can create a new vritual machine and attach the vmdk image to it see [http://techathlon.com/how-to-run-a-vmdk-file-in-oracle-virtualbox/] for detailed instructions on this. |