@@ -379,31 +379,30 @@ 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 {}
389398 if file != "" {
390399 todecode , _ := file .(string )
391400
392401 err = json .Unmarshal ([]byte (todecode ), & partitioningSchema )
393402 if err != nil {
394403 return diag .FromErr (err )
395404 }
396- }
397-
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" )),
405+ req .Install .PartitioningSchema = & partitioningSchema
407406 }
408407 }
409408
0 commit comments