@@ -38,7 +38,7 @@ func TestAccServer_Minimal1(t *testing.T) {
3838 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "image" , "ubuntu_focal" ),
3939 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "type" , "DEV1-S" ),
4040 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "root_volume.0.delete_on_termination" , "true" ),
41- resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "root_volume.0.size_in_gb" , "20 " ),
41+ resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "root_volume.0.size_in_gb" , "10 " ),
4242 resource .TestCheckResourceAttrSet ("scaleway_instance_server.base" , "root_volume.0.volume_id" ),
4343 serverHasNewVolume (tt , "scaleway_instance_server.base" ),
4444 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "enable_dynamic_ip" , "false" ),
@@ -61,7 +61,7 @@ func TestAccServer_Minimal1(t *testing.T) {
6161 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "image" , "ubuntu_focal" ),
6262 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "type" , "DEV1-S" ),
6363 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "root_volume.0.delete_on_termination" , "true" ),
64- resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "root_volume.0.size_in_gb" , "20 " ),
64+ resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "root_volume.0.size_in_gb" , "10 " ),
6565 resource .TestCheckResourceAttrSet ("scaleway_instance_server.base" , "root_volume.0.volume_id" ),
6666 serverHasNewVolume (tt , "scaleway_instance_server.base" ),
6767 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "tags.0" , "terraform-test" ),
@@ -92,7 +92,7 @@ func TestAccServer_Minimal2(t *testing.T) {
9292 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "image" , "ubuntu_focal" ),
9393 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "type" , "DEV1-S" ),
9494 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "root_volume.0.delete_on_termination" , "true" ),
95- resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "root_volume.0.size_in_gb" , "20 " ),
95+ resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "root_volume.0.size_in_gb" , "10 " ),
9696 resource .TestCheckResourceAttrSet ("scaleway_instance_server.base" , "root_volume.0.volume_id" ),
9797 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "enable_dynamic_ip" , "false" ),
9898 resource .TestCheckResourceAttr ("scaleway_instance_server.base" , "state" , "started" ),
@@ -112,7 +112,7 @@ func TestAccServer_Minimal2(t *testing.T) {
112112 resource .TestCheckResourceAttr ("scaleway_instance_server.main" , "image" , "ubuntu_focal" ),
113113 resource .TestCheckResourceAttr ("scaleway_instance_server.main" , "type" , "DEV1-S" ),
114114 resource .TestCheckResourceAttr ("scaleway_instance_server.main" , "root_volume.0.delete_on_termination" , "true" ),
115- resource .TestCheckResourceAttr ("scaleway_instance_server.main" , "root_volume.0.size_in_gb" , "20" ),
115+ resource .TestCheckResourceAttr ("scaleway_instance_server.main" , "root_volume.0.size_in_gb" , "20" ), // It resizes to 20GB as terraform will take max space available for l_ssd.
116116 resource .TestCheckResourceAttr ("scaleway_instance_server.main" , "root_volume.0.volume_type" , "l_ssd" ),
117117 resource .TestCheckResourceAttrSet ("scaleway_instance_server.main" , "root_volume.0.volume_id" ),
118118 resource .TestCheckResourceAttr ("scaleway_instance_server.main" , "enable_dynamic_ip" , "false" ),
@@ -160,6 +160,7 @@ func TestAccServer_RootVolume1(t *testing.T) {
160160 image = "ubuntu_focal"
161161 type = "DEV1-S"
162162 root_volume {
163+ volume_type = "l_ssd"
163164 size_in_gb = 10
164165 delete_on_termination = true
165166 }
@@ -178,6 +179,7 @@ func TestAccServer_RootVolume1(t *testing.T) {
178179 image = "ubuntu_focal"
179180 type = "DEV1-S"
180181 root_volume {
182+ volume_type = "l_ssd"
181183 size_in_gb = 20
182184 delete_on_termination = true
183185 }
@@ -1023,7 +1025,7 @@ func TestAccServer_WithDefaultRootVolumeAndAdditionalVolume(t *testing.T) {
10231025
10241026 resource "scaleway_instance_server" "main" {
10251027 type = "DEV1-S"
1026- image = "ubuntu-bionic "
1028+ image = "ubuntu-jammy "
10271029 root_volume {
10281030 delete_on_termination = false
10291031 }
@@ -1287,7 +1289,9 @@ func TestAccServer_MigrateInvalidLocalVolumeSize(t *testing.T) {
12871289 resource "scaleway_instance_server" "main" {
12881290 image = "ubuntu_jammy"
12891291 type = "DEV1-L"
1290-
1292+ root_volume {
1293+ volume_type = "l_ssd"
1294+ }
12911295 }` ,
12921296 Check : resource .ComposeTestCheckFunc (
12931297 arePrivateNICsPresent (tt , "scaleway_instance_server.main" ),
@@ -1299,7 +1303,9 @@ func TestAccServer_MigrateInvalidLocalVolumeSize(t *testing.T) {
12991303 resource "scaleway_instance_server" "main" {
13001304 image = "ubuntu_jammy"
13011305 type = "DEV1-S"
1302-
1306+ root_volume {
1307+ volume_type = "l_ssd"
1308+ }
13031309 }` ,
13041310 Check : resource .ComposeTestCheckFunc (
13051311 arePrivateNICsPresent (tt , "scaleway_instance_server.main" ),
@@ -1326,6 +1332,9 @@ func TestAccServer_CustomDiffImage(t *testing.T) {
13261332 image = "ubuntu_jammy"
13271333 type = "DEV1-S"
13281334 state = "stopped"
1335+ root_volume {
1336+ volume_type = "l_ssd" // Keep this while data.scaleway_marketplace_image does not provide a image_type filter.
1337+ }
13291338 }
13301339 ` ,
13311340 Check : resource .ComposeTestCheckFunc (
@@ -1339,11 +1348,17 @@ func TestAccServer_CustomDiffImage(t *testing.T) {
13391348 image = "ubuntu_jammy"
13401349 type = "DEV1-S"
13411350 state = "stopped"
1351+ root_volume {
1352+ volume_type = "l_ssd" // Keep this while data.scaleway_marketplace_image does not provide a image_type filter.
1353+ }
13421354 }
13431355 resource "scaleway_instance_server" "copy" {
13441356 image = "ubuntu_jammy"
13451357 type = "DEV1-S"
13461358 state = "stopped"
1359+ root_volume {
1360+ volume_type = "l_ssd" // Keep this while data.scaleway_marketplace_image does not provide a image_type filter.
1361+ }
13471362 }
13481363 ` ,
13491364 Check : resource .ComposeTestCheckFunc (
@@ -1369,11 +1384,17 @@ func TestAccServer_CustomDiffImage(t *testing.T) {
13691384 image = data.scaleway_marketplace_image.jammy.id
13701385 type = "DEV1-S"
13711386 state = "stopped"
1387+ root_volume {
1388+ volume_type = "l_ssd" // Keep this while data.scaleway_marketplace_image does not provide a image_type filter.
1389+ }
13721390 }
13731391 resource "scaleway_instance_server" "copy" {
13741392 image = "ubuntu_jammy"
13751393 type = "DEV1-S"
13761394 state = "stopped"
1395+ root_volume {
1396+ volume_type = "l_ssd" // Keep this while data.scaleway_marketplace_image does not provide a image_type filter.
1397+ }
13771398 }
13781399 ` ,
13791400 Check : resource .ComposeTestCheckFunc (
@@ -1401,11 +1422,17 @@ func TestAccServer_CustomDiffImage(t *testing.T) {
14011422 image = data.scaleway_marketplace_image.focal.id
14021423 type = "DEV1-S"
14031424 state = "stopped"
1425+ root_volume {
1426+ volume_type = "l_ssd" // Keep this while data.scaleway_marketplace_image does not provide a image_type filter.
1427+ }
14041428 }
14051429 resource "scaleway_instance_server" "copy" {
14061430 image = "ubuntu_jammy"
14071431 type = "DEV1-S"
14081432 state = "stopped"
1433+ root_volume {
1434+ volume_type = "l_ssd" // Keep this while data.scaleway_marketplace_image does not provide a image_type filter.
1435+ }
14091436 }
14101437 ` ,
14111438 PlanOnly : true ,
0 commit comments