Skip to content

Commit

Permalink
Migration
Browse files Browse the repository at this point in the history
  • Loading branch information
claudusd committed Dec 2, 2019
1 parent 092372c commit f913d40
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion proxmox/resource_vm_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func resourceVmQemu() *schema.Resource {
"target_node": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"onboot": {
Type: schema.TypeBool,
Expand Down Expand Up @@ -614,6 +613,18 @@ func resourceVmQemuUpdate(d *schema.ResourceData, meta interface{}) error {
serials := d.Get("serial").(*schema.Set)
qemuSerials := DevicesSetToMap(serials)

d.Partial(true)
if d.HasChange("target_node") {
_, err := client.MigrateNode(vmr, d.Get("target_node").(string), true)
if err != nil {
pmParallelEnd(pconf)
return err
}
d.SetPartial("target_node")
vmr.SetNode(d.Get("target_node").(string))
}
d.Partial(false)

config := pxapi.ConfigQemu{
Name: d.Get("name").(string),
Description: d.Get("desc").(string),
Expand Down

0 comments on commit f913d40

Please sign in to comment.