Convert to template when using shared storage failing

nmiller0113

Active Member
Aug 23, 2012
16
1
43
I get this message when attempting to convert a VM that has disks in shared storage to a template:

Code:
root@pve2:/mnt/pve/fs1/cloudinit# qm template 9000
/usr/bin/chattr: Operation not supported while setting flags on /mnt/pve/fs1/images/9000/base-9000-disk-0.raw
command '/usr/bin/chattr +i /mnt/pve/fs1/images/9000/base-9000-disk-0.raw' failed: exit code 1

Is there a way to make this work, or is this just a limitation of using shared storage (I've tried both nfs and cifs) and chattr? It appears the VM still becomes a template, but the immutable flag is never set on the disk image. I cannot seem to find any documentation of others having this issue. The reason I'm attempting to set it up this way is so I can clone between multiple proxmox hosts which require shared storage.
 
What shared storage are you using? Is it possible that it doesnt support "i" flag? Try to set it manually on arbitrary file and see if that works. For example on our NFS storage:
Code:
chattr +i test1
chattr: Operation not supported while reading flags on test1
# echo $?
1
I havent looked why this happens for us as it doesnt affect our operations. But clearly its an NFS client/server level issue, rather than PVE.

I believe the flag setting wont affect template operations, so if everything works after conversation you should be ok to ignore it.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Thanks @bbgeek17! I've actually done exactly as you mentioned. I've tried this from my pve instances using both CIFS and NFS (currently CIFS), and both have the same resulting error. If I go to my Synology NAS I can do it locally with the same proxmox user I created to map the share, but I have to use sudo:

Code:
proxmox@fs1:/volume1/proxmox$ touch test
proxmox@fs1:/volume1/proxmox$ chattr +i test
chattr: Operation not permitted while setting flags on test
proxmox@fs1:/volume1/proxmox$ sudo chattr +i test
proxmox@fs1:/volume1/proxmox$ lsattr test
----i------------- test
proxmox@fs1:/volume1/proxmox$

So I'm assuming it's the sudo requirement that's causing it but I'm not entirely sure how to navigate this as the user has full r/w permissions. I'm still digging into this on the Synology side, but thought that others may have also seen this.
 
Last edited:
After looking into this further, it doesn't appear that I'll ever be able to chattr over a NAS share...at least not with how Synology is configured from a system-hardening perspective...and it makes sense. There is no direct root access, for good reason, without a privilege escalation...which is required for chattr.

So, functionally, the template is defined successfully in Proxmox, but the disk images do not become immutable.
 
  • Like
Reactions: bbgeek17