Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 3.69 KB

vm-scratch-fedora-cloud.markdown

File metadata and controls

53 lines (41 loc) · 3.69 KB
layout
default

Creating a Fedora VM - the easy way

Fedora offer images that are ready to use on the cloud. You can find them here

The following instructions explain how to use one of their prepared images to (astonishingly easily) create a running VM out of it in the HPC Cloud.

NOTE: The VM that you can start from this image will be automatically making use of contextualization with cloud-init. Make sure you have your public ssh-key configured either in your user profile or in the template, before you create your VM. That way you will be able to ssh into your VM with the username fedora and your private key.

Importing the Image

  1. On the Fedora web page: On the Cloud section of the downloads page, locate the link to their Qcow2 image and copy it to the paperclip (at the time of writing this article, the URL is this one: https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-22-20150521.x86_64.qcow2)
  2. On the HPC Cloud UI: On the Images subsection of the Virtual Resources section, click on the green [+] button to start creating a new image. The Create Image form pops up.
  3. On the HPC Cloud UI: On the Create Image form:
  • fill in a Name
  • choose Type:OS
  • make sure that, for field Datastore, you chose 104: local-images-ssd
  • choose whether you want the image to be Persistent
  • in the Image location: area, mark the Provide a path radio button
  • fill in the Path to the image file, by pasting the URL you copied in the first step of this recipe
  • Click on the Advanced options dropdown area. There, you must fill in:
  • In Device prefix, type vd
  • In Driver, type qcow2
  1. On the HPC Cloud UI: Click on the green Create button at the bottom of the form, and an image with the name you wrote on the form will appear on the images table, in status LOCKED. It will remain in that status until the UI has finished copying the file from Fedora's servers to the HPC Cloud. Then it will change to READY.

Make a template using that image

You need to put that image that you imported into a template. We will do that now.

  1. On the HPC Cloud UI: In the Templates tab, click on the green [+] button to begin making a new template.
  2. On the HPC Cloud UI: In the General tab, give it a name, the amount of Memory that you want, the amount of CPU and VCPU you need, etc.
  3. On the HPC Cloud UI: In the Storage tab, choose the image you created in the previous step for the Disk 0 disk.
  4. On the HPC Cloud UI: In the Network tab, choose network internet for nic Interface 0, and add a new nic, which will get name Interface 1 to assign it to your internal network.
  5. On the HPC Cloud UI: In the Input/Output tab, make sure the VNC radio button is checked.
  6. On the HPC Cloud UI: In the Features tab, choose:
  • ACPI as Yes
  • Localtime as No
  1. On the HPC Cloud UI: We are done preparing the template. Click on the green Create button on the top-left of the screen.

Start a VM and set contextualization up

  • On the HPC Cloud UI: Instantiate the template. This creates a new VM. On the VNC console, make sure the new VM boots.

At some point during the boot-up sequence (almost at the end), you will see a couple of tables showing what Cloud-init has managed to configure for you, and your network should be working.

  • You can now connect to your VM via SSH with username fedora and your private key, like:
ssh -i ~/.ssh/my_cloud_key.rsa [email protected]

And you can become root by using sudo su; it won't require a password for that.