Closed MichaelThamm closed 1 month ago
When placing the vm-profile.yaml
in the snap's common
directory, the following command still lacks permissions:
lxc profile edit test-iac < ~/snap/lxd/common/vm-profile.yaml
Error: read /dev/stdin: permission denied
@MichaelThamm I couldn't reproduce the issue in a local Jammy VM:
ubuntu@v1:~$ snap list core24 lxd snapd
Name Version Rev Tracking Publisher Notes
core24 20240528 423 latest/stable canonical✓ base
lxd git-c795f4d 29770 latest/edge canonical✓ -
snapd 2.63 21759 latest/stable canonical✓ snapd
ubuntu@v1:~$ uname -a
Linux v1 5.15.0-1063-kvm #68-Ubuntu SMP Fri Jul 12 08:20:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@v1:~$ lxc profile show default
name: default
description: Default LXD profile
config: {}
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
used_by: []
ubuntu@v1:~$ lxc profile show default | sed 's/Default/Customized/' > profile.yaml
ubuntu@v1:~$ lxc profile edit default < profile.yaml
ubuntu@v1:~$ lxc profile show default
name: default
description: Customized LXD profile
config: {}
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
used_by: []
Could you check in dmesg
if there are apparmor denials associated with the failed edit
?
@simondeziel I tried this again on my host and in my charm-dev VM and was not able to reproduce the issue with 2 different snap versions (5.0.3-80aeff7
and 5.21/stable
). I am not sure what the difference is in my setup but I assume the issue can be closed, what are your thoughts?
I remember running into similar issues (with Juju strictly confined IIRC) but not with LXD. As such, let's close this and please do re-open if you meet it again, thanks!
Required information
Ubuntu
22.04.4 LTS (Jammy Jellyfish)
Issue description
According to the How to use profiles docs, it should be possible to edit a profile by passing in a YAML file like so:
However, this results in error:
Alternatively, this approach does work:
cat vm-profile.yaml | lxc profile edit test-iac
If this is a snap limitation then the docs would need updating.
Steps to reproduce
Information to attach
lxc profile show test-iac
) lxd-info.txt