Unable to destroy containers


(Akshat Jiwan Sharma) #1

Hi everyone,

I’m facing a strange issue. When I do lxc list on my console I get a list of containers on my system. However when I try to destroy one of those containers using lxc-destroy --name=“container-name” I get

Container is not defined

response back from the client. Any ideas on what might be the issue?

The containers were all built by juju, if that is relevant

Thanks,
Akshat


#2

You are mixing the LXD commands with the LXD 1.0 commands.
Here is how to delete a container.

$ lxc list -cns
+---------------+---------+
|     NAME      |  STATE  |
+---------------+---------+
| mycontainer   | RUNNING |
+---------------+---------+
$ lxc stop mycontainer
$ lxc delete mycontainer
$

and that's it.

You can remove the lxc1 package in order to avoid using by accident those LXC 1.0 commands.


(Akshat Jiwan Sharma) #3

Thanks @simos! It worked.