diff --git a/ibm/service/power/resource_ibm_pi_virtual_serial_number.go b/ibm/service/power/resource_ibm_pi_virtual_serial_number.go index f181588793..9ba962ee95 100644 --- a/ibm/service/power/resource_ibm_pi_virtual_serial_number.go +++ b/ibm/service/power/resource_ibm_pi_virtual_serial_number.go @@ -87,7 +87,9 @@ func resourceIBMPIVirtualSerialNumberCreate(ctx context.Context, d *schema.Resou if err != nil { return diag.FromErr(err) } - oldPvmInstanceId = *vsn.PvmInstanceID + if vsn.PvmInstanceID != nil { + oldPvmInstanceId = *vsn.PvmInstanceID + } if v, ok := d.GetOk(Arg_Description); ok { description := v.(string) if description != *vsn.Description { @@ -346,15 +348,6 @@ func resourceIBMPIVirtualSerialNumberUpdate(ctx context.Context, d *schema.Resou return resourceIBMPIVirtualSerialNumberRead(ctx, d, meta) } -func flattenVirtualSerialNumberToListSerialType(vsn *models.VirtualSerialNumber) []map[string]interface{} { - v := make([]map[string]interface{}, 1) - v[0] = map[string]interface{}{ - Attr_Description: vsn.Description, - Attr_Serial: vsn.Serial, - } - return v -} - func startLparAfterVSNChange(ctx context.Context, client *instance.IBMPIInstanceClient, id string, timeout time.Duration) error { body := &models.PVMInstanceAction{ Action: flex.PtrToString(Action_Start),