@@ -410,14 +410,17 @@ func ResourceInstanceServerCreate(ctx context.Context, d *schema.ResourceData, m
410
410
Zone : zone ,
411
411
Name : types .ExpandOrGenerateString (d .Get ("name" ), "srv" ),
412
412
Project : types .ExpandStringPtr (d .Get ("project_id" )),
413
- Image : imageUUID ,
414
413
CommercialType : commercialType ,
415
414
SecurityGroup : types .ExpandStringPtr (zonal .ExpandID (d .Get ("security_group_id" )).ID ),
416
415
DynamicIPRequired : scw .BoolPtr (d .Get ("enable_dynamic_ip" ).(bool )),
417
416
Tags : types .ExpandStrings (d .Get ("tags" )),
418
417
RoutedIPEnabled : types .ExpandBoolPtr (types .GetBool (d , "routed_ip_enabled" )),
419
418
}
420
419
420
+ if imageUUID != "" {
421
+ req .Image = scw .StringPtr (imageUUID )
422
+ }
423
+
421
424
enableIPv6 , ok := d .GetOk ("enable_ipv6" )
422
425
if ok {
423
426
req .EnableIPv6 = scw .BoolPtr (enableIPv6 .(bool )) //nolint:staticcheck
@@ -453,7 +456,7 @@ func ResourceInstanceServerCreate(ctx context.Context, d *schema.ResourceData, m
453
456
req .Volumes = make (map [string ]* instanceSDK.VolumeServerTemplate )
454
457
rootVolume := d .Get ("root_volume.0" ).(map [string ]any )
455
458
456
- req .Volumes ["0" ] = prepareRootVolume (rootVolume , serverType , req . Image ).VolumeTemplate ()
459
+ req .Volumes ["0" ] = prepareRootVolume (rootVolume , serverType , imageUUID ).VolumeTemplate ()
457
460
if raw , ok := d .GetOk ("additional_volume_ids" ); ok {
458
461
for i , volumeID := range raw .([]interface {}) {
459
462
// We have to get the volume to know whether it is a local or a block volume
0 commit comments