Move KVM and Containers

Tuckerdog

Well-Known Member
Aug 17, 2011
67
0
46
Hi All,

I have programmed a new drive with version 4. My old installation was/is not starting, but the data is still on the old drive. I could put the old drive in the system as the second drive, but am very new to linux...am familiar with OS400, NT, Windows and other obsolete OSs. Could anyone provide the "linux for dummies" commands to mount and transfer the various things needed from the old drive to the new setup? Please remember, the old drive does not boot, and I have limited experience with Proxmox/linux. Any and all help would be deeply appreciated.
 
Hi,

> "linux for dummies" commands

It would maybe better to read some entry guides before executing commands from the internet as root, that said you can take a look a t this answer:
http://superuser.com/questions/116617/how-to-mount-an-lvm-volume

Code:
# make a new directory, for example in the root home /root
mkdir tmpmount
# scan for the lvm disks
lvmdiskscan
lvdisplay
# identify your other disk (don't get confused by the disks from new pve installation)
# replace /dev/... with your respective output (e.g.: dm-3)
mount /dev/dm-3 /root/tmpmount

After that you can move the disk images from the mount point to your disk.

They should reside in the var/lib/vz/images subfolder (if you mounted the root logical volume from your second disk).
If you directly mounted the data LV there should be an images/ folder with the disk images in the tmpmount directory.

Mounting the root LV should also expose etc/pve in the tmpmount dir, there are the config files (in subfolders) of your VMs.

If you don't have VMs with the same VMID on the new host you should be able to copy the old config files to the same place in the new hosts /etc/pve and the old diskes to the new hosts /var/lib/vz/images/VMID/ folders and get the VMs working again.

Those are some general directions, use them with caution! It's advised to have some linux knowledge when tinkering in the shell as root you can permanently break the new system also and loose all data.
 
I will read all I can before tinkering with root.

Thank-you for the general directions...maybe not all is lost yet...
 
Hi,

Here is the result of lvmdiskscan and lvdisplay. What I seem to be missing is how to mount the right one when they are named the same across the old and new installations?

root@pve:~# lvmdiskscan
/dev/ram0 [ 64.00 MiB]
/dev/pve/root [ 96.00 GiB]
/dev/ram1 [ 64.00 MiB]
/dev/pve/swap [ 15.00 GiB]
/dev/ram2 [ 64.00 MiB]
/dev/sda2 [ 127.00 MiB]
/dev/pve/data [ 804.02 GiB]
/dev/ram3 [ 64.00 MiB]
/dev/sda3 [ 3.64 TiB] LVM physical volume
/dev/ram4 [ 64.00 MiB]
/dev/ram5 [ 64.00 MiB]
/dev/ram6 [ 64.00 MiB]
/dev/ram7 [ 64.00 MiB]
/dev/ram8 [ 64.00 MiB]
/dev/ram9 [ 64.00 MiB]
/dev/ram10 [ 64.00 MiB]
/dev/ram11 [ 64.00 MiB]
/dev/ram12 [ 64.00 MiB]
/dev/ram13 [ 64.00 MiB]
/dev/ram14 [ 64.00 MiB]
/dev/ram15 [ 64.00 MiB]
/dev/sdb1 [ 511.00 MiB]
/dev/sdb2 [ 931.01 GiB] LVM physical volume
3 disks
18 partitions
0 LVM physical volume whole disks
2 LVM physical volumes
root@pve:~# lvdisplay
--- Logical volume ---
LV Path /dev/pve/swap
LV Name swap
VG Name pve
LV UUID EAoUwq-wFA2-woLM-zAA4-7awp-Isvg-YNFX2z
LV Write Access read/write
LV Creation host, time proxmox, 2012-11-23 16:54:26 -0500
LV Status available
# open 2
LV Size 15.00 GiB
Current LE 3840
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:1

--- Logical volume ---
LV Path /dev/pve/root
LV Name root
VG Name pve
LV UUID GnxYRt-uzBU-diWl-BZxa-eMan-heHb-ymH9el
LV Write Access read/write
LV Creation host, time proxmox, 2012-11-23 16:54:26 -0500
LV Status NOT available
LV Size 96.00 GiB
Current LE 24576
Segments 1
Allocation inherit
Read ahead sectors auto

--- Logical volume ---
LV Path /dev/pve/data
LV Name data
VG Name pve
LV UUID X3Yt7A-r2i7-PwTv-NJaY-uF1L-vZ89-Qht4fV
LV Write Access read/write
LV Creation host, time proxmox, 2012-11-23 16:54:26 -0500
LV Status available
# open 1
LV Size 804.02 GiB
Current LE 205828
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:2

--- Logical volume ---
LV Path /dev/pve/swap
LV Name swap
VG Name pve
LV UUID JtlCzr-0iag-OvZT-Ovfc-DgPD-CNVD-jO3DuR
LV Write Access read/write
LV Creation host, time proxmox, 2015-10-20 08:22:25 -0400
LV Status NOT available
LV Size 15.00 GiB
Current LE 3840
Segments 1
Allocation inherit
Read ahead sectors auto

--- Logical volume ---
LV Path /dev/pve/root
LV Name root
VG Name pve
LV UUID 3YQl1S-wntY-xW74-oAmJ-7ddN-0gnr-tZRUcB
LV Write Access read/write
LV Creation host, time proxmox, 2015-10-20 08:22:26 -0400
LV Status available
# open 1
LV Size 96.00 GiB
Current LE 24576
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0

--- Logical volume ---
LV Path /dev/pve/data
LV Name data
VG Name pve
LV UUID n4X2Xk-vqeC-yPGi-C7tD-brom-wxSX-ls1NYl
LV Write Access read/write
LV Creation host, time proxmox, 2015-10-20 08:22:26 -0400
LV Status NOT available
LV Size 3.51 TiB
Current LE 921318
Segments 1
Allocation inherit
Read ahead sectors auto


A push in the right direction and I think I can recover this. Thanks.
 
To solve the same name problem look at the output of
Code:
vgdisplay
There distinguish the two drives via size, that parameter should be known. Then execute
Code:
vgrename <UUID> pve-old
# for example:
vgrename TuZdhv-KITA-cZm1-0nDy-cw3W-LuMX-zBMx9K pve-old

This will rename the old drives volume to 'pve-old', please be sure that you rename the correct (old disk) as you may not boot in the pve system from the renamed disk afterwards (which doesn't matter for the old disk).

Afterwards you could mount the data partition with:
Code:
# make some directory for the mount
mkdir /mnt/old-data
mount /dev/pve-old/data /mnt/old-data

Now you should be able to access the data LV from the old disk.
 
Hi,

I got to and copied the data from the /images and /private folders to the new drive, however I seem to not be able to find the config files in the etc/pve after mounting the root. Is there another location (backup) for these files, or can they be re-created?

PS I have not created anything on the new drive's installation.

Thanks.
 
Hi,

I got to and copied the data from the /images and /private folders to the new drive, however I seem to not be able to find the config files in the etc/pve after mounting the root. Is there another location (backup) for these files, or can they be re-created?

PS I have not created anything on the new drive's installation.

Thanks.
Hi,
etc/pve is an virtual filesystem.

See in the wiki on http://pve.proxmox.com/wiki/Proxmox_Cluster_file_system_(pmxcfs)

Udo
 
Hi,

I stopped the cluster, renamed the new install config.db/host/hostname files to -old, copied the config.db, hosts and hostname from the old drive to new, and rebooted. I can SSH into the server, but the HTTPS won't connect anymore.

Thanks
 
Hi,

OK...I got the vm's going, but the openvz's are showing, but not starting. Where would the config files be on the mounted drive so this new install will know how to get them going?

Thanks.
 
I see...reading those links, it appears the openvz's need to be running for this to work. The old drive doesn't boot, so I can't log into the vz's to create the backups needed...? Is there another way?

Thanks.
 
Thinking on this a little further, how about I program another drive with VE 3.4, transfer openvz's, config.db and start that up. Then do the openvz backup, and transfer those backups to the VE 4 and follow the conversion to LXC. It's a little long in the road to success, and I was hoping there was a shorter way, but that should work, right?

Thanks.
 
Thinking on this a little further, how about I program another drive with VE 3.4, transfer openvz's, config.db and start that up. Then do the openvz backup, and transfer those backups to the VE 4 and follow the conversion to LXC. It's a little long in the road to success, and I was hoping there was a shorter way, but that should work, right?

Thanks.

Hi,
I think so long is the way not - simply install 3.4 on an "normal" computer (for openvz you need 64bit only). You need an free HDD only and are finish in less than 20 minutes.

Connect your old hdd - or transfer the data (transfer can take some time, depends on data usage/network speed) and than you should be able to start the old containers and if all work do an backup...

Udo
 
Hi,

Just wanted to let you know that I have PVE 3.x up and running with all KVM and openvz's going properly. I was just about to back up openvz's and see if I can bring them over to the newly installed 4.x, converting to the new lxc.

Thank you for answering my questions. You have been a great source of information and help while I was going through this 'disaster' (in my eyes).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!