Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions examples/v0.13/launch_security/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Configure the provider
provider "libvirt" {
uri = "qemu:///system"
}

# SEV example
resource "libvirt_domain" "sev_example" {
name = "sev-example"
memory = 2048
vcpu = 2

launch_security {
type = "sev"
cbitpos = 47
reduced_phys_bits = 1
policy = 3
}
}

# SEV-SNP example
resource "libvirt_domain" "sev_snp_example" {
name = "sev-snp-example"
memory = 2048
vcpu = 2

launch_security {
type = "sev-snp"
cbitpos = 51
reduced_phys_bits = 1
policy = 7
kernel_hashes = "enabled"
}
}

# S390-PV example
resource "libvirt_domain" "s390_pv_example" {
name = "s390-pv-example"
memory = 2048
vcpu = 2

launch_security {
type = "s390-pv"
}
}
35 changes: 35 additions & 0 deletions examples/v0.13/memory_backing/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Configure the provider
provider "libvirt" {
uri = "qemu:///system"
}

# Simple memfd example
resource "libvirt_domain" "memfd_example" {
name = "memfd-example"
memory = 2048
vcpu = 2

memory_backing {
source_type = "memfd"
}
}

# Complex memory backing example
resource "libvirt_domain" "memory_backing_example" {
name = "memory-backing-example"
memory = 4096
vcpu = 4

memory_backing {
source_type = "memfd"
access_mode = "shared"
allocation_mode = "immediate"
discard = true
locked = true

hugepages {
size = 2048
nodeset = "0-1"
}
}
}
Loading