• No se han encontrado resultados

Post test al grupo de estudio

In document UNIVERSIDAD CÉSAR VALLEJO (página 61-67)

CAPÍTULO IV RESULTADOS

4.1.2. Post test al grupo de estudio

Instances are virtual machines that run inside the cloud. To start an instance, a virtual machine image must exist that contains the following information: which operating sys-tem to use, a username and password with which to log in to the instance, file storage, etc. The cloud contains a pool of such images that have been uploaded to OpenStack Image and are accessible to members of different projects.

1.5.1 Key Parameters

When starting an instance, specify the following key parameters:

Flavor

In OpenStack, flavors define the compute, memory, and storage capacity of nova computing instances. To put it simply, a flavor is an available hardware configura-tion for a server. It defines the “size” of a virtual server that can be launched.

For more details and a list of default flavors available, refer to Section “Managing Flavors” (Chapter 1, Using SUSE Cloud Dashboard, ↑Admin User Guide).

Key Pair (optional, but recommended)

Key Pairs are SSH credentials that are injected into images when they are launched. For this to work, the image must contain the cloud-init package.

It is recommended to create at least one key pair per project. If you already have generated a key pair with an external tool, you can import it into OpenStack. The key pair can be used for multiple instances belonging to that project.

For details, refer to Section 1.6.2, “Creating or Importing Keys” (page 32).

Security Group

In SUSE Cloud, security groups are used to define which incoming network traf-fic should be forwarded to instances. Security groups hold a set of firewall policies (security group rules).

For details, refer to Section 1.6.1, “Configuring Security Groups and Rules” (page 28).

Network

Instances can belong to one or multiple networks. By default, each instance is given a fixed IP address, belonging to the internal network.

Boot Source of the Instance

You can launch instances from the following sources:

• Images that have been uploaded to SUSE Cloud.

• Volumes that contain images.

• Instance snapshots.

• Volume snapshots.

If needed, you can assign a floating (public) IP address to a running instance and attach a block storage device (volume) for persistent storage. For details, refer to Section 1.6.3, “Managing IP Addresses” (page 34) and Section 1.8, “Managing Volumes” (page 44).

1.5.2 Launching Instances From Images

You can start an instance directly from one of the images available in OpenStack Image. In that case, SUSE Cloud will create a local copy of the image on the respective Compute Node where the instance will be started.

Procedure 1.7: Launching an Instance from an Image

The SUSE Cloud Dashboard shows the images that have been uploaded to OpenStack Image and are available for this project on the Images category within the Project cate-gory.

1 Log in to SUSE Cloud Dashboard and select a project from the drop-down box at the top-level row.

2 Select Project > Compute > Instances and click Launch Instance to open the respec-tive dialog.

Figure 1.6: SUSE Cloud Dashboard—Launch Instance, Details Tab

3 On its Details tab, specify the following parameters:

3a Select the Availability Zone from which to start the instance. Only Compute Nodes belonging to this zone are eligible to run this particular instance.

3b Enter an Instance Name that will be assigned to the virtual machine.

3c From the Flavor drop-down box, select the “size” of the virtual machine to launch.

NOTE: Hyper-V and m1.tiny Flavor

Do not use the m1.tiny flavor for instances running on Hyper-V.

Usually, OpenStack Compute Nodes interpret a disk size value of 0 as “do not resize root disk”. However, Hyper-V Compute Nodes in-terpret the value 0 literally and will therefore try to shrink the disk to 0 and fail.

3d In Instance Count, enter the number of virtual machines to launch from this image.

3e Depending on which Dashboard category you opened the Launch Instance dialog from, the value of Instance Boot Source might automatically be prese-lected. Click the drop-down box to choose between the following values:

• Boot from image—see Procedure 1.7, “Launching an Instance from an Image”

• Boot from volume—see Procedure 1.9, “Launching an Instance from a Volume” (page 25)

• Boot from snapshot—see Procedure 1.10, “Launching an Instance from a Snapshot” (page 26)

• Boot from image (creates a new volume)

• Boot from volume snapshot (creates a new volume)

The value of Instance Boot Source also defines which additional parameters appear below.

3f To launch an instance from an image that is available in OpenStack Image, make sure Instance Boot Source is set to Boot from image. From the Image Name drop-down box, select which image to boot.

4 Switch to the Access & Security tab.

Figure 1.7: SUSE Cloud Dashboard—Launch Instance, Access & Security Tab

There, specify the following parameters:

4a Select a Key Pair. For details, refer to Section 1.6.2, “Creating or Importing Keys” (page 32). In case an image uses a static root password or a sta-tic key set (neither is recommended), you do not need to provide a key pair on starting the instance.

4b Activate the Security Groups that you want to assign to the instance. Securi-ty groups are a kind of cloud firewall that define which incoming network traffic should be forwarded to instances. For details, refer to Section 1.6.1,

“Configuring Security Groups and Rules” (page 28).

If you have not created any specific security groups, you can only assign the instance to the default security group. After the instance has been launched, you can still change the security group or groups assigned to the instance.

5 Switch to the Networking tab.

Figure 1.8: SUSE Cloud Dashboard—Launch Instance, Networking Tab

There, specify to which network the instance should belong:

5a Move one or multiple of the Available Networks to the Selected Networks field by clicking the plus icon next to the network.

TIP: Choice of Available Networks

As long as you do not have configured a pool of floating IP ad-dresses yet, Available Networks only shows the internal net-work with fixed IPs. For details about configuring floating IPs, refer to Procedure 1.14, “Allocating Floating (Public) IPs to a Project” (page 35).

5b If you have specified multiple networks in the Selected Networks field, change their order by drag and drop, if necessary.

6 With this, you have set all key parameters for launching an instance. Click Launch Instance. The instance will be started on any of the Compute Nodes in the cloud that belong to the selected availability zone.

After you have launched an instance, switch to the Instances category in the Dashboard.

There, you can view the Instance Name, the Image Nam, its (private or public) IP ad-dress, its Size, the Key Pair associated with it, the image's Status, its Availability Zone, its Task, its Power State, and its Uptime.

Figure 1.9: SUSE Cloud Dashboard—List of Launched Instances

If you did not provide a key pair on starting and have not touched security groups or rules so far, by default the instance can only be accessed from inside the cloud via VNC at this point. Even pinging the instance from within the cloud is not possible. To change this, proceed with Section 1.6, “Configuring Access to the Instances” (page 27).

1.5.3 Launching Instances from Volumes

You can start an instance directly from one of the images available in OpenStack Image or from an image that you have copied to a persistent volume before. To trans-fer an image to the volume, either directly create a volume from an image that is avail-able in OpenStack Image or manually copy an image to the volume as described in Procedure 1.8 (page 23).

Procedure 1.8: Manually Preparing a Bootable Volume

The following steps describe how to create an empty volume and manually copy an im-age to it. Alternatively, for directly creating a volume from an imim-age, refer to Proce-dure 1.19, “Creating or Deleting Volumes” (page 44).

1 Log in to SUSE Cloud Dashboard and select a project from the drop-down box at the top-level row.

2 Create an empty volume as described in Procedure 1.19, “Creating or Deleting Volumes” (page 44). Its size must be large enough to store an unzipped image.

3 Create an image with SUSE Studio or SUSE Studio Onsite. For details, refer to Section “Building Images with SUSE Studio” (Chapter 2, Using OpenStack Com-mand Line Clients, ↑Admin User Guide).

4 To be able to copy the image to the empty volume, you need to execute the follow-ing steps first:

4a Launch an instance from an arbitrary image as described in Procedure 1.7 (page 19).

NOTE

• Which image you select there is only important if you want to boot a Xen image from the volume later on. In that case, the image you select in Step 3f of Procedure 1.7, “Launching an Instance from an Image” (page 19) needs to be of the same type as the one on the volume: fully virtualized or paravirtualized.

• In any other case the image you select for starting the instance does not matter. It will be replaced by the image on the volume that you specify in Step 2 of Procedure 1.9, “Launching an In-stance from a Volume” (page 25).

• Make sure to select an appropriate flavor for the instance. The instance's hard disk must be big enough to store the image that you want to copy onto the volume later on.

4b Attach the empty volume to the running instance as described in Proce-dure 1.20, “Attaching Volumes to Instances” (page 45).

5 Copy the image that you created in Step 3 (page 23) to the running instance (for example, by using scp).

6 Log in to the instance by using SSH or the VNC console.

7 Assuming that the attached volume is mounted as /dev/vdb, use one of the fol-lowing commands to copy the image to the attached volume:

• For a raw image:

cat IMAGE >/dev/vdb

(alternatively, use dd)

• For a non-raw image:

qemu-img convert -O raw IMAGE /dev/vdb

• For a *.tar.bz2 image:

tar xfjO IMAGE >/dev/vdb

8 As the image comes with a predefined disk size (that might be smaller than the size of the volume it has been copied to), the image will not use the full size of the vol-ume. To change this, adjust the partition table within the image to match the size of the volume.

9 As only detached volumes are available for booting, detach the volume. For details on how to do so, refer to Procedure 1.20, “Attaching Volumes to Instances” (page 45), Step 8.

Now, you can launch an instance from the image that has been copied to the volume.

The instance will be booted from the volume, which is provided by OpenStack Block Storage through iSCSI. To do so, proceed with Procedure 1.9, “Launching an Instance from a Volume” (page 25).

Procedure 1.9: Launching an Instance from a Volume

When booting an image from a volume, the procedure is basically the same as when launching an instance from an image in OpenStack Image, except for some additional steps.

1 Follow Step 1 to Step 3e from Procedure 1.7, “Launching an Instance from an Image” (page 19).

2 On the Details tab of the Launch Instance dialog, specify the following options to boot from a volume:

2a Set Instance Boot Source to Boot from Volume.

2b In Volume, select the volume to launch the instance from.

3 Switch to the other tabs and set the required options as described in Procedure 1.7,

“Launching an Instance from an Image” (page 19), Step 4 to Step 6.

After you have launched an instance, switch to the Instances category in the Dashboard.

There, you can view the Instance Name, the Image Nam, its (private or public) IP ad-dress, its Size, the Key Pair associated with it, the image's Status, its Availability Zone, its Task, its Power State, and its Uptime.

Figure 1.10: SUSE Cloud Dashboard—List of Launched Instances

If you did not provide a key pair on starting and have not touched security groups or rules so far, by default the instance can only be accessed from inside the cloud via VNC at this point. Even pinging the instance from within the cloud is not possible. To change this, proceed with Section 1.6, “Configuring Access to the Instances” (page 27).

1.5.4 Launching Instances from Snapshots

In addition to launching instances directly from images available in SUSE Cloud, or from volumes that contain an image, you can also launch an instance from an instance snapshot or a volume snapshot.

Procedure 1.10: Launching an Instance from a Snapshot

1 Follow Step 1 to Step 3e from Procedure 1.7, “Launching an Instance from an Image” (page 19).

2 On the Details tab of the Launch Instance dialog, specify the following options to boot from a snapshot:

2a Set Instance Boot Source to Boot from Snapshot.

2b In Instance Snapshot, select the instance snapshot to launch the instance from.

3 Switch to the other tabs and set the required options as described in Procedure 1.7,

“Launching an Instance from an Image” (page 19), Step 4 to Step 6.

After you have launched an instance, switch to the Instances category in the Dashboard.

There, you can view the Instance Name, the Image Nam, its (private or public) IP ad-dress, its Size, the Key Pair associated with it, the image's Status, its Availability Zone, its Task, its Power State, and its Uptime.

Figure 1.11: SUSE Cloud Dashboard—List of Launched Instances

If you did not provide a key pair on starting and have not touched security groups or rules so far, by default the instance can only be accessed from inside the cloud via VNC at this point. Even pinging the instance from within the cloud is not possible. To change this, proceed with Section 1.6, “Configuring Access to the

In document UNIVERSIDAD CÉSAR VALLEJO (página 61-67)