canonical / pylxd

Python module for LXD
https://pylxd.readthedocs.io/en/latest/
Apache License 2.0
256 stars 135 forks source link

Lxc copy for clone lxc non exsiste in pylxd #514

Open vincent-sensei opened 2 years ago

vincent-sensei commented 2 years ago

there is no function to clone the container with the native function of lxc copy?

Mohamedemad4 commented 2 years ago

You can use the create function to clone containers by setting the source to container.

something like:

config  = {
    'name': ' name ',
    'source': {
        'type':'copy',
        'source': 'original-container' 
    }

lxd.create(config) # will clone original-container

see: https://pylxd.readthedocs.io/en/latest/instances.html#examples