layout |
---|
default |
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:
- Export your
image
on the old HPC Cloud - Import that
image
into the new HPC Cloud - Make a
template
using thatimage
- Start a VM and set contextualization up
- 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 thatimage
. Shut VM(s) down that may be using your intendedimage
before you proceed any further. Once the VM(s) have disappeared from the list of VMs, proceed to the next step. - On the old HPC Cloud: Go to the Images tab. Locate your
image
on the table ofimage
s. - 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. - 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.
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
.
- 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.
- 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).
- 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 -
. - 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>
- 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. - 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
- 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 associatedimage
andtemplate
.
You need to put that image
that you imported into a template
. We will do that now.
- On the new HPC Cloud: In the Templates tab, click on the green [+] button to begin making a new
template
. - 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.
- On the new HPC Cloud: In the Storage tab, choose your
image
for the Disk 0 disk. - On the new HPC Cloud: In the Network tab, choose network internet for
nic
Interface 0, and add a newnic
, which will get name Interface 1 to assign it to your internal network. - 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.
- 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 yourimage
is a CentOS one (or another Red-Hat-based one), you will want to check the box next to the .rpmfile
. If yourimage
is a Ubuntu one (or another Debian-based one), you will want to check the box next to the .debfile
. - On the new HPC Cloud: We are done preparing the
template
. Click on the green Create button on the top-left of the screen.
- 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. - 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.
- On the new VM: Become root.
- On the new VM: Mount the contextualization CD-ROM, by running this command:
mount -t iso9660 -L CONTEXT -o ro /mnt
- 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
- 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 .rpmfile
from thetemplate
. Thatfile
will still be visible in your VM until you re-create the VM.