I am relatively new to running virtual machines / OpenVZ containers so if I have miss understood something please let me know.
I currently have Ubuntu 14.04.1 installed straight to a partition on my server. My intention is to completely rebuild and restructure my server (which could take some time) without removing the installation I currently have. The limitation is I only have one server.
To complete this I thought it would make sense to install something like Proxmox VE (https://www.proxmox.com/proxmox-ve) and move my current installation of Ubuntu to a VM / OpenVZ container running on Proxmox. This way I can have a small downtime (which is completely fine) as I set this up rather than the long down time as described above. The second advantage is I can create my new server installation on a separate VM / OpenVZ container.
My question is, how do I go about moving the installation of Ubuntu I currently have in to a VM / OpenVZ Container with Proxmox? To my understanding an OpenVZ container would be more preferable as it has a lower overhead than a full VM.
Best Answer
So, after a while I have stumbled upon some search terms that helped me find my way this completing this task myself. In the end I found that it is near impossible to go straight to an OpenVZ container but I did manage to transfer over to a KVM Virtual Machine on Proxmox. Here are the steps I took (make sure to read everything before starting it yourself):
Create Image of Physical machines partition
Save Image
heading on this page to create an image of your partition using thesaveparts
options in theSelect mode
menu. Make sure you save your partition image to an external drive. Enable all the pre and post image checks to make sure the process was successful.Install Proxmox VE
Creating the Virtual Machine
local
; clickContent
on the upper-central tabs; clickupload
; clickselect file
and navigate to the Clonezilla Live ISO you downloaded in step 2; clickupload
and wait for it to finish.Create VM
in the top left of the screen. Keep all the setting the same except:ISO Image
drop down box and select the Clonezilla Live ISO you just uploadedfinal
page.Recovering your partition into the Virtual Machine
start
in the top right corner.console
in the top right corner.Restoring the Image
heading on this page to restore the partition. Make sure to use therestoreparts
option under theSelect mode
menu. Note: at step 13 in the linked tutorial Clonezilla will fail as there is no partition on /dev/sda. When this happens:fdisk /dev/sda
n
and hit enter to create a new partitionw
and hit enter to write the changes to the diskexit
to exit the terminal session and hand back to ClonezillaMake the partition bootable
/etc/pve/qemu-server/<VM_ID>.conf
and remove theusb0
entry.Options
; click onBoot Order
; clickedit
; change the order toCD-ROM
thenDisk 'ide0'
.Hardware
; click on theCD\DVD Drive
entry; clickRemove
; clickadd
thenCD/DVD Drive
; under theStorage
option click onlocal
; under theISO Image
option click the Super Grub2 ISO; finally clickcreate
.Everything
then select the OS you want to boot (in my case it was Ubuntu). If your OS is not there, find out more advanced features of Super Grub2 here./dev/sda
. In my case I installed Grub2 by runningsudo grub-install /dev/sda
.Hardware
; click on theCD\DVD Drive
entry; clickRemove
.If you encountered an issue along the way leave you can leave a comment but I would probably recommend you create a post here on ServerFault instead and link this question in. That way someone more qualified than I am can help you out. If there is anything unclear in my steps just leave a comment and I will try and clear it up. I hope this tutorial helps :)
JamesStewy