mirror of
https://github.com/letic/terraform-provider-proxmox.git
synced 2024-07-03 08:02:39 +00:00
Merge branch 'master' of github.com:Telmate/terraform-provider-proxmox
This commit is contained in:
commit
471658bd10
|
@ -427,6 +427,8 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
pmParallelEnd(pconf)
|
pmParallelEnd(pconf)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return fmt.Errorf("Either clone or iso must be set")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.Printf("[DEBUG] recycling VM vmId: %d", vmr.VmId())
|
log.Printf("[DEBUG] recycling VM vmId: %d", vmr.VmId())
|
||||||
|
@ -475,19 +477,24 @@ func resourceVmQemuUpdate(d *schema.ResourceData, meta interface{}) error {
|
||||||
pconf := meta.(*providerConfiguration)
|
pconf := meta.(*providerConfiguration)
|
||||||
pmParallelBegin(pconf)
|
pmParallelBegin(pconf)
|
||||||
client := pconf.Client
|
client := pconf.Client
|
||||||
vmr, err := client.GetVmRefByName(d.Get("name").(string))
|
_, _, vmID, err := parseResourceId(d.Id())
|
||||||
|
if err != nil {
|
||||||
|
pmParallelEnd(pconf)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
vmr := pxapi.NewVmRef(vmID)
|
||||||
|
_, err = client.GetVmInfo(vmr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pmParallelEnd(pconf)
|
pmParallelEnd(pconf)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
vmName := d.Get("name").(string)
|
|
||||||
configDisksSet := d.Get("disk").(*schema.Set)
|
configDisksSet := d.Get("disk").(*schema.Set)
|
||||||
qemuDisks := devicesSetToMap(configDisksSet)
|
qemuDisks := devicesSetToMap(configDisksSet)
|
||||||
configNetworksSet := d.Get("network").(*schema.Set)
|
configNetworksSet := d.Get("network").(*schema.Set)
|
||||||
qemuNetworks := devicesSetToMap(configNetworksSet)
|
qemuNetworks := devicesSetToMap(configNetworksSet)
|
||||||
|
|
||||||
config := pxapi.ConfigQemu{
|
config := pxapi.ConfigQemu{
|
||||||
Name: vmName,
|
Name: d.Get("name").(string),
|
||||||
Description: d.Get("desc").(string),
|
Description: d.Get("desc").(string),
|
||||||
Onboot: d.Get("onboot").(bool),
|
Onboot: d.Get("onboot").(bool),
|
||||||
Memory: d.Get("memory").(int),
|
Memory: d.Get("memory").(int),
|
||||||
|
@ -555,8 +562,15 @@ func resourceVmQemuRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
pconf := meta.(*providerConfiguration)
|
pconf := meta.(*providerConfiguration)
|
||||||
pmParallelBegin(pconf)
|
pmParallelBegin(pconf)
|
||||||
client := pconf.Client
|
client := pconf.Client
|
||||||
vmr, err := client.GetVmRefByName(d.Get("name").(string))
|
_, _, vmID, err := parseResourceId(d.Id())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
pmParallelEnd(pconf)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
vmr := pxapi.NewVmRef(vmID)
|
||||||
|
_, err = client.GetVmInfo(vmr)
|
||||||
|
if err != nil {
|
||||||
|
pmParallelEnd(pconf)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
config, err := pxapi.NewConfigQemuFromApi(vmr, client)
|
config, err := pxapi.NewConfigQemuFromApi(vmr, client)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user