[PR #54] [CLOSED] Add KVM hardware virtualization support #187

Closed
opened 2026-02-28 00:41:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/54
Author: @snoord
Created: 10/7/2019
Status: Closed

Base: masterHead: f-qemu-add-kvm-hardware-virt-option


📝 Commits (10+)

  • 95191c3 Add KVM hardware virtualization support
  • 652f65b Fix getting pool from the API
  • c664655 Fix pool modification
  • 6f07917 Throw an error if the wanted pool doesn't exist
  • 75a2e0f Merge pull request #55 from V-Paranoiaque/fix/pool-update
  • 186eccc Add upload functionality
  • 832862c gofmt
  • b0c2796 Merge pull request #56 from carlpett/upload
  • cf52c5d Add NextId and VMIdExists function
  • dd1ec59 Merge pull request #58 from solidnerd/add-nextid

📊 Changes

6 files changed (+489 additions, -72 deletions)

View changed files

📝 README.md (+1 -0)
📝 main.go (+37 -2)
📝 proxmox/client.go (+225 -6)
📝 proxmox/config_lxc.go (+55 -55)
📝 proxmox/config_qemu.go (+159 -7)
📝 proxmox/session.go (+12 -2)

📄 Description

This PR adds the ability to toggle KVM hardware virtualization on or off via the kvm boolean. Open to criticism/feedback as I haven't had much experience with golang so I am looking to improve.

Successfully tested with the following:

$ ./proxmox-api-go -insecure createQemu 123 proxmox < qemu1.json
2019/10/07 14:30:15 {"name":"golang1.test.com","desc":"Test proxmox-api-go","onboot":false,"agent":0,"memory":2048,"os":"l26","cores":2,"sockets":1,"cpu":"kvm64","numa":false,"kvm":false,"hotplug":"","iso":"zfs-nfs:iso/CentOS-7-x86_64-DVD-1908.iso","fullclone":null,"boot":"cdn","disk":{"0":{"backup":true,"cache":"none","size":"30G","storage":"lvm-thin","storage_type":"lvm","type":"scsi"}},"network":{"0":{"bridge":"nat","model":"virtio"},"1":{"bridge":"vmbr0","model":"virtio","tag":-1}},"diskGB":0,"storage":"","storageType":"","nic":"","bridge":"","vlan":-1,"mac":"","ciuser":"","cipassword":"","cicustom":"","searchdomain":"","nameserver":"","sshkeys":"","ipconfig0":"","ipconfig1":"","ipconfig2":""}                                
2019/10/07 14:30:16 Complete
$ 
$ cat qemu1.json
{
  "name": "golang1.test.com",
  "desc": "Test proxmox-api-go",
  "memory": 2048,
  "os": "l26",
  "cores": 2,
  "sockets": 1,
  "kvm": false,
  "boot": "cdn",
  "cpu": "kvm64",
  "iso": "zfs-nfs:iso/CentOS-7-x86_64-DVD-1908.iso",
  "disk": {
    "0": {
      "type": "scsi",
      "storage": "lvm-thin",
      "storage_type": "lvm",
      "size": "30G",
      "backup": true,
      "cache": "none"
    }
  },
  "network": {
    "0": {
      "model": "virtio",
      "bridge": "nat"
    },
    "1": {
      "model": "virtio",
      "bridge": "vmbr0",
      "tag": -1
    }
  }
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/54 **Author:** [@snoord](https://github.com/snoord) **Created:** 10/7/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `f-qemu-add-kvm-hardware-virt-option` --- ### 📝 Commits (10+) - [`95191c3`](https://github.com/Telmate/proxmox-api-go/commit/95191c3136a459423c3b9f176181e50d549dd5af) Add KVM hardware virtualization support - [`652f65b`](https://github.com/Telmate/proxmox-api-go/commit/652f65b530a2492344f45e7b5520a6efee01db1d) Fix getting pool from the API - [`c664655`](https://github.com/Telmate/proxmox-api-go/commit/c66465572caf58cb1355dc73d5c0c31e586c13e2) Fix pool modification - [`6f07917`](https://github.com/Telmate/proxmox-api-go/commit/6f0791789f7670f03737a8c85e3ea6d511022939) Throw an error if the wanted pool doesn't exist - [`75a2e0f`](https://github.com/Telmate/proxmox-api-go/commit/75a2e0ff07736c63b14824437c39513b917349ff) Merge pull request #55 from V-Paranoiaque/fix/pool-update - [`186eccc`](https://github.com/Telmate/proxmox-api-go/commit/186ecccf4c7867670ef922f3960d1c8238083cad) Add upload functionality - [`832862c`](https://github.com/Telmate/proxmox-api-go/commit/832862c09034aca7a6a6698fe1b4172d94a70988) gofmt - [`b0c2796`](https://github.com/Telmate/proxmox-api-go/commit/b0c2796b9fcf563a21fe3f5ecc0858e89b1c2ad7) Merge pull request #56 from carlpett/upload - [`cf52c5d`](https://github.com/Telmate/proxmox-api-go/commit/cf52c5d3c2061652e29a45187cf5a44bb0641f64) Add NextId and VMIdExists function - [`dd1ec59`](https://github.com/Telmate/proxmox-api-go/commit/dd1ec5917265ff7e35723684968818a3fce51334) Merge pull request #58 from solidnerd/add-nextid ### 📊 Changes **6 files changed** (+489 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -0) 📝 `main.go` (+37 -2) 📝 `proxmox/client.go` (+225 -6) 📝 `proxmox/config_lxc.go` (+55 -55) 📝 `proxmox/config_qemu.go` (+159 -7) 📝 `proxmox/session.go` (+12 -2) </details> ### 📄 Description This PR adds the ability to toggle KVM hardware virtualization on or off via the `kvm` boolean. Open to criticism/feedback as I haven't had much experience with golang so I am looking to improve. Successfully tested with the following: ``` $ ./proxmox-api-go -insecure createQemu 123 proxmox < qemu1.json 2019/10/07 14:30:15 {"name":"golang1.test.com","desc":"Test proxmox-api-go","onboot":false,"agent":0,"memory":2048,"os":"l26","cores":2,"sockets":1,"cpu":"kvm64","numa":false,"kvm":false,"hotplug":"","iso":"zfs-nfs:iso/CentOS-7-x86_64-DVD-1908.iso","fullclone":null,"boot":"cdn","disk":{"0":{"backup":true,"cache":"none","size":"30G","storage":"lvm-thin","storage_type":"lvm","type":"scsi"}},"network":{"0":{"bridge":"nat","model":"virtio"},"1":{"bridge":"vmbr0","model":"virtio","tag":-1}},"diskGB":0,"storage":"","storageType":"","nic":"","bridge":"","vlan":-1,"mac":"","ciuser":"","cipassword":"","cicustom":"","searchdomain":"","nameserver":"","sshkeys":"","ipconfig0":"","ipconfig1":"","ipconfig2":""} 2019/10/07 14:30:16 Complete $ $ cat qemu1.json { "name": "golang1.test.com", "desc": "Test proxmox-api-go", "memory": 2048, "os": "l26", "cores": 2, "sockets": 1, "kvm": false, "boot": "cdn", "cpu": "kvm64", "iso": "zfs-nfs:iso/CentOS-7-x86_64-DVD-1908.iso", "disk": { "0": { "type": "scsi", "storage": "lvm-thin", "storage_type": "lvm", "size": "30G", "backup": true, "cache": "none" } }, "network": { "0": { "model": "virtio", "bridge": "nat" }, "1": { "model": "virtio", "bridge": "vmbr0", "tag": -1 } } } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:41:01 +03:00
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#187
No description provided.