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

Upgrade libvirt provider to v0.8.1 #1723

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

Conversation

NamelessOne91
Copy link
Contributor

@NamelessOne91 NamelessOne91 commented Oct 3, 2024

What does this PR change?

Related to https://github.com/SUSE/spacewalk/issues/25018

Update the libvirt provider to v0.8.1 - the last available version at the time of writing.

Unfortunately, the new version changes cpu definition for libvirt_domain resources from an attribute to a block and breaks backward compatibility with our libvirt module.

Pre-requisites

When this PR is merged, we need to:

  • Send email to the mailing list
  • Adapt CI terraform files to cope with the change:
  • Clean CI environment to cope with the changes
  • Remove package from all our CI worker machines.
  • Update the terraform-provider-libvirt/terraform together with that in the OBS if necessary/wanted

How to upgrade

  • Un-install the provider's package zypper rm terraform-provider-libvirt
  • In you main.tf, change the provider version to 0.8.1
  • If you want to keep the same state file, see keeping state file. Otherwise just clan the environment and remove the terraform.tfstate, .terraform.lock.hcl and .terraform
  • Run terraform init

Keeping state file

  • Open theterraform.tfstate
  • Search for all cpu keys. The value should now be an array of objects. To change it just surround the existing content with square brackets ([ {....} ] )
  • Run terraform init -upgrade

@NamelessOne91 NamelessOne91 self-assigned this Oct 3, 2024
@rjmateus
Copy link
Member

rjmateus commented Oct 3, 2024

Can you have a look at the description of this PR [1] since it can give you some tips about what needs to be checked and changed in our CI.
[1] #1023

@NamelessOne91
Copy link
Contributor Author

NamelessOne91 commented Oct 3, 2024

Can you have a look at the description of this PR [1] since it can give you some tips about what needs to be checked and changed in our CI. [1] #1023

Thanks for the heads up, Ricardo.

Currently this PR is just a placeholder for future work.
Right now we'd like to verify that we can build the terraform-provider-libvirt package for the new version in OBS and do a testsuite run on one of the hypervisors with it.

ATM, I was able to build it an OBS branch under my namespace https://build.opensuse.org/package/show/home:pinvernizzi:branches:systemsmanagement:sumaform/terraform-provider-libvirt and I'm trying it out locally (I'm on Tumbleweed).

@rjmateus
Copy link
Member

rjmateus commented Oct 3, 2024

In my opinion we should stop building it ourselves and just use the upstream libvirt terrform provider. It would simplify our life, and we can path it if needed.

@NamelessOne91
Copy link
Contributor Author

NamelessOne91 commented Oct 4, 2024

In my opinion we should stop building it ourselves and just use the upstream libvirt terraform provider. It would simplify our life, and we can path it if needed.

If you can find a spare moment to do so, let's discuss this with @Bischoff next week.
Building the packages ourselves can help guarantee some security standards and enables applying patches ASAP instead of waiting for upstream's release cycles.

@rjmateus
Copy link
Member

rjmateus commented Oct 4, 2024

I the last 5 years I have never seen the need to release a patch for libvirt ourselves. But if needed we can make it using the infra from hashicorp providers [1] [2].
Regarding the security check, we can check the changes in the upstream project. But sure, is not following the common criteria standards. Building it internally increases security for sure, but is it needed?

If we want we can discuss it during next week. Cheers

[1] https://registry.terraform.io/providers/uyuni-project/libvirt/latest
[2] https://github.com/uyuni-project/terraform-provider-libvirt

@NamelessOne91 NamelessOne91 force-pushed the libvirt_provider_v0.8.0 branch from 55dd003 to 9b5a125 Compare November 14, 2024 10:00
@NamelessOne91 NamelessOne91 changed the title Upgrade libvirt provider to v0.8.0 Upgrade libvirt provider to v0.8.1 Nov 14, 2024
@NamelessOne91 NamelessOne91 force-pushed the libvirt_provider_v0.8.0 branch from 9b5a125 to ebb55ec Compare November 19, 2024 08:45
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.

2 participants