[lxc-users] Profile Assignment Error
Stéphane Graber
stgraber at ubuntu.com
Fri Mar 24 06:17:46 UTC 2017
The problem here is that you're mixing LXC and LXD containers.
The list of containers you showed camed from "lxc-ls" which is the LXC
command line tool.
You then went on to use those container names with "lxc profile" which
is the LXD command line tool. Since those containers aren't managed by
LXD, you can't assign profiles to them.
Unless you're in the middle of switching from LXC to LXD, you really
shouldn't have both set of tools installed as this leads to this kind of
confusion.
Stéphane
On Fri, Mar 24, 2017 at 08:10:50AM +0200, Gabriel Marais wrote:
> Thanks for the reply. It seems like none of the commands work:-
>
> lxc profile assign
> lxc profile apply
>
> I am going to setup my (test) pre-production environment today and take
> another look at the profiles again on that environment.
>
>
> Regards, Gabriel
>
> On Wed, Mar 22, 2017 at 2:03 PM, Jamie Brown <Jamie.Brown at mpec.co.uk> wrote:
>
> > This may not be the answer but I think the client commands for applying
> > profiles have changed, so depending on your version it could be that you
> > need to use one of;
> >
> >
> >
> > lxc profile assign [<remote>:]<container> <profiles>
> >
> > lxc profile add [<remote>:]<container> <profile>
> >
> > lxc profile remove [<remote>:]<container> <profile>
> >
> >
> >
> > Rather than lxc profile apply.
> >
> >
> >
> > *From: *lxc-users <lxc-users-bounces at lists.linuxcontainers.org> on behalf
> > of Gabriel Marais <gabriel.j.marais at gmail.com>
> > *Reply-To: *LXC users mailing-list <lxc-users at lists.linuxcontainers.org>
> > *Date: *Wednesday, 22 March 2017 at 11:50
> > *To: *"lxc-users at lists.linuxcontainers.org" <lxc-users at lists.
> > linuxcontainers.org>
> > *Subject: *[lxc-users] Profile Assignment Error
> >
> >
> >
> > Hi Guys
> >
> >
> >
> > I am having an issue assigning a profile to a container. Below my steps:-
> >
> >
> >
> > 1. List Profiles
> >
> > [13:43:12] root at vm-server-01:*~* # lxc profile list
> >
> > +---------+---------+
> >
> > | NAME | USED BY |
> >
> > +---------+---------+
> >
> > | default | 0 |
> >
> > +---------+---------+
> >
> > | docker | 0 |
> >
> > +---------+---------+
> >
> >
> >
> > 2. Create a new Profile
> >
> > [13:43:18] root at vm-server-01:*~* # lxc profile create migratetest
> >
> > Profile migratetest created
> >
> >
> >
> > [13:46:47] root at vm-server-01:*~* # lxc profile list
> >
> > +-------------+---------+
> >
> > | NAME | USED BY |
> >
> > +-------------+---------+
> >
> > | default | 0 |
> >
> > +-------------+---------+
> >
> > | docker | 0 |
> >
> > +-------------+---------+
> >
> > | migratetest | 0 |
> >
> > +-------------+---------+
> >
> >
> >
> > [13:48:47] root at vm-server-01:*~* # lxc-ls --fancy
> >
> > NAME STATE AUTOSTART GROUPS IPV4 IPV6
> >
> > paulus-test STOPPED 0 - - -
> >
> > snappy_1604 STOPPED 0 - - -
> >
> > ubuntu_1404 STOPPED 0 - - -
> >
> > ubuntu_1604 STOPPED 0 - - -
> >
> >
> >
> >
> >
> > 3. Link the container to the profile
> >
> > [13:45:21] root at vm-server-01:*~* # lxc profile apply ubuntu_1404
> > migratetest --debug
> >
> > DBUG[03-22|13:46:47] Raw response: {"type":"sync","status":"
> > Success","status_code":200,"operation":"","error_code":0,"
> > error":"","metadata":{"config":{"core.trust_password":true,"
> > images.auto_update_cached":"false","images.auto_update_
> > interval":"24","images.remote_cache_expiry":"5"},"api_
> > extensions":["storage_zfs_remove_snapshots","container_
> > host_shutdown_timeout","container_syscall_filtering","
> > auth_pki","container_last_used_at","etag","patch","usb_
> > devices","https_allowed_credentials","image_compression_algorithm","
> > directory_manipulation","container_cpu_time","storage_
> > zfs_use_refquota","storage_lvm_mount_options","network","
> > profile_usedby","container_push","container_exec_recording","certificate_
> > update","container_exec_signal_handling","gpu_devices"
> > ,"container_image_properties","migration_progress","id_map",
> > "network_firewall_filtering","network_routes","storage","
> > file_delete","file_append","network_dhcp_expiry","storage_
> > lvm_vg_rename","storage_lvm_thinpool_rename","network_
> > vlan","image_create_aliases","container_stateless_copy"],"
> > api_status":"stable","api_version":"1.0","auth":"trusted","public":false,"
> > environment":{"addresses":[],"architectures":["x86_64","
> > i686"],"certificate":"-----BEGIN CERTIF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wEAAaNgMF4wDgYDVR0PAQH/BAQDAgWg\
> > nMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwKQYDVR0RBCIwIIIM\
> > ndm0tc2VydmVyLTAxhwQKAAIPhwTAqDgChwQKAAMBMA0GCSqGSIb3DQEBCwU
> > AA4IC\nAQA4XPgirgpVx/UqyZorZH0XyXVHdmh4LJEF29okJ40E
> > uv9eSum2LZMeZA41Ts/8\nke+Gzwadj1yWGd+e33G9t2X8PyBhC0u30yA4VzqsT0/
> > pCKP51wUPScRLtfHzeUpG\nKwapB6buMnwKyqI6fNyNyxH2MhMDNzFOvJbQNmOs9H+
> > ojR7wB0sbfWAdOnnZHHAO\nyynDvfb0TvWbbw+KnCfnIUoaJza7qSUeeOuedrEl52FSp
> > brDeBiLqat/RIxhkv32\nfJMk5CwsAsw1lVkMvirUs4VNE9T17
> > ZWSOlzWaon2R1Hxggela9pzeB8gdnY/xtea\nzOmJ34oqmB8n9m+iNIELrs9pjyTWdm0a96sw/
> > RDs5lfy1TOIickNjXC5n1d5zSrb\nRv+eqUEAGku/j1ru/
> > j2dygYZBgaZ1xdqT1mbmZjoOnBpUU/BD9pTUKtj6kTXQ4C5\
> > nqddYtOOd3sLOX0LroX1s8bjCe7qikRKGb3VbAQMhuGPK+xNQ/6Yy+TLij70j1HI1\
> > ngHuAUrxfsIbRzKXUq7m2KMopedcRHeeWgGsAbI45F4w2QFBTtFz+9i3NMixtLL3a\
> > nD7lR6v71VjhuGeUecCY8XZmq1DQscOgKPdqCX+LV2lQ82JdTACk4G5aAP0RnwG3k\nm/
> > UgEHt84g+L1gHDkKS1N4EhekK8tGiLXebJnuRYTlG/4A==\n-----END
> > CERTIFICATE-----\n","certificate_fingerprint":"","
> > driver":"lxc","driver_version":"2.0.7","kernel":"Linux","
> > kernel_architecture":"x86_64","kernel_version":"4.4.0-62-
> > generic","server":"lxd","server_pid":1555,"server_
> > version":"2.12","storage":"","storage_version":""}}}
> >
> >
> >
> > DBUG[03-22|13:46:47] Raw response: {"error":"not
> > found","error_code":404,"type":"error"}
> >
> >
> >
> >
> >
> > Even with the container started, I get the same error. Can someone perhaps
> > point me in the right direction?
> >
> >
> >
> >
> >
> > Thanks, Gabriel
> >
> > _______________________________________________
> > lxc-users mailing list
> > lxc-users at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-users
> >
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170324/a3bf05fb/attachment.sig>
More information about the lxc-users
mailing list