Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #3661/58eb94ff backport][stable-4] lxd_container: support lxd instance types #3761

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Nov 20, 2021

This is a backport of PR #3661 as merged into main (58eb94f).

SUMMARY

This MR adds support to lxd_container module to deploy either containers or virtual-machines. For that it was necessary to create two new parameters api_endpoint and type:

  • api_endpoint: is required in order to be backwards compatible with old LXD servers, which does not support the new API endpoint /1.0/virtual-machines or /1.0/instances (implemented in lxd 3.19)
  • type: there is two different types of instances, “container” or “virtual-machine”

It is related to:

It is a different approach of an open MR:

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

lxd_container

ADDITIONAL INFORMATION

The old functionality has not changed. Additionally I've tested the changes only with the latest LXD version 4.19.

  • it is possible to create virtual-machine or container
  • if an instance already exists and someone tries to update its "type" from container to virtual-machine or vice-versa, it fails with a warning, otherwise I was only getting changed as status, which is not correct.

* lxd_container: support lxd instance types

Update the lxd_container module to enable the new LXD API endpoint,
which supports different types of instances, such as containers and virtual machines.
The type attributes can be set explicitly to create containers or virtual machines.

* lxd_container: rename references from containers to instances

* lxd_container: add an example of creating vms

* lxd_container: update doc

* lxd_container: fix pylint

* resolve converstation

* remove type from config

* remove outdated validation related to the instance api

* correct diff

* changing last bits

* add missing dot

(cherry picked from commit 58eb94f)
@ansibullbot ansibullbot added backport cloud feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type) labels Nov 20, 2021
@felixfontein felixfontein merged commit 78316fb into stable-4 Nov 20, 2021
@felixfontein felixfontein deleted the patchback/backports/stable-4/58eb94fff38b7eba8d5116bd4b3c35c9ced08bbe/pr-3661 branch November 20, 2021 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants