You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/resources/instance_server.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -143,7 +143,7 @@ to find either the right `label` or the right local image `ID` for a given `type
143
143
-`placement_group_id` - (Optional) The [placement group](https://developers.scaleway.com/en/products/instance/api/#placement-groups-d8f653) the server is attached to.
144
144
145
145
146
-
~> **Important:**Updates to`placement_group_id`may trigger a stop/start of the server.
146
+
~> **Important:**When updating`placement_group_id`the `state` must be set to `stopped`, otherwise it will fail.
147
147
148
148
-`root_volume` - (Optional) Root [volume](https://developers.scaleway.com/en/products/instance/api/#volumes-7e8a39) attached to the server on creation.
149
149
-`size_in_gb` - (Required) Size of the root volume in gigabytes.
@@ -152,12 +152,14 @@ to find either the right `label` or the right local image `ID` for a given `type
152
152
Updates to this field will recreate a new resource.
153
153
-`delete_on_termination` - (Defaults to `true`) Forces deletion of the root volume on instance termination.
154
154
155
-
~> **Important:** Updates to `root_volume.size_in_gb` will trigger a stop/start of the server.
155
+
~> **Important:** Updates to `root_volume.size_in_gb` will be ignored after the creation of the server.
156
156
157
157
-`additional_volume_ids` - (Optional) The [additional volumes](https://developers.scaleway.com/en/products/instance/api/#volumes-7e8a39)
158
158
attached to the server. Updates to this field will trigger a stop/start of the server.
159
159
160
-
~> **Important:** If this field contains local volumes, updates will trigger a stop/start of the server.
160
+
~> **Important:** If this field contains local volumes, the `state` must be set to `stopped`, otherwise it will fail.
161
+
162
+
~> **Important:** If this field contains local volumes, you have to first detach them, in one apply, and then delete the volume in another apply.
161
163
162
164
-`enable_ipv6` - (Defaults to `false`) Determines if IPv6 is enabled for the server.
@@ -534,24 +530,36 @@ func resourceScalewayInstanceServerUpdate(ctx context.Context, d *schema.Resourc
534
530
volumes["0"] =&instance.VolumeTemplate{ID: expandZonedID(d.Get("root_volume.0.volume_id")).ID, Name: newRandomName("vol")} // name is ignored by the API, any name will work here
535
531
536
532
fori, volumeID:=rangeraw.([]interface{}) {
537
-
// TODO: this will be refactored soon, before next release
538
-
// in the meantime it will throw an error if the volume is already attached somewhere
533
+
// local volumes can only be added when the instance is stopped
0 commit comments