How to Rename Vm Id on Pve

How to rename VMID on PVE

1
2
3
4
5
6
7
8
9
VMID=121 && \ 
	NEW_VMID=1001 && \
	POOL_NAME=tank && \
	qm unlock $VMID && \
	qm stop $VMID && \
	sed -i "s/$VMID/$NEW_VMID/g" /etc/pve/qemu-server/$VMID.conf && \
	mv /etc/pve/qemu-server/$VMID.conf /etc/pve/qemu-server/$NEW_VMID.conf &&  \
	rbd --pool $POOL_NAME rename vm-$VMID-disk-0 vm-$NEW_VMID-disk-0 &&\
 	qm start $NEW_VMID
Built with Hugo
Theme Stack designed by Jimmy