Skip to content

Commit

Permalink
some minimal changes
Browse files Browse the repository at this point in the history
  • Loading branch information
parsaloi committed Jan 9, 2025
1 parent 5a36643 commit 4e17b9c
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 24 deletions.
16 changes: 8 additions & 8 deletions provision-vm/kvm/using-terraform/src/storage.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
resource "libvirt_pool" "sysimg" {
name = "sysimg"
type = "dir"
target {
path = "/var/lib/libvirt/images/more"
resource "libvirt_pool" "vmdisks" {
name = "vmdisks"
type = "dir"
target {
path = "/vmdisks"
}
}
}

resource "libvirt_volume" "arch_iso" {
name = "archlinux-2024.08.01-x86_64.iso"
pool = libvirt_pool.sysimg.name
pool = libvirt_pool.vmdisks.name
source = "/var/lib/libvirt/images/archlinux-2024.08.01-x86_64.iso"
}

resource "libvirt_volume" "node0_disk" {
name = "${var.domain_name}.qcow2"
pool = libvirt_pool.sysimg.name
pool = libvirt_pool.vmdisks.name
size = var.disk_size * 1024 * 1024 * 1024
format = "qcow2"
}
2 changes: 1 addition & 1 deletion provision-vm/kvm/using-terraform/src/terraform.tfstate
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 4,
"terraform_version": "1.10.2",
"serial": 56,
"serial": 85,
"lineage": "c6da0a51-4628-6462-35ee-3e2611ac5d35",
"outputs": {},
"resources": [],
Expand Down
146 changes: 131 additions & 15 deletions provision-vm/kvm/using-terraform/src/terraform.tfstate.backup
Original file line number Diff line number Diff line change
@@ -1,10 +1,126 @@
{
"version": 4,
"terraform_version": "1.10.2",
"serial": 51,
"serial": 79,
"lineage": "c6da0a51-4628-6462-35ee-3e2611ac5d35",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "libvirt_domain",
"name": "node0",
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
"instances": [
{
"status": "tainted",
"schema_version": 0,
"attributes": {
"arch": null,
"autostart": null,
"boot_device": [
{
"dev": [
"cdrom",
"hd"
]
}
],
"cloudinit": null,
"cmdline": null,
"console": [],
"coreos_ignition": null,
"cpu": [
{
"mode": "host-passthrough"
}
],
"description": null,
"disk": [
{
"block_device": "",
"file": "",
"scsi": false,
"url": "",
"volume_id": "/vmdisks/node0.qcow2",
"wwn": ""
},
{
"block_device": "",
"file": "",
"scsi": false,
"url": "",
"volume_id": "/vmdisks/archlinux-2024.08.01-x86_64.iso",
"wwn": ""
}
],
"emulator": null,
"filesystem": [],
"firmware": "/usr/share/edk2/x64/OVMF_CODE.4m.fd",
"fw_cfg_name": "opt/com.coreos/config",
"graphics": [
{
"autoport": true,
"listen_address": "0.0.0.0",
"listen_type": "address",
"type": "vnc",
"websocket": 0
}
],
"id": "ce2c26b8-2243-4830-8539-83a43622db28",
"initrd": null,
"kernel": null,
"machine": "q35",
"memory": 1024,
"metadata": null,
"name": "node0",
"network_interface": [
{
"addresses": [],
"bridge": "",
"hostname": "",
"mac": "",
"macvtap": "",
"network_id": "e929708e-fe21-4386-9939-70f8c3a2eaa3",
"network_name": "",
"passthrough": "",
"vepa": "",
"wait_for_lease": true
}
],
"nvram": [
{
"file": "/var/lib/libvirt/qemu/nvram/node0_VARS.fd",
"template": "/usr/share/edk2/x64/OVMF_VARS.4m.fd"
}
],
"qemu_agent": false,
"running": true,
"timeouts": null,
"tpm": [],
"type": "kvm",
"vcpu": 1,
"video": [
{
"type": "virtio"
}
],
"xml": [
{
"xslt": "\u003c?xml version=\"1.0\" ?\u003e\n\u003cxsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\u003e\n \u003cxsl:template match=\"/domain/os\"\u003e\n \u003cxsl:copy\u003e\n \u003cxsl:apply-templates select=\"@*|node()\"/\u003e\n \u003cloader readonly=\"yes\" type=\"pflash\"\u003e/usr/share/ovmf/x64/OVMF_CODE.fd\u003c/loader\u003e\n \u003cnvram\u003e/var/lib/libvirt/qemu/nvram/node0_VARS.fd\u003c/nvram\u003e\n \u003c/xsl:copy\u003e\n \u003c/xsl:template\u003e\n \u003cxsl:template match=\"@*|node()\"\u003e\n \u003cxsl:copy\u003e\n \u003cxsl:apply-templates select=\"@*|node()\"/\u003e\n \u003c/xsl:copy\u003e\n \u003c/xsl:template\u003e\n\u003c/xsl:stylesheet\u003e\n"
}
]
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDB9fQ==",
"dependencies": [
"libvirt_network.devsecops2",
"libvirt_pool.vmdisks",
"libvirt_volume.arch_iso",
"libvirt_volume.node0_disk"
]
}
]
},
{
"mode": "managed",
"type": "libvirt_network",
Expand Down Expand Up @@ -36,7 +152,7 @@
],
"dnsmasq_options": [],
"domain": "devsecops2.local",
"id": "702e92b3-68f4-433e-90c3-13657fd0e788",
"id": "e929708e-fe21-4386-9939-70f8c3a2eaa3",
"mode": "nat",
"mtu": null,
"name": "devsecops2",
Expand All @@ -51,22 +167,22 @@
{
"mode": "managed",
"type": "libvirt_pool",
"name": "sysimg",
"name": "vmdisks",
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"allocation": 147680301056,
"available": 102165659648,
"allocation": 149280890880,
"available": 100565069824,
"capacity": 249845960704,
"id": "f79aa16e-dd0f-466c-98f4-b1baded98281",
"name": "sysimg",
"id": "7e9a7e33-7005-4a2f-8c9d-bc11d80f35e1",
"name": "vmdisks",
"path": null,
"source": [],
"target": [
{
"path": "/var/lib/libvirt/images/more"
"path": "/vmdisks"
}
],
"type": "dir",
Expand All @@ -90,17 +206,17 @@
"base_volume_name": null,
"base_volume_pool": null,
"format": "iso",
"id": "/var/lib/libvirt/images/more/archlinux-2024.08.01-x86_64.iso",
"id": "/vmdisks/archlinux-2024.08.01-x86_64.iso",
"name": "archlinux-2024.08.01-x86_64.iso",
"pool": "sysimg",
"pool": "vmdisks",
"size": 1182826496,
"source": "/var/lib/libvirt/images/archlinux-2024.08.01-x86_64.iso",
"xml": []
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"libvirt_pool.sysimg"
"libvirt_pool.vmdisks"
]
}
]
Expand All @@ -118,17 +234,17 @@
"base_volume_name": null,
"base_volume_pool": null,
"format": "qcow2",
"id": "/var/lib/libvirt/images/more/node1.qcow2",
"name": "node1.qcow2",
"pool": "sysimg",
"id": "/vmdisks/node0.qcow2",
"name": "node0.qcow2",
"pool": "vmdisks",
"size": 32212254720,
"source": null,
"xml": []
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"libvirt_pool.sysimg"
"libvirt_pool.vmdisks"
]
}
]
Expand Down
Binary file modified provision-vm/kvm/using-terraform/src/tfplan
Binary file not shown.

0 comments on commit 4e17b9c

Please sign in to comment.