Skip to content

Commit

Permalink
Add path to files with extension
Browse files Browse the repository at this point in the history
if an extension is present, it is a real file which has to be in a
directory with the VMID.
  • Loading branch information
lnxbil committed Jan 23, 2020
1 parent 08a9d19 commit bbf7815
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion proxmoxdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,12 @@ func (d *Driver) Create() error {
if d.StorageType == "qcow2" {
npp.SCSI0 = d.Storage + ":" + d.VMID + "/" + volume.Filename
} else if d.StorageType == "raw" {
npp.SCSI0 = d.Storage + ":" + volume.Filename
if strings.HasSuffix(volume.Filename, ".raw") {
// raw files (having .raw) should have the VMID in the path
npp.SCSI0 = d.Storage + ":" + d.VMID + "/" + volume.Filename
} else {
npp.SCSI0 = d.Storage + ":" + volume.Filename
}
}
d.debugf("Creating VM '%s' with '%d' of memory", npp.VMID, npp.Memory)
taskid, err := d.driver.NodesNodeQemuPost(d.Node, &npp)
Expand Down

0 comments on commit bbf7815

Please sign in to comment.