File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 3
3
- Since demo does not try to import existing resources:
4
4
- Remove VM ` testtf-demo ` , if it exists.
5
5
- Remove virtual disk ` jammy-server-cloudimg-amd64.img ` , if it exists.
6
+ - Remove ISO ` alpine-virt-3.21.3-x86_64.iso ` , if it exists
6
7
7
8
Follow [ top level README.md] ( ../README.md ) to install terraform and golang.
8
9
Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ resource "hypercore_disk" "os" {
31
31
source_virtual_disk_id = hypercore_virtual_disk. ubuntu_2204 . id
32
32
}
33
33
34
+ resource "hypercore_disk" "iso" {
35
+ vm_uuid = hypercore_vm. demo_vm . id
36
+ type = " IDE_CDROM"
37
+ iso_uuid = hypercore_iso. alpine_virt . id
38
+ }
39
+
34
40
resource "hypercore_nic" "vlan_all" {
35
41
vm_uuid = hypercore_vm. demo_vm . id
36
42
type = " VIRTIO"
@@ -47,6 +53,7 @@ resource "hypercore_vm_power_state" "demo_vm" {
47
53
state = " RUNNING" # available states are: SHUTOFF, RUNNING, PAUSED
48
54
depends_on = [
49
55
hypercore_disk . os ,
56
+ hypercore_disk . iso ,
50
57
hypercore_nic . vlan_all ,
51
58
hypercore_vm_boot_order . demo_vm_boot_order ,
52
59
]
@@ -56,11 +63,13 @@ resource "hypercore_vm_boot_order" "demo_vm_boot_order" {
56
63
vm_uuid = hypercore_vm. demo_vm . id
57
64
boot_devices = [
58
65
hypercore_disk . os . id ,
66
+ hypercore_disk . iso . id ,
59
67
hypercore_nic . vlan_all . id ,
60
68
]
61
69
62
70
depends_on = [
63
71
hypercore_disk . os ,
72
+ hypercore_disk . iso ,
64
73
hypercore_nic . vlan_all ,
65
74
]
66
75
}
Original file line number Diff line number Diff line change
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
4
+ resource "hypercore_iso" "alpine_virt" {
5
+ name = " alpine-virt-3.21.3-x86_64.iso"
6
+ source_url = " https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/x86_64/alpine-virt-3.21.3-x86_64.iso"
7
+ }
8
+
9
+ output "alpine_iso" {
10
+ value = hypercore_iso. alpine_virt
11
+ }
You can’t perform that action at this time.
0 commit comments