-
Notifications
You must be signed in to change notification settings - Fork 458
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
Rework/redisign cloudinit iso-generation #465
Comments
How about using https://github.com/kdomanski/iso9660, do you see any immediate downside or roadblock? |
good point. I think i didn't check it but is a good link to look at. thx for re-opining :) |
For debian: apt update && apt install xorriso && update-alternatives --install /usr/bin/mkisofs mkisofs /usr/bin/xorrisofs 10 |
In the mean time https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680949 has been fixed in debian unstable/testing so installing the |
thx |
Hi, Example: https://gist.github.com/kstieger/66399edf56ca967b9ac232e6c438c4cd |
See https://raw.githubusercontent.com/hashicorp/terraform-plugin-sdk/v1-maint/CHANGELOG.md BUG FIXES: * Remove deprecation for `d.Partial` ([dmacvicar#463](hashicorp/terraform-plugin-sdk#463)) * Fix bug when serializing bool in TypeMap ([dmacvicar#465](hashicorp/terraform-plugin-sdk#465)) DEPRECATIONS: * Deprecate `DisableBinaryDriver` ([dmacvicar#450](hashicorp/terraform-plugin-sdk#450)) * Deprecate the `helper/mutexkv`, `helper/pathorcontents`, `httpclient`, and `helper/hashcode` packages ([dmacvicar#453](hashicorp/terraform-plugin-sdk#453)) FEATURES: * Allow disabling binary testing via `TF_DISABLE_BINARY_TESTING` environment variable. ([dmacvicar#441](hashicorp/terraform-plugin-sdk#441)) BUG FIXES: * More accurate results for `schema.ResourceData.HasChange` when dealing with a Set inside another Set. ([dmacvicar#362](hashicorp/terraform-plugin-sdk#362)) DEPRECATED: * helper/encryption: In line with sensitive state best practices, the `helper/encryption` package is deprecated. ([dmacvicar#437](hashicorp/terraform-plugin-sdk#437)) ENHANCEMENTS: * Better error messaging when indexing into TypeSet for test checks, while the binary driver is enabled (currently not supported) ([dmacvicar#417](hashicorp/terraform-plugin-sdk#417)) * Prevent ConflictsWith from self referencing and prevent referencing multi item Lists or Sets ([dmacvicar#416](hashicorp/terraform-plugin-sdk#416)] [[dmacvicar#423](hashicorp/terraform-plugin-sdk#423)] [[dmacvicar#426](hashicorp/terraform-plugin-sdk#426)) FEATURES: * Added validation helper `RequiredWith` ([dmacvicar#342](hashicorp/terraform-plugin-sdk#342)) BUG FIXES: * Binary acceptance test driver: omit test cleanup when state is empty ([dmacvicar#356](hashicorp/terraform-plugin-sdk#356)) * Make mockT.Fatal halt execution ([dmacvicar#396](hashicorp/terraform-plugin-sdk#396)) DEPENDENCIES: * `github.com/hashicorp/terraform-plugin-test@v1.2.0` -> `v1.3.0` [[dmacvicar#400](hashicorp/terraform-plugin-sdk#400)] BUG FIXES: * Binary acceptance test driver: fix cleanup of temporary directories ([dmacvicar#378](hashicorp/terraform-plugin-sdk#378)) DEPRECATED: * helper/schema: `ResourceData.GetOkExists` will not be removed in the next major version unless a suitable replacement or alternative can be prescribed ([dmacvicar#350](hashicorp/terraform-plugin-sdk#350)) FEATURES: * Added support for additional protocol 5.2 fields (`Description`, `DescriptionKind`, `Deprecated`) ([dmacvicar#353](hashicorp/terraform-plugin-sdk#353)) BUG FIXES: * Binary acceptance test driver: auto-configure providers ([dmacvicar#355](hashicorp/terraform-plugin-sdk#355)) FEATURES: * helper/validation: `StringNotInSlice` ([dmacvicar#341](hashicorp/terraform-plugin-sdk#341)) FEATURES: * Binary acceptance test driver ([dmacvicar#262](hashicorp/terraform-plugin-sdk#262)) DEPRECATED: * helper/schema: `ResourceData.Partial` ([dmacvicar#317](hashicorp/terraform-plugin-sdk#317)) * helper/schema: `ResourceData.SetPartial` ([dmacvicar#317](hashicorp/terraform-plugin-sdk#317)) DEPRECATED: * helper/validation: `ValidateListUniqueStrings` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `SingleIP` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `IPRange` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `CIDRNetwork` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `ValidateJsonString` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `ValidateRegexp` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `ValidateRFC3339TimeString` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) FEATURES: * helper/validation: `IntDivisibleBy` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IntNotInSlice` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsIPv6Address` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsIPv4Address` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsCIDR` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsMACAddress` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsPortNumber` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsPortNumberOrZero` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsDayOfTheWeek` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsMonth` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsRFC3339Time` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsURLWithHTTPS` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsURLWithHTTPorHTTPS` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsURLWithScheme` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `ListOfUniqueStrings` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `IsIPAddress` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `IsIPv4Range` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `IsCIDRNetwork` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `StringIsJSON` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `StringIsValidRegExp` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) FEATURES: * helper/validation: `StringIsEmpty` ([dmacvicar#294](hashicorp/terraform-plugin-sdk#294)) * helper/validation: `StringIsNotEmpty` ([dmacvicar#294](hashicorp/terraform-plugin-sdk#294)) * helper/validation: `StringIsWhiteSpace` ([dmacvicar#294](hashicorp/terraform-plugin-sdk#294)) * helper/validation: `StringIsNotWhiteSpace` ([dmacvicar#294](hashicorp/terraform-plugin-sdk#294)) * helper/validation: `IsUUID` ([dmacvicar#294](hashicorp/terraform-plugin-sdk#294)) ([dmacvicar#297](hashicorp/terraform-plugin-sdk#297)) BUG FIXES: * schema/ExactlyOneOf: Fix handling of unknowns in complex types ([dmacvicar#287](hashicorp/terraform-plugin-sdk#287)) BUG FIXES: * helper/resource: Don't crash when dependent test sweeper is missing ([dmacvicar#279](hashicorp/terraform-plugin-sdk#279))
See https://raw.githubusercontent.com/hashicorp/terraform-plugin-sdk/v1-maint/CHANGELOG.md BUG FIXES: * Remove deprecation for `d.Partial` ([dmacvicar#463](hashicorp/terraform-plugin-sdk#463)) * Fix bug when serializing bool in TypeMap ([dmacvicar#465](hashicorp/terraform-plugin-sdk#465)) DEPRECATIONS: * Deprecate `DisableBinaryDriver` ([dmacvicar#450](hashicorp/terraform-plugin-sdk#450)) * Deprecate the `helper/mutexkv`, `helper/pathorcontents`, `httpclient`, and `helper/hashcode` packages ([dmacvicar#453](hashicorp/terraform-plugin-sdk#453)) FEATURES: * Allow disabling binary testing via `TF_DISABLE_BINARY_TESTING` environment variable. ([dmacvicar#441](hashicorp/terraform-plugin-sdk#441)) BUG FIXES: * More accurate results for `schema.ResourceData.HasChange` when dealing with a Set inside another Set. ([dmacvicar#362](hashicorp/terraform-plugin-sdk#362)) DEPRECATED: * helper/encryption: In line with sensitive state best practices, the `helper/encryption` package is deprecated. ([dmacvicar#437](hashicorp/terraform-plugin-sdk#437)) ENHANCEMENTS: * Better error messaging when indexing into TypeSet for test checks, while the binary driver is enabled (currently not supported) ([dmacvicar#417](hashicorp/terraform-plugin-sdk#417)) * Prevent ConflictsWith from self referencing and prevent referencing multi item Lists or Sets ([dmacvicar#416](hashicorp/terraform-plugin-sdk#416)] [[dmacvicar#423](hashicorp/terraform-plugin-sdk#423)] [[dmacvicar#426](hashicorp/terraform-plugin-sdk#426)) FEATURES: * Added validation helper `RequiredWith` ([dmacvicar#342](hashicorp/terraform-plugin-sdk#342)) BUG FIXES: * Binary acceptance test driver: omit test cleanup when state is empty ([dmacvicar#356](hashicorp/terraform-plugin-sdk#356)) * Make mockT.Fatal halt execution ([dmacvicar#396](hashicorp/terraform-plugin-sdk#396)) DEPENDENCIES: * `github.com/hashicorp/terraform-plugin-test@v1.2.0` -> `v1.3.0` [[dmacvicar#400](hashicorp/terraform-plugin-sdk#400)] BUG FIXES: * Binary acceptance test driver: fix cleanup of temporary directories ([dmacvicar#378](hashicorp/terraform-plugin-sdk#378)) DEPRECATED: * helper/schema: `ResourceData.GetOkExists` will not be removed in the next major version unless a suitable replacement or alternative can be prescribed ([dmacvicar#350](hashicorp/terraform-plugin-sdk#350)) FEATURES: * Added support for additional protocol 5.2 fields (`Description`, `DescriptionKind`, `Deprecated`) ([dmacvicar#353](hashicorp/terraform-plugin-sdk#353)) BUG FIXES: * Binary acceptance test driver: auto-configure providers ([dmacvicar#355](hashicorp/terraform-plugin-sdk#355)) FEATURES: * helper/validation: `StringNotInSlice` ([dmacvicar#341](hashicorp/terraform-plugin-sdk#341)) FEATURES: * Binary acceptance test driver ([dmacvicar#262](hashicorp/terraform-plugin-sdk#262)) DEPRECATED: * helper/schema: `ResourceData.Partial` ([dmacvicar#317](hashicorp/terraform-plugin-sdk#317)) * helper/schema: `ResourceData.SetPartial` ([dmacvicar#317](hashicorp/terraform-plugin-sdk#317)) DEPRECATED: * helper/validation: `ValidateListUniqueStrings` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `SingleIP` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `IPRange` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `CIDRNetwork` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `ValidateJsonString` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `ValidateRegexp` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `ValidateRFC3339TimeString` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) FEATURES: * helper/validation: `IntDivisibleBy` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IntNotInSlice` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsIPv6Address` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsIPv4Address` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsCIDR` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsMACAddress` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsPortNumber` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsPortNumberOrZero` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsDayOfTheWeek` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsMonth` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsRFC3339Time` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsURLWithHTTPS` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsURLWithHTTPorHTTPS` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `IsURLWithScheme` ([dmacvicar#296](hashicorp/terraform-plugin-sdk#296)) * helper/validation: `ListOfUniqueStrings` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `IsIPAddress` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `IsIPv4Range` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `IsCIDRNetwork` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `StringIsJSON` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `StringIsValidRegExp` ([dmacvicar#301](hashicorp/terraform-plugin-sdk#301)) * helper/validation: `StringIsEmpty` ([dmacvicar#294](hashicorp/terraform-plugin-sdk#294)) * helper/validation: `StringIsNotEmpty` ([dmacvicar#294](hashicorp/terraform-plugin-sdk#294)) * helper/validation: `StringIsWhiteSpace` ([dmacvicar#294](hashicorp/terraform-plugin-sdk#294)) * helper/validation: `StringIsNotWhiteSpace` ([dmacvicar#294](hashicorp/terraform-plugin-sdk#294)) * helper/validation: `IsUUID` ([dmacvicar#294](hashicorp/terraform-plugin-sdk#294)) ([dmacvicar#297](hashicorp/terraform-plugin-sdk#297)) BUG FIXES: * schema/ExactlyOneOf: Fix handling of unknowns in complex types ([dmacvicar#287](hashicorp/terraform-plugin-sdk#287)) * helper/resource: Don't crash when dependent test sweeper is missing ([dmacvicar#279](hashicorp/terraform-plugin-sdk#279))
Hm, not sure if this is the right place to put this but using As example here is a tiny snippet of a build reaching the 22 minute mark despite it only trying to create a single host:
main.tf terraform {
required_version = ">= 0.13"
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
version = "0.7.1"
}
}
}
# instance the provider
provider "libvirt" {
uri = "qemu:///system"
}
# We fetch the latest ubuntu release image from their mirrors
resource "libvirt_volume" "rocky9" {
name = "rocky9"
source = "https://download.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2"
format = "qcow2"
}
data "template_file" "user_data" {
template = file("${path.module}/cloud_init.cfg")
}
data "template_file" "network_config" {
template = file("${path.module}/network_config.cfg")
}
# for more info about paramater check this out
# https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/website/docs/r/cloudinit.html.markdown
# Use CloudInit to add our ssh-key to the instance
# you can add also meta_data field
resource "libvirt_cloudinit_disk" "commoninit" {
name = "commoninit.iso"
user_data = data.template_file.user_data.rendered
network_config = data.template_file.network_config.rendered
}
# Create the machine
resource "libvirt_domain" "domain-rocky9" {
name = "rocky9-terraform"
memory = "2048"
vcpu = 2
cloudinit = libvirt_cloudinit_disk.commoninit.id
network_interface {
network_name = "default"
wait_for_lease = true
}
cpu {
mode = "host-passthrough"
}
# IMPORTANT: this is a known bug on cloud images, since they expect a console
# we need to pass it
# https://bugs.launchpad.net/cloud-images/+bug/1573095
console {
type = "pty"
target_port = "0"
target_type = "serial"
}
console {
type = "pty"
target_type = "virtio"
target_port = "1"
}
disk {
volume_id = libvirt_volume.rocky9.id
}
graphics {
type = "vnc"
autoport = true
}
} |
Ah okay, terraform 1.5.0 is broken, terraform 1.4.6 is totally fine. This isnt an issue for here I'll open one directly. |
Related to #1018 |
So this is issue is for improving the
cloudinit
design.We find out currently that requiring
mkisofs
is not universal enough in different os ( some version of SLES/ and some debian lack on this pkg).Using also
geniso
was the same issue.This issue is more about thinking on how we could redisign the iso generation part in more scalable/universal way.
I was thinking to use
usb
disk anddd
. I think this could be possible and more universal.But maybe other ways are possible
The text was updated successfully, but these errors were encountered: