Skip to content

Latest commit

 

History

History
87 lines (68 loc) · 7.17 KB

vm-migration-guide.markdown

File metadata and controls

87 lines (68 loc) · 7.17 KB
layout
default

VM migration guide

This guide aims at helping you if you find yourself in the situation that you need to bring an existing image from the old HPC Cloud to the new one. Among other changes, the most notable one is that you are likely to have to contextualise your VM so that it will have its network configured.

The steps we will follow are the following:

  1. Export your image on the old HPC Cloud
  2. Import that image into the new HPC Cloud
  3. Make a template using that image
  4. Start a VM and set contextualization up

Export your image on the old HPC Cloud

  1. On the old HPC Cloud: You have decided which image you are going to bring over. Make sure that there are no VM(s) running at the moment that may be using that image. Shut VM(s) down that may be using your intended image before you proceed any further. Once the VM(s) have disappeared from the list of VMs, proceed to the next step.
  2. On the old HPC Cloud: Go to the Images tab. Locate your image on the table of images.
  3. On the old HPC Cloud: Click anywhere (except for the checkbox on the left of it) on the row for that image, so that a panel with extended information shows at the bottom of the screen.
  4. On the old HPC Cloud: Click on the button Copy to VirDir from the extended-information panel.

The image will now be copied to VirDir. Depending on its size, it may take quite some time. A pop-up dialogue will tell you this and which name your image will have.

Import your image into the new HPC Cloud

NOTE:

In these steps you will be exposing your VirDir to the outside world. Make sure you understand the risks, and destroy the new VM you will be making as soon as you are finished importing the image.

Expose your image via a web server

  1. On the old HPC Cloud: From the wizard (tab Create VM), create a small new Ubuntu server VM. In further steps, we will call this the Bridge VM. Make sure you choose yes on both questions from Step 3, so that your VM has ports open for the web server. Once the VM boots, on the noVNC console, wait for the first-run wizard to start; then provide there a password for root and create a non-root user. After the first-run wizard is complete, you will be prompted to log in.
  2. On your laptop: Make sure you can browse the landing page of the web server that is running on your Bridge VM (i.e.: navigate to the external IP address of your Bridge VM, which has the form: 145.100.X.X).
  3. On your laptop: SSH into your Bridge VM (remember, you need to use your **non-**root user. Once you are logged in as the plain user, become root by running the command su -.
  4. On the Bridge VM: As root on the SSH connection you opened on the previous step, download the script we have prepared, that will share your VirDir to the new HPC Cloud only, and then run it. Just run these commands for that:
cd
wget https://doc.hpccloud.surfsara.nl/assets/setup_bridge_vm.sh
chmod +x ./setup_bridge_vm.sh

On the Bridge VM: Run this file giving your Group name as a parameter: ./setup_bridge_vm.sh <group_name>

Bring your image to the new HPC Cloud

  1. On the new HPC Cloud: Using the user view, go to the Images tab, and click on the green [+] button to add a new image. A from will pop up.
  2. On the new HPC Cloud: 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, pointing to the web server running in your Bridge VM, which will be something like: http://145.100.X.X/vd/2015MMDD:hh:mm_sometext (you need to use the right IP instead of the X.X and the actual name of the file, including the colons)
  • Click on the Advanced options dropdown area. There, you must fill in:
  • In Device prefix, type vd
  • In Driver, type qcow2
  1. On the new HPC Cloud: 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 your Bridge VM to the new HPC Cloud. Then it will change to READY.

NOTE:

Once your image on the new HPC Cloud shows as READY, if you do not need to bring any more images over, then now is a good time to destroy your Bridge VM. You can delete it along with its associated image and template.

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 new HPC Cloud: In the Templates tab, click on the green [+] button to begin making a new template.
  2. On the new HPC Cloud: 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 new HPC Cloud: In the Storage tab, choose your image for the Disk 0 disk.
  4. On the new HPC Cloud: 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 new HPC Cloud: In the Input/Output tab, select the VNC radio button in order to be able to use noVNC via the browser.
  6. On the new HPC Cloud: In the Context tab, look for Files whose name begins with one-context. You should see 2 of them: one ending in .deb and another one ending in .rpm. If your image is a CentOS one (or another Red-Hat-based one), you will want to check the box next to the .rpm file. If your image is a Ubuntu one (or another Debian-based one), you will want to check the box next to the .deb file.
  7. On the new HPC Cloud: 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

  1. On the new HPC Cloud: Instantiate the template. This creates what we will further call new VM. On the VNC console, make sure the new VM boots.
  2. On the new HPC Cloud: On the VNC console, log into your new VM with your credentials, just as you were able to do on the old HPC Cloud.
  3. On the new VM: Become root.
  4. On the new VM: Mount the contextualization CD-ROM, by running this command: mount -t iso9660 -L CONTEXT -o ro /mnt
  5. On the new VM: Install the contextualization package that is appropriate for your VM:
  • if you are running CentOS (or a Red-Hat-based OS), use command: yum install /mnt/one-context*.rpm
  • if you are running Ubuntu (or a Debian-based OS), use command: dpkg -i /mnt/one-context*.deb
  1. On the new VM: Restart your VM (run reboot now). Your VM should now be in a useable state (among other things, the network should be working).

Note:

When you see that the contextualization is working (e.g.: the network works on the new VM), and if you made the image persistent, then you can delete the one-context* .deb or .rpm file from the template. That file will still be visible in your VM until you re-create the VM.