Project feature - several errors working with profiles


(Manuel ) #1

Hi,

In a project with features.profiles: "true" appear several errors at the time of work with profiles. Project DMZS with two containers and four profiles:

magasix@lxd:~$ lxc project show DMZS
description: ""
config:
  features.images: "false"
  features.profiles: "true"
name: DMZS
used_by:
- /1.0/containers/sext?project=DMZS
- /1.0/containers/sint?project=DMZS
- /1.0/profiles/FW?project=DMZS
- /1.0/profiles/default?project=DMZS
- /1.0/profiles/dmzext?project=DMZS
- /1.0/profiles/dmzint?project=DMZS
- /1.0/profiles/intranet?project=DMZS

Problem#1: I can not assign a new profile to the container
If I try to change the profile of the container sint from dmzint to dmzext I’ll receive a error “Profile doesn’t exist:”, but profile dmzext exists.

magasix@lxd:~$ lxc info sint
Name: sint
Location: none
Remote: unix://
Architecture: x86_64
Created: 2018/10/26 18:05 UTC
Status: Stopped
Type: persistent
Profiles: dmzint
magasix@lxd:~$ lxc profile assign sint dmzext
Error: Profile doesn't exist: dmzext
magasix@lxd:~$ lxc profile show dmzext
config: {}
description: ""
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: dmzext
    type: nic
  root:
    path: /
    pool: default
    type: disk
name: dmzext
used_by:
- /1.0/containers/sext?project=DMZS

If I create a new container with the profile dmzext there’s no problem:

magasix@lxd:~$ lxc launch xenial64 sext01 -p dmzext
Creating sext01
Starting sext01
magasix@lxd:~$ lxc profile show dmzext
config: {}
description: ""
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: dmzext
    type: nic
  root:
    path: /
    pool: default
    type: disk
name: dmzext
used_by:
- /1.0/containers/sext?project=DMZS
- /1.0/containers/sext01?project=DMZS

Problem#2: I can not modify a profile previously assigned to a container

I enter into the editor but when I exit it I enter in a loop.

magasix@lxd:~$ lxc profile edit dmzint 
Config parsing error: The following containers failed to update (profile change still saved):
 - sint: Profile doesn't exist: dmzint

Press enter to open the editor again

Config parsing error: The following containers failed to update (profile change still saved):
 - sint: Profile doesn't exist: dmzint

Press enter to open the editor again
    
Config parsing error: The following containers failed to update (profile change still saved):
 - sint: Profile doesn't exist: dmzint

Press enter to open the editor again

Config parsing error: The following containers failed to update (profile change still saved):
 - sint: Profile doesn't exist: dmzint

Press enter to open the editor again

If I modify the profile some times appears messages like this:

Config parsing error: ETag doesn't match: ac3bc9229df20427970a0e80deb3f521420098928ab8ba9c25d41d4c89eba6a0 vs f6f1361a8c1c28e4691dd19cd9c09d0049f4d8625c838acfaeeaed41a6bceb3e
Press enter to open the editor again

Config parsing error: ETag doesn't match: ac3bc9229df20427970a0e80deb3f521420098928ab8ba9c25d41d4c89eba6a0 vs f6f1361a8c1c28e4691dd19cd9c09d0049f4d8625c838acfaeeaed41a6bceb3e
Press enter to open the editor again

If I exit with CTRL+C the changes persists.

I see that you are working in the project feature but I don’t know if you experiment these issues

Salutes


(Stéphane Graber) #2

I’ve just released an update to the stable snap which should fix a number of database related issues with projects, maybe that’ll help with what you’re seeing.


(Manuel ) #3

OK. In snap version 3.6 (9412) the problems exist:

  • assign/add a profile to an existing container (but no problem when assign during lxc launch)

  • Edit a profile that is assigned to a container at least (but no problem if no container is using it). I can modify the profile, save the changes and when the error message appears, I close the editor with CTRL+C and changes persist.

Salutes


(Stéphane Graber) #4

Will look into this shortly.


(Stéphane Graber) #5

Reproduced the issue


(Stéphane Graber) #6

(Manuel ) #7

OK. I will try again when the new version comes out

Thanks for your great job


(Manuel ) #8

Hi,
With snap lxd version 3.6 (9437):
Problem#1: I can not assign a new profile to the container --> not solved
Problem#2: I can not modify a profile previously assigned to a container --> solved

In problem#1:

  • If I create a new container with the profile dmzext there’s no problem

  • If I try to add/assign a profile to an existing container I receive the error “Error: Profile doesn’t exist: name of the profile”.

I tried it in a project already created as in a new one.

Salutes


(Stéphane Graber) #9

I think I fixed the addition of profile to containers yesterday but the fix isn’t in the snap yet.


(Stéphane Graber) #10

Fix should be available now, run snap refresh lxd


(Manuel ) #11

Yes, It’s working with snal LXD 3.6 (9510).

Great job.
Thanks!!