Skip to content

Commit a2a10c3

Browse files
committed
Update docs
Regenerate documentation
1 parent bb99905 commit a2a10c3

File tree

7 files changed

+223
-4
lines changed

7 files changed

+223
-4
lines changed

docs/data-sources/vm.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Read-Only:
5252
- `disks` (Attributes List) List of disks (see [below for nested schema](#nestedatt--vms--disks))
5353
- `name` (String)
5454
- `power_state` (String)
55+
- `snapshot_schedule_uuid` (String) UUID of the applied snapshot schedule for creating automated snapshots
5556
- `uuid` (String)
5657

5758
<a id="nestedatt--vms--affinity_strategy"></a>

docs/resources/vm.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ resource "hypercore_vm" "myvm" {
2828
name = local.vm_name
2929
description = "some description"
3030
31-
vcpu = 4
32-
memory = 4096 # MiB
31+
vcpu = 4
32+
memory = 4096 # MiB
33+
snapshot_schedule_uuid = data.hypercore_vm.clone_source_vm.vms.0.snapshot_schedule_uuid
3334
3435
clone = {
3536
source_vm_uuid = data.hypercore_vm.clone_source_vm.vms.0.uuid
@@ -63,6 +64,7 @@ output "vm_uuid" {
6364
- `description` (String) Description of this VM
6465
- `group` (String) Group/tag to create this VM in
6566
- `memory` (Number) Memory (RAM) size in `MiB`: If the cloned VM was already created <br>and it's memory was modified, the cloned VM will be rebooted (either gracefully or forcefully)
67+
- `snapshot_schedule_uuid` (String) UUID of the snapshot schedule to create automatic snapshots
6668
- `vcpu` (Number) Number of CPUs on this VM. If the cloned VM was already created and it's <br>`VCPU` was modified, the cloned VM will be rebooted (either gracefully or forcefully)
6769

6870
### Read-Only

docs/resources/vm_snapshot.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "hypercore_vm_snapshot Resource - hypercore"
4+
subcategory: ""
5+
description: |-
6+
Hypercore VM snapshot resource to manage VM snapshots
7+
---
8+
9+
# hypercore_vm_snapshot (Resource)
10+
11+
Hypercore VM snapshot resource to manage VM snapshots
12+
13+
## Example Usage
14+
15+
```terraform
16+
locals {
17+
vm_name = "example-vm-one"
18+
another_vm_name = "example-vm-two"
19+
}
20+
21+
data "hypercore_vm" "example-vm-one" {
22+
name = local.vm_name
23+
}
24+
25+
data "hypercore_vm" "example-vm-two" {
26+
name = local.another_vm_name
27+
}
28+
29+
resource "hypercore_vm_snapshot" "snapshot" {
30+
vm_uuid = data.hypercore_vm.example-vm-one.vms.0.uuid
31+
label = "my-snapshot"
32+
}
33+
34+
resource "hypercore_vm_snapshot" "imported-snapshot" {
35+
vm_uuid = data.hypercore_vm.example-vm-two.vms.0.uuid
36+
}
37+
38+
import {
39+
to = hypercore_vm_snapshot.imported-snapshot
40+
id = "24ab2255-ca77-49ec-bc96-f469cec3affb"
41+
}
42+
```
43+
44+
<!-- schema generated by tfplugindocs -->
45+
## Schema
46+
47+
### Required
48+
49+
- `vm_uuid` (String) VM UUID of which we want to create a snapshot.
50+
51+
### Optional
52+
53+
- `label` (String) Snapshot label.
54+
55+
### Read-Only
56+
57+
- `id` (String) VM snapshot identifier
58+
- `type` (String) Snapshot type. Can be: USER, AUTOMATED, SUPPORT
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "hypercore_vm_snapshot_schedule Resource - hypercore"
4+
subcategory: ""
5+
description: |-
6+
Hypercore VM snapshot schedule resource to manage VM snapshots
7+
---
8+
9+
# hypercore_vm_snapshot_schedule (Resource)
10+
11+
Hypercore VM snapshot schedule resource to manage VM snapshots
12+
13+
## Example Usage
14+
15+
```terraform
16+
locals {
17+
vm_name = "example-vm-one"
18+
another_vm_name = "example-vm-two"
19+
}
20+
21+
data "hypercore_vm" "example-vm-one" {
22+
name = local.vm_name
23+
}
24+
25+
data "hypercore_vm" "example-vm-two" {
26+
name = local.another_vm_name
27+
}
28+
29+
resource "hypercore_vm_snapshot_schedule" "example-schedule" {
30+
name = "my-schedule"
31+
rules = [
32+
{
33+
name = "first-example-rule",
34+
start_timestamp = "2023-02-01 00:00:00",
35+
frequency = "FREQ=MINUTELY;INTERVAL=1",
36+
local_retention_seconds = 300
37+
},
38+
{
39+
name = "second-example-rule",
40+
start_timestamp = "2023-02-01 00:00:00",
41+
frequency = "FREQ=MINUTELY;INTERVAL=1",
42+
local_retention_seconds = 300
43+
}
44+
]
45+
}
46+
47+
resource "hypercore_vm_snapshot_schedule" "example-schedule-no-rules" {
48+
name = "my-schedule-without-rules"
49+
}
50+
51+
resource "hypercore_vm_snapshot_schedule" "example-schedule-imported" {
52+
name = "my-imported-schedule"
53+
}
54+
55+
import {
56+
to = hypercore_vm_snapshot_schedule.example-schedule-imported
57+
id = "69b21f14-6bb6-4dd5-a6bc-6dec9bd59c96"
58+
}
59+
```
60+
61+
<!-- schema generated by tfplugindocs -->
62+
## Schema
63+
64+
### Required
65+
66+
- `name` (String) Snapshot schedule name.
67+
68+
### Optional
69+
70+
- `rules` (Attributes List) Scheduled snapshot rules. (see [below for nested schema](#nestedatt--rules))
71+
72+
### Read-Only
73+
74+
- `id` (String) Snapshot schedule identifier
75+
76+
<a id="nestedatt--rules"></a>
77+
### Nested Schema for `rules`
78+
79+
Required:
80+
81+
- `frequency` (String) Frequency based on RFC-2445 (FREQ=MINUTELY;INTERVAL=5)
82+
- `local_retention_seconds` (Number) Number of seconds before snapshots are removed
83+
- `name` (String) Rule name
84+
- `start_timestamp` (String) Local timezone timestamp (2010-01-01 00:00:00) of when a snapshot is to be taken
85+
86+
Optional:
87+
88+
- `remote_retention_seconds` (Number) Number of seconds before snapshots are removed. If not set, it'll be the same as `local_retention_seconds`

examples/resources/hypercore_vm/resource.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ resource "hypercore_vm" "myvm" {
1313
name = local.vm_name
1414
description = "some description"
1515

16-
vcpu = 4
17-
memory = 4096 # MiB
16+
vcpu = 4
17+
memory = 4096 # MiB
18+
snapshot_schedule_uuid = data.hypercore_vm.clone_source_vm.vms.0.snapshot_schedule_uuid
1819

1920
clone = {
2021
source_vm_uuid = data.hypercore_vm.clone_source_vm.vms.0.uuid
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
locals {
2+
vm_name = "example-vm-one"
3+
another_vm_name = "example-vm-two"
4+
}
5+
6+
data "hypercore_vm" "example-vm-one" {
7+
name = local.vm_name
8+
}
9+
10+
data "hypercore_vm" "example-vm-two" {
11+
name = local.another_vm_name
12+
}
13+
14+
resource "hypercore_vm_snapshot" "snapshot" {
15+
vm_uuid = data.hypercore_vm.example-vm-one.vms.0.uuid
16+
label = "my-snapshot"
17+
}
18+
19+
resource "hypercore_vm_snapshot" "imported-snapshot" {
20+
vm_uuid = data.hypercore_vm.example-vm-two.vms.0.uuid
21+
}
22+
23+
import {
24+
to = hypercore_vm_snapshot.imported-snapshot
25+
id = "24ab2255-ca77-49ec-bc96-f469cec3affb"
26+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
locals {
2+
vm_name = "example-vm-one"
3+
another_vm_name = "example-vm-two"
4+
}
5+
6+
data "hypercore_vm" "example-vm-one" {
7+
name = local.vm_name
8+
}
9+
10+
data "hypercore_vm" "example-vm-two" {
11+
name = local.another_vm_name
12+
}
13+
14+
resource "hypercore_vm_snapshot_schedule" "example-schedule" {
15+
name = "my-schedule"
16+
rules = [
17+
{
18+
name = "first-example-rule",
19+
start_timestamp = "2023-02-01 00:00:00",
20+
frequency = "FREQ=MINUTELY;INTERVAL=1",
21+
local_retention_seconds = 300
22+
},
23+
{
24+
name = "second-example-rule",
25+
start_timestamp = "2023-02-01 00:00:00",
26+
frequency = "FREQ=MINUTELY;INTERVAL=1",
27+
local_retention_seconds = 300
28+
}
29+
]
30+
}
31+
32+
resource "hypercore_vm_snapshot_schedule" "example-schedule-no-rules" {
33+
name = "my-schedule-without-rules"
34+
}
35+
36+
resource "hypercore_vm_snapshot_schedule" "example-schedule-imported" {
37+
name = "my-imported-schedule"
38+
}
39+
40+
import {
41+
to = hypercore_vm_snapshot_schedule.example-schedule-imported
42+
id = "69b21f14-6bb6-4dd5-a6bc-6dec9bd59c96"
43+
}

0 commit comments

Comments
 (0)