From bbf781562f7e6b5ff8db88aacd85727aef62af1e Mon Sep 17 00:00:00 2001 From: Andreas Steinel Date: Thu, 23 Jan 2020 11:43:19 +0100 Subject: [PATCH] Add path to files with extension if an extension is present, it is a real file which has to be in a directory with the VMID. --- proxmoxdriver.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/proxmoxdriver.go b/proxmoxdriver.go index 30b368d..15652b5 100644 --- a/proxmoxdriver.go +++ b/proxmoxdriver.go @@ -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)