@@ -379,31 +379,32 @@ func ResourceServerCreate(ctx context.Context, d *schema.ResourceData, m any) di
379379 req .UserData = & cloudInitStr
380380 }
381381
382- partitioningSchema := baremetal.Schema {}
383-
384382 if file , ok := d .GetOk ("partitioning" ); ok || ! d .Get ("install_config_afterward" ).(bool ) {
385383 if diags := validateInstallConfig (ctx , d , m ); len (diags ) > 0 {
386384 return diags
387385 }
388386
387+ req .Install = & baremetal.CreateServerRequestInstall {
388+ OsID : zonal .ExpandID (d .Get ("os" )).ID ,
389+ Hostname : d .Get ("hostname" ).(string ),
390+ SSHKeyIDs : types .ExpandStrings (d .Get ("ssh_key_ids" )),
391+ User : types .ExpandStringPtr (d .Get ("user" )),
392+ Password : types .ExpandStringPtr (d .Get ("password" )),
393+ ServicePassword : types .ExpandStringPtr (d .Get ("service_password" )),
394+ ServiceUser : types .ExpandStringPtr (d .Get ("service_user" )),
395+ }
396+
397+ partitioningSchema := baremetal.Schema {}
398+
389399 if file != "" {
390400 todecode , _ := file .(string )
391401
392402 err = json .Unmarshal ([]byte (todecode ), & partitioningSchema )
393403 if err != nil {
394404 return diag .FromErr (err )
395405 }
396- }
397406
398- req .Install = & baremetal.CreateServerRequestInstall {
399- OsID : zonal .ExpandID (d .Get ("os" )).ID ,
400- Hostname : d .Get ("hostname" ).(string ),
401- SSHKeyIDs : types .ExpandStrings (d .Get ("ssh_key_ids" )),
402- User : types .ExpandStringPtr (d .Get ("user" )),
403- Password : types .ExpandStringPtr (d .Get ("password" )),
404- PartitioningSchema : & partitioningSchema ,
405- ServicePassword : types .ExpandStringPtr (d .Get ("service_password" )),
406- ServiceUser : types .ExpandStringPtr (d .Get ("service_user" )),
407+ req .Install .PartitioningSchema = & partitioningSchema
407408 }
408409 }
409410
0 commit comments