File tree Expand file tree Collapse file tree 3 files changed +534
-114
lines changed Expand file tree Collapse file tree 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" {
7272}
7373```
7474
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+
7595## Argument Reference
7696
7797* ` name ` - ** Required** - Name of the instance.
7898
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
80100 specify [ an image accessible from the provider remote] ( https://linuxcontainers.org/incus/docs/main/reference/remote_image_servers/ ) .
81101
102+ * ` source_instance ` - * Optional* - The source instance from which the instance will be created. See reference below.
103+
82104* ` description ` - * Optional* - Description of the instance.
83105
84106* ` type ` - * Optional* - Instance type. Can be ` container ` , or ` virtual-machine ` . Defaults to ` container ` .
@@ -111,6 +133,14 @@ resource "incus_instance" "instance2" {
111133
112134* ` target ` - * Optional* - Specify a target node in a cluster.
113135
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+
114144The ` device ` block supports:
115145
116146* ` name ` - ** Required** - Name of the device.
You can’t perform that action at this time.
0 commit comments