move pve root disk

RobFantini

Famous Member
May 24, 2012
2,042
107
133
Boston,Mass
Hello

I want to replace a pve lvm root disk with a zfs raidz1 .

the steps planned so far:

1 - leave the old system on.

2- create a new pve system install to zfs raid-1 .

3- back these up from source system
/etc/



4- shutdown source system, move new disks . start system to runlevel 1
cp /etc/fstab /root/
restore /etc/
cp /root/fstab /etc/


Question - is there anything else beside /etc/ I need to restore to new system?


Usually I'd just reinstall, however this system is set up with 8 ceph OSD's. So it is worth a try to try something besides a reinstall.
 
so /etc/pve/ can not just be rsynced to the new systems's /etc/pve/ .

Is there a way to restore /etc/pve/ to the new root storage?
 
Hi Rob,
for /etc/pve take a look here: https://pve.proxmox.com/wiki/Proxmox_Cluster_File_System_(pmxcfs)#_recovery

I'm not sure if there are not much more files in /etc, which you don't want to overwrite from your old system!

Udo

On the 1ST host I tried just backup and restore the database then reboot . [ not an rsync of original /etc/] That did not work, I tried a new more things like rsync old sys /etc/ssh/ a reboot and a few more things. no luck. So reinstalled.
Code:
# ll /var/lib/pve-cluster
total 17
-rw------- 1 root root 28672 Nov  7 08:59 config.db

# cp save/config.db /var/lib/pve-cluster
cp: overwrite '/var/lib/pve-cluster/config.db'? y

# ll /var/lib/pve-cluster
total 61
-rw------- 1 root root 262144 Nov  7 09:07 config.db

# init 6

this was the error:
Code:
# pvecm nodes
Cannot initialize CMAP service

I've one more host to do , in case you or someone has something else to try.
 
Hi,

The safe way to go is this:
- make a backup of yours VM
- make a backup of /etc and /var

Then reinstall proxmox with zfs and restore your VM from backups (external backup).
 
Hi,

The safe way to go is this:
- make a backup of yours VM
- make a backup of /etc and /var

Then reinstall proxmox with zfs and restore your VM from backups (external backup).

thanks for the suggestion.

However the host to reinstall is part of a cluster. So I do not think that will work?
 
well if it is part of a cluster it should be easier than,
move all VMs from the host to other hosts in the cluster.
make a backup of the system just in case.
shut it down, use this guide to remove the node. https://www.sysadmin-community.com/remove-node-from-cluster-proxmox/

replace the OS drive(s) with new ones (this will also server as crude backup in addition to real backup you made before shutting down the node) and reinstall Proxmox. you will need to use new name and IP. add new node to the cluster. and redistribute the VMs as needed.
 
thanks for the suggestion.

However the host to reinstall is part of a cluster. So I do not think that will work?
Hi,
I've done this two time in the last months - switch an clusternode from lvm-root to zfs-ssd-root.
Due config distribution via puppet it wasn't an problem for me.

You have to save the ssh keys (/etc/ssh + /root/.ssh), corosync auth+conf (/etc/corosync/) and network config.

Reinstall, adapt the network config, restore all ssh-keys, do an tar from /etc/pve from another cluster node.
tar this back an the new fresh server (you have quorum, because it's standalone and not part of the cluster yet).
reboot and the node should be in the cluster again (if I had not forgot an config-file).

Udo
 
  • Like
Reactions: RobFantini
Hi,
I've done this two time in the last months - switch an clusternode from lvm-root to zfs-ssd-root.
Due config distribution via puppet it wasn't an problem for me.

You have to save the ssh keys (/etc/ssh + /root/.ssh), corosync auth+conf (/etc/corosync/) and network config.

Reinstall, adapt the network config, restore all ssh-keys, do an tar from /etc/pve from another cluster node.
tar this back an the new fresh server (you have quorum, because it's standalone and not part of the cluster yet).
reboot and the node should be in the cluster again (if I had not forgot an config-file).

Udo

Udo - thank you , I've already deleted and reintall the nodes , ran out of testing time.

I will try this out later in the month .

PS:
regarding puppet - do you happen to have any links or books to recommend? I've got to modernize our old configuration file management system . 1999 version using bash case statements and rsync since it came out .

could you share the code for that? reading the lines and looking up what they do in a reference is the fastest way i can think of for learning this.
 
Hi Udo,

i've just got started with foreman, thank you for the suggestion. there are plenty of docs and examples to follow.

quick question - do you use puppet for dhcp ? [ we currently use OpenNetAdmin for that - I think you used that in tha past? ]
Hi Rob,
we do it the same way (at my last job) - dhcp with ona, installation via pxe (or normal installation on pve-hosts).

Udo