File tree 3 files changed +534
-114
lines changed
3 files changed +534
-114
lines changed Original file line number Diff line number Diff line change @@ -72,13 +72,35 @@ resource "incus_instance" "instance2" {
72
72
}
73
73
```
74
74
75
+ ## Example to create a new instance from an existing instance
76
+
77
+ ``` hcl
78
+ resource "incus_instance" "instance1" {
79
+ project = "default"
80
+ name = "instance1"
81
+ image = "images:debian/12"
82
+ }
83
+
84
+ resource "incus_instance" "instance2" {
85
+ project = "default"
86
+ name = "instance2"
87
+
88
+ source_instance = {
89
+ project = "default"
90
+ name = "instance1"
91
+ }
92
+ }
93
+ ```
94
+
75
95
## Argument Reference
76
96
77
97
* ` name ` - ** Required** - Name of the instance.
78
98
79
- * ` image ` - ** Required * * - Base image from which the instance will be created. Must
99
+ * ` image ` - * Optional * - Base image from which the instance will be created. Must
80
100
specify [ an image accessible from the provider remote] ( https://linuxcontainers.org/incus/docs/main/reference/remote_image_servers/ ) .
81
101
102
+ * ` source_instance ` - * Optional* - The source instance from which the instance will be created. See reference below.
103
+
82
104
* ` description ` - * Optional* - Description of the instance.
83
105
84
106
* ` type ` - * Optional* - Instance type. Can be ` container ` , or ` virtual-machine ` . Defaults to ` container ` .
@@ -111,6 +133,14 @@ resource "incus_instance" "instance2" {
111
133
112
134
* ` target ` - * Optional* - Specify a target node in a cluster.
113
135
136
+ The ` source_instance ` block supports:
137
+
138
+ * ` project ` - ** Required** - Name of the project in which the source instance exists.
139
+
140
+ * ` name ` - ** Required** - Name of the source instance.
141
+
142
+ * ` snapshot ` - * Optiona** - Name of the snapshot of the source instance
143
+
114
144
The ` device ` block supports:
115
145
116
146
* ` name ` - ** Required** - Name of the device.
You can’t perform that action at this time.
0 commit comments