ceph key migration on ceph-fs

freshdomi

Member
Oct 20, 2022
4
1
23
Hello,

i currently trying to rotate the keys of my ceph storage; all vms on all hosts have been rotated successfully exepect 4 hosts having the ceph-fs mount and i cant get them using the new keys.. i already tried Live Migration, Stop/Start the VM, Stopping all vms having the ceph-fs mount and umounted the ceph-fs on all px hosts.. nothing worked..
is there something i have missed?

next step would be Stopping the vms and start the script with the option '--confirm-all-clients-refreshed' and hoping that everything goes up again..



Code:
root@px01:~# /usr/share/pve-manager/migrations/pve-cephx-rotate-service-keys --rotate-all-storage-keys --rotate-admin-key --verbose
INFO: This is a dry run. No Ceph key, cipher setting, or daemon will be changed. Session observations can update the migration journal.
INFO: the new key of 'client.admin' is staged next to its current one; both authenticate until it is committed with '--confirm-clients-refreshed client.admin' or, once every open record is ready, '--confirm-all-clients-refreshed'
PASS: Every service key uses 'aes256k', and so do the service tickets.

Client keys awaiting action:
  'client.admin': 4 session(s) still authenticate with a previous key (172.26.233.46: 1,
    172.26.233.47: 1, 172.26.233.48: 1, 172.26.233.50: 1). Both keys remain valid. Refresh these
    clients, then rerun without options.
Refresh clients of the affected Ceph users:
  Live-migrate affected VMs to another up-to-date node with the new keyring, including VMs with
    kernel RBD disks. A guest reboot does not reload the key. Fully stop and start only VMs that
    cannot be migrated.
  Remount affected kernel CephFS mounts. A container on RBD keeps the key its disks were mapped
    with until it is fully stopped and started. Restart other clients after updating any external
    key copies.
The Ceph CLI and Proxmox VE storages without a dedicated user normally use 'client.admin'. VMs and mounts on those storages can retain its previous key.
Session absence does not prove that disconnected clients or external key copies were refreshed.
 
Hi,

Did you resolved the issue? If not - please provide us with the current script output and `pveversion -v`.
 
Hello,

I have the same behavior, after migrating all the guest, 1 sessions per host seems reported active by the script.

Bash:
root@h04:~# /usr/share/pve-manager/migrations/pve-cephx-rotate-service-keys
INFO: This is a dry run. No Ceph key, cipher setting, or daemon will be changed. Session observations can update the migration journal.
PASS: Every service key uses 'aes256k', and so do the service tickets.

Client keys awaiting action:
  'client.admin': 4 session(s) still authenticate with a previous key (h01: 1, h02: 1, h03: 1, h04:
    1). Both keys remain valid. Refresh these clients, then rerun without options.
Possible clients (host-wide hints, not session attribution):
Kernel hints mean sockets without an owning process.
  h01: VM 102, VM 211, VM 218, VM 224, VM 243, VM 252, VM 283, VM 288, 11 more VMs; 3 unattributed sockets (possible kernel clients)
  h02: VM 200, VM 201, VM 231, VM 236, VM 242, VM 244, VM 246, VM 248, 18 more VMs; 3 unattributed sockets (possible kernel clients)
  h03: VM 204, VM 208, VM 209, VM 212, VM 214, VM 215, VM 220, VM 222, 13 more VMs; 2 unattributed sockets (possible kernel clients)
  h04: VM 282; 3 unattributed sockets (possible kernel clients)
Refresh clients of the affected Ceph users:
  Live-migrate affected VMs to another up-to-date node with the new keyring, including VMs with
    kernel RBD disks. A guest reboot does not reload the key. Fully stop and start only VMs that
    cannot be migrated.
  Remount affected kernel CephFS mounts. A container on RBD keeps the key its disks were mapped
    with until it is fully stopped and started. Restart other clients after updating any external
    key copies.
The Ceph CLI and Proxmox VE storages without a dedicated user normally use 'client.admin'. VMs and mounts on those storages can retain its previous key.


Bash:
root@h04:~# pveversion -v
proxmox-ve: 9.2.0 (running kernel: 7.0.14-30-pve)
pve-manager: 9.2.32 (running version: 9.2.32/60a22e26e411402f)
proxmox-kernel-helper: 9.2.1
pve-kernel-6.2: 8.0.5
proxmox-kernel-7.0: 7.0.14-30
proxmox-kernel-7.0.14-30-pve-signed: 7.0.14-30
proxmox-kernel-6.8.12-43-pve-signed: 6.8.12-43
proxmox-kernel-6.8: 6.8.12-43
proxmox-kernel-6.5.13-6-pve-signed: 6.5.13-6
proxmox-kernel-6.5: 6.5.13-6
proxmox-kernel-6.5.11-6-pve-signed: 6.5.11-6
proxmox-kernel-6.2.16-20-pve: 6.2.16-20
proxmox-kernel-6.2: 6.2.16-20
proxmox-kernel-6.2.16-19-pve: 6.2.16-19
pve-kernel-6.2.16-3-pve: 6.2.16-3
ceph: 19.2.7-pve1
ceph-fuse: 19.2.7-pve1
corosync: 3.2.0-pve1
criu: 4.1.1-1
frr-pythontools: 10.6.1-1+pve3
ifupdown2: 3.3.0-1+pmx14
intel-microcode: 3.20260925.1~deb13u1
ksm-control-daemon: 1.5-1
libjs-extjs: 7.0.0-9
libproxmox-acme-perl: 1.7.3
libproxmox-backup-qemu0: 2.0.4
libproxmox-rs-perl: 0.4.3
libpve-access-control: 9.2.2
libpve-apiclient-perl: 3.4.3
libpve-cluster-api-perl: 9.1.12
libpve-cluster-perl: 9.1.12
libpve-common-perl: 9.2.12
libpve-guest-common-perl: 6.0.11
libpve-http-server-perl: 6.0.7
libpve-network-perl: 1.6.10
libpve-notify-perl: 9.1.12
libpve-rs-perl: 0.16.3
libpve-storage-perl: 9.1.18
libspice-server1: 0.15.2-1+b1
lvm2: 2.03.31-2+pmx1
lxc-pve: 7.0.0-2
lxcfs: 7.0.0-pve1
novnc-pve: 1.7.0-3
proxmox-backup-client: 4.2.14-1
proxmox-backup-file-restore: 4.2.14-1
proxmox-backup-restore-image: 1.1.0
proxmox-enterprise-support-keyring: 1.1
proxmox-firewall: 1.2.6
proxmox-kernel-helper: 9.2.1
proxmox-mail-forward: 1.2.0
proxmox-mini-journalreader: 1.7
proxmox-widget-toolkit: 5.2.15
pve-cluster: 9.1.12
pve-container: 6.1.24
pve-docs: 9.2.15
pve-edk2-firmware: 4.2026.08-1
pve-esxi-import-tools: 1.0.1
pve-firewall: 6.0.8
pve-firmware: 3.18-9
pve-ha-manager: 5.2.6
pve-i18n: 3.11.0
pve-notify-worker: 1.2.0
pve-qemu-kvm: 11.1.3-4
pve-xtermjs: 6.0.0-3
qemu-server: 9.2.20
smartmontools: 7.5-pve2
spiceterm: 3.4.2
swtpm: 0.10.2+pve3
vncterm: 1.9.2
zfsutils-linux: 2.4.4-pve1
 
Hi,

Thanks for the response.
Can you be more specific on "ensure that the CephFS is not active or idle" ?
I only have ISO and CT Template on CephFS, I've disconnected all remaining iso from all VM, I even try to disable "cephfs" storage on the cluster.
No change on the script output with --apply, still have 1 connection left per node.
I noticed that disabling cephfs cluster storage don't remove the mount on /mnt/pve/cephfs, do I need to unmount it manually ? If yes what's the safe way to be able to remount it after.

Code:
root@h04:~# /usr/share/pve-manager/migrations/pve-cephx-rotate-service-keys --apply
INFO: Recovery and confirmations may run before the remaining plan can be shown.

Apply this run, including recovery and any requested key confirmations? (y/N) y
INFO: Collecting cluster info.
PASS: Every service key uses 'aes256k', and so do the service tickets.

Client keys awaiting action:
  'client.admin': 4 session(s) still authenticate with a previous key (h01: 1, h02: 1, h03: 1, h04:
    1). Both keys remain valid. Refresh these clients, then rerun without options.
Possible clients (host-wide hints, not session attribution):
Kernel hints mean sockets without an owning process.
  h01: VM 102, VM 211, VM 218, VM 224, VM 243, VM 252, VM 283, VM 288, 11 more VMs; 3 unattributed sockets (possible kernel clients)
  h02: VM 200, VM 201, VM 231, VM 236, VM 242, VM 244, VM 246, VM 248, 18 more VMs; 3 unattributed sockets (possible kernel clients)
  h03: VM 204, VM 208, VM 209, VM 212, VM 214, VM 215, VM 220, VM 222, 13 more VMs; 2 unattributed sockets (possible kernel clients)
  h04: VM 282; 3 unattributed sockets (possible kernel clients)
Refresh clients of the affected Ceph users:
  Live-migrate affected VMs to another up-to-date node with the new keyring, including VMs with
    kernel RBD disks. A guest reboot does not reload the key. Fully stop and start only VMs that
    cannot be migrated.
  Remount affected kernel CephFS mounts. A container on RBD keeps the key its disks were mapped
    with until it is fully stopped and started. Restart other clients after updating any external
    key copies.
The Ceph CLI and Proxmox VE storages without a dedicated user normally use 'client.admin'. VMs and mounts on those storages can retain its previous key.
 
I meant unused. Storage ISO files are fine, no process should currently use the mount. And disabling the storage does not unmount it. You have to run:
Bash:
umount /mnt/pve/cephfs
then re-enable the storage and run `pvesm status --storage cephfs` on every node to remount it.

Afterwards, rerun the migration helper without options.

"auth_preferred_cipher" is still on "aes" in my cluster, maybe switching it to "aes256k" will refresh the key on next ticket ?
Do not change `auth_preferred_cipher` manually, it does not refresh existing session and it managed by the helper during the final step.
 
Thanks @Moayad, but this not helped still have 4 sessions left.

Here what I've done:
- Disable cephfs on the UI
- Run "umount /mnt/pve/cephfs" on each node
- Enable cephfs on the UI
- Run "pvesm status --storage cephfs" on each node
- Run "/usr/share/pve-manager/migrations/pve-cephx-rotate-service-keys"

Still have 1 session active per node.

Maybe it is not related to cephfs after all ?...