[GH-ISSUE #14] Clone qemu interface is nil #6

Closed
opened 2026-02-28 00:40:08 +03:00 by kerem · 2 comments
Owner

Originally created by @tutte on GitHub (Nov 22, 2018).
Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/14

Performing the following request
./proxmox-api-go --debug cloneQemu cloudinit px01 < ../cloud.json
being the content of cloud.json

{
  "name": "cloudinit.test.com",
  "desc": "Test proxmox-api-go clone",
  "storage": "local",
  "memory": 2048,
  "cores": 2,
  "sockets": 1,
  "ipconfig0": "gw=10.0.0.2,ip=10.0.0.201/24",
  "sshkey" : "ssh-rsa #mysshpublic_key",
  "nameserver": "8.8.8.8",
  "fullclone": 1,
  "disk": {
    "0": {
      "type": "virtio",
      "storage": "local",
      "storage_type": "dir",
      "size": "30G",
      "backup": true
    }
  }
}

Expected result

The machine gets cloned and running with the specified parameters.

Current result

Application exits with the following error:

2018/11/22 13:37:05 >>>>>>>>>> REQUEST:
%!(EXTRA string=GET /api2/json/nodes/px01/tasks/UPID:px01:000066AE:14300677:5BF6A2ED:qmclone:9000:root@pam:/status HTTP/1.1
Host: px01.mycompany.com:8006
User-Agent: Go-http-client/1.1
Accept: application/json
Cookie: PVEAuthCookie=Authcookie
Csrfpreventiontoken: 5BF6A2ED:XNIPbOOoLdnZyjHbAHfDQn8VncM
Accept-Encoding: gzip

)
2018/11/22 13:37:05 <<<<<<<<<< RESULT:
%!(EXTRA string=HTTP/1.1 200 OK
Content-Length: 231
Cache-Control: max-age=0
Connection: Keep-Alive
Connection: Keep-Alive
Content-Type: application/json;charset=UTF-8
Date: Thu, 22 Nov 2018 12:37:06 GMT
Expires: Thu, 22 Nov 2018 12:37:06 GMT
Pragma: no-cache
Server: pve-api-daemon/3.0

{"data":{"node":"px01","pid":26286,"pstart":338691703,"exitstatus":"OK","status":"stopped","upid":"UPID:px01:000066AE:14300677:5BF6A2ED:qmclone:9000:root@pam:","starttime":1542890221,"id":"9000","user":"root@pam","type":"qmclone"}})
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.CreateQemuDisksParams(0xc000452080, 0x12, 0xc0004520a0, 0x19, 0x0, 0x800, 0x0, 0x0, 0x2, 0x1, ...)
	/Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:615 +0xd04
github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.UpdateConfig(0xc000452080, 0x12, 0xc0004520a0, 0x19, 0x0, 0x800, 0x0, 0x0, 0x2, 0x1, ...)
	/Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:147 +0x39b
github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.CloneVm(0xc000452080, 0x12, 0xc0004520a0, 0x19, 0x0, 0x800, 0x0, 0x0, 0x2, 0x1, ...)
	/Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:134 +0x46c
main.main()
	/Users/myuser/Development/proxmox-api-go/main.go:132 +0xfa9

The VM is cloned and remains stopped with the memory and CPU assigned but without the requested disk size.

Versions

MacOS 13.0
go 1.11.2 darwin/amd64
Latest proxmox-api-go at branch master
Proxmox 5.2-9

Originally created by @tutte on GitHub (Nov 22, 2018). Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/14 Performing the following request `./proxmox-api-go --debug cloneQemu cloudinit px01 < ../cloud.json` being the content of cloud.json ``` { "name": "cloudinit.test.com", "desc": "Test proxmox-api-go clone", "storage": "local", "memory": 2048, "cores": 2, "sockets": 1, "ipconfig0": "gw=10.0.0.2,ip=10.0.0.201/24", "sshkey" : "ssh-rsa #mysshpublic_key", "nameserver": "8.8.8.8", "fullclone": 1, "disk": { "0": { "type": "virtio", "storage": "local", "storage_type": "dir", "size": "30G", "backup": true } } } ``` ## Expected result The machine gets cloned and running with the specified parameters. ## Current result Application exits with the following error: ``` 2018/11/22 13:37:05 >>>>>>>>>> REQUEST: %!(EXTRA string=GET /api2/json/nodes/px01/tasks/UPID:px01:000066AE:14300677:5BF6A2ED:qmclone:9000:root@pam:/status HTTP/1.1 Host: px01.mycompany.com:8006 User-Agent: Go-http-client/1.1 Accept: application/json Cookie: PVEAuthCookie=Authcookie Csrfpreventiontoken: 5BF6A2ED:XNIPbOOoLdnZyjHbAHfDQn8VncM Accept-Encoding: gzip ) 2018/11/22 13:37:05 <<<<<<<<<< RESULT: %!(EXTRA string=HTTP/1.1 200 OK Content-Length: 231 Cache-Control: max-age=0 Connection: Keep-Alive Connection: Keep-Alive Content-Type: application/json;charset=UTF-8 Date: Thu, 22 Nov 2018 12:37:06 GMT Expires: Thu, 22 Nov 2018 12:37:06 GMT Pragma: no-cache Server: pve-api-daemon/3.0 {"data":{"node":"px01","pid":26286,"pstart":338691703,"exitstatus":"OK","status":"stopped","upid":"UPID:px01:000066AE:14300677:5BF6A2ED:qmclone:9000:root@pam:","starttime":1542890221,"id":"9000","user":"root@pam","type":"qmclone"}}) panic: interface conversion: interface {} is nil, not string goroutine 1 [running]: github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.CreateQemuDisksParams(0xc000452080, 0x12, 0xc0004520a0, 0x19, 0x0, 0x800, 0x0, 0x0, 0x2, 0x1, ...) /Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:615 +0xd04 github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.UpdateConfig(0xc000452080, 0x12, 0xc0004520a0, 0x19, 0x0, 0x800, 0x0, 0x0, 0x2, 0x1, ...) /Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:147 +0x39b github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.CloneVm(0xc000452080, 0x12, 0xc0004520a0, 0x19, 0x0, 0x800, 0x0, 0x0, 0x2, 0x1, ...) /Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:134 +0x46c main.main() /Users/myuser/Development/proxmox-api-go/main.go:132 +0xfa9 ``` The VM is cloned and remains stopped with the memory and CPU assigned but without the requested disk size. ## Versions MacOS 13.0 go 1.11.2 darwin/amd64 Latest proxmox-api-go at branch master Proxmox 5.2-9
kerem closed this issue 2026-02-28 00:40:08 +03:00
Author
Owner

@tutte commented on GitHub (Nov 22, 2018):

Removing the disk part from the examples as in README.md results in a different error:
cloud.json

{
  "name": "cloudinit.test.com",
  "desc": "Test proxmox-api-go clone",
  "storage": "local",
  "memory": 4048,
  "cores": 1,
  "sockets": 1,
  "ipconfig0": "gw=10.0.0.2,ip=10.0.0.201/24",
  "sshkey" : "ssh-rsa ",
  "nameserver": "8.8.8.8",
  "fullclone": 1
}

Error:

2018/11/22 13:51:26 >>>>>>>>>> REQUEST:
%!(EXTRA string=GET /api2/json/nodes/px01/tasks/UPID:px01:00006DB0:14315784:5BF6A64C:qmclone:9000:root@pam:/status HTTP/1.1
Host: px01.mycompany.com:8006
User-Agent: Go-http-client/1.1
Accept: application/json
Cookie: PVEAuthCookie=PVE:Authcookie
Csrfpreventiontoken: 5BF6A64C:+bH3qSotnN1JEwDKdUIW87BXqQk
Accept-Encoding: gzip

)
2018/11/22 13:51:26 <<<<<<<<<< RESULT:
%!(EXTRA string=HTTP/1.1 200 OK
Content-Length: 231
Cache-Control: max-age=0
Connection: Keep-Alive
Connection: Keep-Alive
Content-Type: application/json;charset=UTF-8
Date: Thu, 22 Nov 2018 12:51:26 GMT
Expires: Thu, 22 Nov 2018 12:51:26 GMT
Pragma: no-cache
Server: pve-api-daemon/3.0

{"data":{"starttime":1542891084,"id":"9000","node":"px01","pid":28080,"exitstatus":"OK","status":"stopped","pstart":338777988,"upid":"UPID:px01:00006DB0:14315784:5BF6A64C:qmclone:9000:root@pam:","type":"qmclone","user":"root@pam"}})
panic: assignment to entry in nil map

goroutine 1 [running]:
github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.CreateQemuDisksParams(0xc0004080c0, 0x12, 0xc000408140, 0x19, 0x0, 0xfd0, 0x0, 0x0, 0x1, 0x1, ...)
	/Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:582 +0xc72
github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.UpdateConfig(0xc0004080c0, 0x12, 0xc000408140, 0x19, 0x0, 0xfd0, 0x0, 0x0, 0x1, 0x1, ...)
	/Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:147 +0x39b
github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.CloneVm(0xc0004080c0, 0x12, 0xc000408140, 0x19, 0x0, 0xfd0, 0x0, 0x0, 0x1, 0x1, ...)
	/Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:134 +0x46c
main.main()
	/Users/myuser/Development/proxmox-api-go/main.go:132 +0xfa9
<!-- gh-comment-id:441022115 --> @tutte commented on GitHub (Nov 22, 2018): Removing the disk part from the examples as in README.md results in a different error: cloud.json ``` { "name": "cloudinit.test.com", "desc": "Test proxmox-api-go clone", "storage": "local", "memory": 4048, "cores": 1, "sockets": 1, "ipconfig0": "gw=10.0.0.2,ip=10.0.0.201/24", "sshkey" : "ssh-rsa ", "nameserver": "8.8.8.8", "fullclone": 1 } ``` Error: ``` 2018/11/22 13:51:26 >>>>>>>>>> REQUEST: %!(EXTRA string=GET /api2/json/nodes/px01/tasks/UPID:px01:00006DB0:14315784:5BF6A64C:qmclone:9000:root@pam:/status HTTP/1.1 Host: px01.mycompany.com:8006 User-Agent: Go-http-client/1.1 Accept: application/json Cookie: PVEAuthCookie=PVE:Authcookie Csrfpreventiontoken: 5BF6A64C:+bH3qSotnN1JEwDKdUIW87BXqQk Accept-Encoding: gzip ) 2018/11/22 13:51:26 <<<<<<<<<< RESULT: %!(EXTRA string=HTTP/1.1 200 OK Content-Length: 231 Cache-Control: max-age=0 Connection: Keep-Alive Connection: Keep-Alive Content-Type: application/json;charset=UTF-8 Date: Thu, 22 Nov 2018 12:51:26 GMT Expires: Thu, 22 Nov 2018 12:51:26 GMT Pragma: no-cache Server: pve-api-daemon/3.0 {"data":{"starttime":1542891084,"id":"9000","node":"px01","pid":28080,"exitstatus":"OK","status":"stopped","pstart":338777988,"upid":"UPID:px01:00006DB0:14315784:5BF6A64C:qmclone:9000:root@pam:","type":"qmclone","user":"root@pam"}}) panic: assignment to entry in nil map goroutine 1 [running]: github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.CreateQemuDisksParams(0xc0004080c0, 0x12, 0xc000408140, 0x19, 0x0, 0xfd0, 0x0, 0x0, 0x1, 0x1, ...) /Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:582 +0xc72 github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.UpdateConfig(0xc0004080c0, 0x12, 0xc000408140, 0x19, 0x0, 0xfd0, 0x0, 0x0, 0x1, 0x1, ...) /Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:147 +0x39b github.com/Telmate/proxmox-api-go/proxmox.ConfigQemu.CloneVm(0xc0004080c0, 0x12, 0xc000408140, 0x19, 0x0, 0xfd0, 0x0, 0x0, 0x1, 0x1, ...) /Users/myuser/go/src/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go:134 +0x46c main.main() /Users/myuser/Development/proxmox-api-go/main.go:132 +0xfa9 ```
Author
Owner

@thelastworm commented on GitHub (Jan 30, 2020):

Hi, I have the same issue.
Is there a work around available a that time? or we should go through REST API of proxmox with official API.

<!-- gh-comment-id:580351681 --> @thelastworm commented on GitHub (Jan 30, 2020): Hi, I have the same issue. Is there a work around available a that time? or we should go through REST API of proxmox with official API.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#6
No description provided.