[SOLVED] Change hostname: can't copy old node to new node

Andre_x

Member
Feb 15, 2021
33
2
13
41
I'm trying to copy all the contend of /etc/pve/nodes/OLD-HOSTNAME/ to /etc/pve/nodes/NEW-HOSTNAME/, but I get the error:

Code:
sudo cp -rf /etc/pve/nodes/debian/* /etc/pve/nodes/castore-host/
cp: cannot create regular file '/etc/pve/nodes/castore-host/qemu-server/101.conf': File exists
cp: cannot create regular file '/etc/pve/nodes/castore-host/qemu-server/100.conf': File exists

Why? That folder is empty:

Code:
sudo ls -la /etc/pve/nodes/castore-host/qemu-server/
total 0
drwxr-xr-x 2 root www-data 0 Mar 29 17:37 .
drwxr-xr-x 2 root www-data 0 Mar 29 17:37 ..
 
cp -rf /etc/pve/nodes/debian/*

My suspicion: this will also try to copy the folder "qemu-server" - and this fails.

Notice that /etc/pve is not a folder but a fuse-mounted database. Not all semantics are implemented identically as for "normal" filesystems...
 
Do you see the error even if you copy a single VM config file?
I did, with the same result.

My suspicion: this will also try to copy the folder "qemu-server" - and this fails.
I tried with a single file
Code:
cp -rf /etc/pve/nodes/debian/qemu-server/100.conf /etc/pve/nodes/castore-host/qemu-server/
and the problem persist.

Notice that /etc/pve is not a folder but a fuse-mounted database. Not all semantics are implemented identically as for "normal" filesystems...
I didn't know that. How can I copy those 2 files?
 
Read: https://pve.proxmox.com/pve-docs/chapter-pmxcfs.html

That filesystem is only writeable as long as Quorum is fulfilled. Did you establish a cluster? Possibly with two nodes? If yes: https://pve.proxmox.com/pve-docs/chapter-pvecm.html#_corosync_external_vote_support might help.

Only if my suspicion is right: the not-recommended hammer to make it go by brute force is "pvecm expected 1" - search for it, before using it. You will destroy the consistency of the cluster!
No cluster, I only have this single node.
I've solved with the infro from this post. Changing hostname creates a new datacenter, with the oldone still in place, So the file 100.conf and 101.conf already existed. I've copied 100.conf from the old folder to 102 into the new one and 101 into 103 and the problem was solved.
 
  • Like
Reactions: UdoB

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!