From e556012ce106af7ba452a6a002557ee876d12b1d Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Sun, 1 Apr 2012 14:23:43 -0400 Subject: [PATCH] Edit section on new images Added docs on where to get Ubuntu, Fedora, SUSE, RCB, and test images. Fixes bug #968681 Edited section on booting a test instance. Change-Id: I963c827d7f0ec00b4db2392e7246a33502712562 --- doc/src/docbkx/common/ch_image_mgmt.xml | 232 +++++++++++++++--------- 1 file changed, 142 insertions(+), 90 deletions(-) diff --git a/doc/src/docbkx/common/ch_image_mgmt.xml b/doc/src/docbkx/common/ch_image_mgmt.xml index fcd1d29bf13..2b428e0bad5 100644 --- a/doc/src/docbkx/common/ch_image_mgmt.xml +++ b/doc/src/docbkx/common/ch_image_mgmt.xml @@ -50,109 +50,161 @@ variables required by the nova client and glance client.
- Starting ImagesOnce you have an installation, you want to get images that you can use in your Compute cloud. - We've created a basic Ubuntu image for testing your installation. First you'll download - the image, then use "uec-publish-tarball" to publish it: - - -image="ubuntu1010-UEC-localuser-image.tar.gz" -wget http://c0179148.cdn1.cloudfiles.rackspacecloud.com/ubuntu1010-UEC-localuser-image.tar.gz -uec-publish-tarball $image [bucket-name] [hardware-arch] - - - - - Image : a tar.gz file that contains the - system, its kernel and ramdisk. - - - - Bucket : a local repository that contains - images. - - - - Hardware architecture : specify via "amd64" - or "i386" the image's architecture (32 or 64 bits). - - - - - Here's an example of what this command looks like with data: - - uec-publish-tarball ubuntu1010-UEC-localuser-image.tar.gz dub-bucket amd64 - - The command in return should output three references: - emi, eri and eki. You will next run nova image-list in order to obtain the ID of the - image you just uploaded. - - - Now you can schedule, launch and connect to the instance, which you do with the "nova" - command line. The ID of the image will be used with the nova bootcommand. - One thing to note here, once you publish the tarball, it has to untar before - you can launch an image from it. Using the 'nova list' command, and make sure the image - has it's status as "ACTIVE". - - nova image-list - - Depending on the image that you're using, you need a public key to connect to it. Some - images have built-in accounts already created. Images can be shared by many users, so it - is dangerous to put passwords into the images. Nova therefore supports injecting ssh - keys into instances before they are booted. This allows a user to login to the instances + Getting virtual machine images + +
+ CirrOS (test) images + Scott Moser maintains a set of small virtual machine images + that are designed for testing. These images use "cirros" as the + login user. They are hosted under the CirrOS project on Launchpad and are available + for download at https://launchpad.net/cirros/+download. + + + If your deployment uses QEMU or KVM, we recommend using the + images in QCOW2 format. The most recent 64-bit qcow2 image as of this + writing is https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img + +
+ +
+ Ubuntu images + Canonical maintains an official set of Ubuntu-based images for download at http://uec-images.ubuntu.com These + accounts use "ubuntu" as the login user. + If your deployment uses QEMU or KVM, we recommend using the images in QCOW2 format. + The most recent version of the 64-bit QCOW2 image for Ubuntu 12.04 is available for download at + http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img. +
+ +
+ Fedora images + The Fedora project maintains prebuilt Fedora JEOS + (Just Enough OS) images for download at http://berrange.fedorapeople.org/images + . + A 64-bit QCOW2 image for Fedora 16 is available for download + at http://berrange.fedorapeople.org/images/2012-02-29/f16-x86_64-openstack-sda.qcow2. + +
+
+ OpenSUSE and SLES 11 images + SUSE Studio at http://susestudio.com + is an easy way to build virtual appliances for OpenSUSE and SLES 11 (SUSE + Linux Enterprise Server) that are compatible with OpenStack. Free + registration is required to download or build images. + + For example, Christian Berendt used OpenSUSE to create a test OpenSUSE 12.1 + (JeOS) image, which is available for download at http://susestudio.com/a/YRUrwO/testing-instance-for-openstack-opensuse-121. +
+
+ Rackspace Cloud Builders (multiple distros) images + Rackspace Cloud Builders maintains a list of pre-built images + from various distributions (RedHat, CentOS, Fedora, Ubuntu) at + https://github.com/rackerjoe/oz-image-build. +
+
+
+ Booting a test image + The following assumes you are using QEMU or KVM in your + deployment. + Download a CirrOS test image: + +$ wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img + + Add the image to glance: + +$ name=cirros-0.3-x86_64 +$ image=cirros-0.3.0-x86_64-disk.img +$ glance add name=$name is_public=true container_format=bare disk_format=qcow2 < $image + + Check that adding the image was successful (Status should + be ACTIVE when the operation is complete): + +$ nova image-list + ++--------------------------------------+---------------------+--------+--------+ +| ID | Name | Status | Server | ++--------------------------------------+---------------------+--------+--------+ +| 254c15e1-78a9-4b30-9b9e-2a39b985001c | cirros-0.3.0-x86_64 | ACTIVE | | ++--------------------------------------+---------------------+--------+--------+ + + + Create a keypair so you can ssh to the instance: + + +$ nova keypair-add test > test.pem +$ chmod 600 test.pem + + In general, you need to use an ssh keypair to log in to a running instance, although some + images have built-in accounts created with associated passwords. However, since images are + often shared by many users, it is not advised to put passwords into the images. Nova + therefore supports injecting ssh keys into instances before they are booted. This allows a user to login to the instances that he or she creates securely. Generally the first thing that a user does when using the system is create a keypair. Keypairs provide secure authentication to your instances. As part of the first boot of - a virtual image, the private key of your keypair is added to root’s authorized_keys - file. Nova generates a public and private key pair, and sends the private key to the - user. The public key is stored so that it can be injected into instances. - Keypairs are created through the api and you use them as a parameter when launching an - instance. They can be created on the command line using the following command : - nova keypair-addIn order to list all the available options, you would run :nova help - Example usage: - - -nova keypair-add test > test.pem -chmod 600 test.pem - - - Now, you can run the instances: - nova boot --image 1 --flavor 1 --key_name test my-first-server + a virtual image, the private key of your keypair is added to authorized_keys + file of the login account. Nova generates a public and private key pair, and sends the private key to the user. The public key is stored so that it can be injected into instances. + Run (boot) a test instance: + +$ nova boot --image cirros-0.3.0-x86_64 --flavor m1.small --key_name test my-first-server + Here's a description of the parameters used above: - - --flavor what type of image to create. You - can get all the flavors you have by running - nova flavor-list + + --image: the name or ID of the image we want to + launch, as shown in the output of nova image-list - - - -key_ name name of the key to inject in to the - image at launch. + + --flavor: the name or ID of the size of the instance to create + (number of vcpus, available RAM, available storage). View the + list of available flavors by running + nova flavor-list + + + -key_name: the name of the key to inject in to the + instance at launch. - The instance will go from “BUILD” to “ACTIVE” in a short time, and you should - be able to connect via SSH using the 'ubuntu' account, with the password 'ubuntu': - (replace $ipaddress with the one you got from nova list): - - ssh ubuntu@$ipaddress - The 'ubuntu' user is part of the sudoers group, so you can escalate to 'root' - via the following command: - - sudo -i - + Check the status of the instance you launched: + +$ nova list + + The instance will go from BUILD to ACTIVE in a short time, and you should + be able to connect via ssh as 'cirros' user, using the private key + you created. If your ssh keypair fails for some reason, you can also log in with the + default cirros password: cubswin:) + +$ ipaddress=... # Get IP address from "nova list" +$ ssh -i test.pem -l cirros $ipaddress + + The 'cirros' user is part of the sudoers group, so you can escalate to 'root' + via the following command when logged in to the instance: + +$ sudo -i +
- Deleting Instances - - When you are done playing with an instance, you can tear - the instance down using the following command (replace - $instanceid with the instance IDs from above or look it up - with euca-describe-instances): + Tearing down (deleting) Instances - nova delete $server-id + When you are done with an instance, you can tear + it down using the nova delete command, passing + either the instance name or instance ID as the argument. You can + get a listing of the names and IDs of all running instances using the + nova list. For example: + +$ nova list + ++--------------------------------------+-----------------+--------+----------+ +| ID | Name | Status | Networks | ++--------------------------------------+-----------------+--------+----------+ +| 8a5d719a-b293-4a5e-8709-a89b6ac9cee2 | my-first-server | ACTIVE | | ++--------------------------------------+-----------------+--------+----------+ + +$ nova delete my-first-server +