Page MenuHomeSoftware Heritage

terraform/staging: Align proxmox and staging declaration
ClosedPublic

Authored by ardumont on Sep 28 2020, 7:41 PM.

Details

Summary

New options are available in the proxmox provider plugin so:

  • Add vmid as defined in proxmox today (so it won't try and generate one for some reason)
  • Open multiple configuration variables needed: bridge, balloon, numa, ...
  • Avoid default values fallback. So some properties are not set for all nodes (e.g. hypervisor, bridge, etc...). They must be declared explicitely for each node instead.
  • Had to inline the "module node" call [1] for the storage0 node (2 disks to declare). It's now inlined like the gateway (declares 2 networks). So it's a bit repetitive but it's declared appropriately.
  • Separate staging nodes (from production) to its own arborescence. So we don't touch the production nodes when applying
  • As a poor man configuration shared management, added the staging terraform.tfstate within the staging arborescence... (no sensible information in there plus now we can share that state)
  • Ignore the target_node/hypervisor change (as required in the diff)

Now the` terraform plan` for staging looks reasonable.

I modified some production nodes according to their current configuration but
stopped as it's a subject for another time. (Shout out if i need to remove
those but this sounds like lost time to do so, might as well keep it since it's
done)

[1] The module node only allows 1 disk and 1 network declaration. At the time
of its design, determining how to do conditional/loop were not found.

Test Plan

terraform plan with 'terraform.tfstate' file (P804)

$ terraform plan -no-color
...

P805 for the output (too big for here)

Diff Detail

Repository
rSPRE sysadm-provisioning
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Realign current full staging with current proxmox state
I'll add the current state i have in a paste

ardumont retitled this revision from terraform/staging: Redistribute memory usage according to current setup to terraform/staging: Align proxmox and staging declaration.Oct 5 2020, 3:43 PM
ardumont edited the summary of this revision. (Show Details)
ardumont edited the test plan for this revision. (Show Details)
ardumont edited the test plan for this revision. (Show Details)

Fix storage0's gateway access in ipconfig0

ardumont edited the test plan for this revision. (Show Details)
ardumont edited the summary of this revision. (Show Details)

Do not fallback to default values for hypervisor, bridge...
As it's used both for production vm and staging ones

ardumont edited the test plan for this revision. (Show Details)
proxmox/terraform/.gitignore
1

store the terraform.tfstate.* files in there...

Possibly moving staging.tf to its own arborescence tree so we can tentatively try an apply on the staging nodes without modifying the other production nodes.

  • terraform/staging: Separate staging state from production

(- share the terraform.tfstate within the repository)

The plan looks appliable now!

  • Do not integrate the temporary file terraform-plan (it's for the paste)
  • Do not ignore disk and network declaration

Can we ignore the hypervisor the same way we're ignoring bootdisk changes? This would remove a set of "noise" changes from the diff. (And it's also stuff that's really not meant to be static)

Can we ignore the hypervisor the same way we're ignoring bootdisk changes?

Hopefully, we can, in the lifecycle > changes instruction blocks i guess.
I'll check.

This would remove a set of "noise" changes from the diff.

indeed.

(And it's also stuff that's really not meant to be static)

Yes, although that makes sense to declare it in the first place for the provisioning step i guess.
So proxmox knows where it should build the node.

  • Ignore target_node ("hypervisor" in the swh "module/node") to be less noisy
  • Fix a vmbr443 bridge typo
vsellier added a subscriber: vsellier.

lgtm, with this, we will be able to update the staging environment without impacting the rest of the infra

This revision is now accepted and ready to land.Oct 7 2020, 2:02 PM