melato / lxops

Apache License 2.0
8 stars 0 forks source link

lxops rebuild should use lxd/incus rebuild #4

Closed melato closed 12 months ago

melato commented 12 months ago

lxops rebuild should use lxd/incus rebuild.

lxops rebuild does the following:

Before the delete it gets certain aspects of the image configuration: profiles, hwaddresses, which it then tries to restore during or after the launch.

The native (lxd/incus) rebuild preserves instance configuration, so there is no need for lxops to attempt to do this. All lxops has to do is reconfigure the instance by applying the cloud-init files after the rebuild.

This is limited to containers that are launched from images. It probably does not work for an instance that is copied from another instance snapshot.

melato commented 12 months ago

This change will also fix a few bugs with the current home-grown rebuild. The one I am aware of is https://github.com/melato/lxops/issues/5

melato commented 12 months ago

Added and used InstanceServer.Rebuild(image, instance string)