q35 chipset by default
This commit is contained in:
@@ -3,6 +3,17 @@ resource "libvirt_domain" "domain" {
|
||||
name = "${var.vm_name}-${count.index}"
|
||||
memory = var.memory
|
||||
vcpu = var.vcpu
|
||||
machine = "q35"
|
||||
|
||||
# The chipset q35, which does not support the IDE bus, does not work with the terraform-provider-libvirt cloud-init implementation,
|
||||
# which creates an ISO attached to an IDE bus by default. Workaround is implemented
|
||||
# https://github.com/dmacvicar/terraform-provider-libvirt/issues/1137#issuecomment-2592329846
|
||||
# A cleaner solution might be the following :
|
||||
# https://github.com/dmacvicar/terraform-provider-libvirt/pull/895#issuecomment-1911167872
|
||||
|
||||
xml {
|
||||
xslt = file("${path.module}/q35-workaround.xslt")
|
||||
}
|
||||
|
||||
# Only include cloudinit if enabled
|
||||
cloudinit = var.enable_cloudinit ? libvirt_cloudinit_disk.commoninit[count.index].id : null
|
||||
|
16
multiple/shared_modules/q35-workaround.xslt
Normal file
16
multiple/shared_modules/q35-workaround.xslt
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" ?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output omit-xml-declaration="yes" indent="yes"/>
|
||||
<xsl:template match="node()|@*">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="node()|@*"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
<xsl:template match="/domain/devices/disk[@device='cdrom']/target/@bus">
|
||||
<xsl:attribute name="bus">
|
||||
<xsl:value-of select="'sata'"/>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="/domain/devices/disk[@device='cdrom']/alias" />
|
||||
</xsl:stylesheet>
|
Reference in New Issue
Block a user