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

Add a document for Terraform #1690

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add a document for Terraform #1690

wants to merge 1 commit into from

Conversation

atta
Copy link
Contributor

@atta atta commented Feb 23, 2023

A Document on how a potential Terraform
Provider for ganeti could be done

A Document on how a potential Terraform
Provider for ganeti could be done
@atta atta changed the title Add a document for Terrafor Add a document for Terraform Feb 23, 2023
Copy link
Member

@rbott rbott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @atta for your PR :-) I agree that we should provide an upstream terraform provider so that people can easier integrate Ganeti into their workflows/tools.

This should probably live in its own repository under the ganeti organisation.

Since we already have lots of Ganeti RAPI Go code in gnt-cc I would strongly suggest to create an official RAPI client in Go as a separate package which both projects can use. This way we avoid duplicating code.

What do you think?

I have also included some more comments in this review. In general I think we should specify what to expect from the terraform provider (and what not to expect from it) and how it should be used. This will allow others to join the development efforts as it will be much clearer what the scope of this project is.

- Go programming language: https://golang.org/
- Terraform schema language: https://www.terraform.io/docs/language/types/schema.html

11. Appendix: Example Configuration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to extend the examples to cover more usecases/parameters and also align the parameter names with ganeti (unless there are already conflicting conventions within terraform).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rbott my intention was to not overload this document: a lot of features are indeed possible with terraform but not jet a goal as a start.

Ganeti also has a Remote API that enables users to manage their Ganeti
cluster programmatically.

3. Scope
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section should go a bit more into detail about what should be implemented or can be expected from the provider, so that we end up with something people can use to create code and/or also use to compare against PRs etc.

  • supported hypervisors
  • supported disk templates
  • supported disk schemes (number of disks etc.)
  • supported network schemes (numbers of nics, network types etc.)
  • other supported features (e.g. automatic/manual node selection, custom hypervisor parameters)

I would suggest to start simple:

  • we only support KVM for the first iteration
  • all possible disk templates
  • only automatic instance allocation
  • any number of disks, any number of NICs
  • network mode bridged with optional parameters link, network and vlan (this should cover most usecases)
  • all backend parameters (maxmem, minmem, vcpus)
  • all current KVM hvparams (given that we are using a strongly typed language, supporting "any" parameter will be harder to implement. OTOH most people will likely use only few hvparams on instance level as most will usually be set on cluster level)
  • set OS type (and possibly also OS parameters?)

We also need to agree on what the provider should do with instance changes:

  • will new disks/NICs be hot- or cold-added? Will this be configurable?
  • will disks/NICs be deleted? Do we support that at all? Or maybe only in later releases? How should the terraform data be modeled to "detect" that a disk/NIC has been removed from the instance definition?
  • it should support disk growing
  • what happens when backend/hv parameters are changed? will this trigger an automatic reboot of the instance? should this be configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rbott i will incorporate your suggestion, however i still think i should be less as a start to not over-complicate it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This document needs to be fairly exhaustive to not over-complicate the development of the terraform provider itself :-) If we expect people to contribute, everyone needs to be able to understand planned features/goals/ideas. Otherwise we scare contributors away be rejecting their contributions because they do not meet whatever we might have in mind.

This document can/should also be used to decide whether the provider has reached a stable version 1.0 or if it is still missing features considered a bare minimum requirement.

endpoint = "https://ganeti-cluster.example.com:5080"
username = "admin"
password = "s3cr3t"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line seems to be a compile error - building the documentation fails with the following message:


Warning, treated as error:
/tmp/gntbuild.daxPPrTS/doc/design-terrafor-provider.rst:164:Block quote ends without a blank line; unexpected unindent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants