diff --git a/_posts/2024-06-27-Proxmox-Commands.md b/_posts/2024-06-27-Proxmox-Commands.md new file mode 100644 index 0000000..81c4c64 --- /dev/null +++ b/_posts/2024-06-27-Proxmox-Commands.md @@ -0,0 +1,159 @@ +--- +title: Proxmox Cheat Sheet +description: Helpful Proxmox commands to reference as a cheat sheet +date: 2024-06-24 19:31:00 -0500 +categories: [Cheat Sheets] +tags: [proxmox, cheat sheet, commands] # TAG names should always be lowercase +--- + +## VM Management + +| Command | Command Description | +| --- | --- | +| `qm list` | list VMs | +| `qm create ` | Create or restore a virtual machine. | +| `qm start ` | Start a VM | +| `qm suspend ` | Suspend virtual machine. | +| `qm shutdown ` | Shutdown a VM | +| `qm reboot ` | Reboot a VM | +| `qm reset ` | Reset a VM | +| `qm stop ` | Stop a VM | +| `qm destroy ` | Destroy the VM and all used/owned volumes. | +| `qm monitor ` | Enter Qemu Monitor interface. | +| `qm pending ` | Get the virtual machine configuration with both current and pending values. | +| `qm sendkey ` | Send key event to virtual machine. | +| `qm showcmd ` | Show command line used to start the VM (debug info). | +| `qm unlock ` | Unlock the VM | +| `qm clone ` | Clone a VM | +| `qm migrate ` | Migrate a VM | +| `qm status ` | Show VM status | +| `qm template ` | Create a Template | +| `qm set ` | Set virtual machine options (synchronous API) | + +### Cloudinit + +| Command | Command Description | +| --- | --- | +| `qm cloudinit dump ` | Get automatically generated cloudinit config. | +| `qm cloudinit pending ` | Get the cloudinit configuration with both current and pending values. | +| `qm cloudinit update ` | Regenerate and change cloudinit config drive. | + +### Disk + +| Command | Command Description | +| --- | --- | +| `qm disk import ` | Move volume to different storage or to a different VM. | +| `qm disk rescan` | Rescan all storages and update disk sizes and unused disk images. | +| `qm disk resize ` | Extend volume size. | +| `qm disk unlink --IDLIST ` | Unlink/delete disk images. | +| `qm rescan` | Rescan volumes. | +| `qemu-img convert ` | Convert qcow2 to raw | +| `qemu-img convert -p -O qcow2 ` | Convert back to qcow2 | + +### Snapshot + +| Command | Command Description | +| --- | --- | +| `qm listsnapshot ` | List all snapshots. | +| `qm snapshot ` | Snapshot a VM. | +| `qm delsnapshot ` | Delete a snapshot. | +| `qm rollback ` | Rollback a snapshot. | +| `qm terminal ` | Open a terminal using a serial device. | +| `qm vncproxy ` | Proxy VM VNC traffic to stdin/stdout. | + +### Misc + +| Command | Command Description | +| --- | --- | +| `qm guest cmd ` | Execute Qemu Guest Agent commands. | +| `qm guest exec ` | Executes the given command via the guest agent. | +| `qm guest exec-status ` | Gets the status of the given pid started by the guest-agent. | +| `qm guest passwd ` | Sets the password for the given user to the given password. | + +### PV, VG, LV Management + +| Command | Command Description | +| --- | --- | +| `pvcreate ` | Create a PV | +| `pvremove ` | Remove a PV | +| `pvs` | List all PVs | +| `vgcreate ` | Create a VG | +| `vgremove ` | Remove a VG | +| `vgs` | List all VGs | +| `lvcreate -L LV-SIZE -n ` | Create a LV | +| `lvremove /` | Remove a LV | +| `lvs` | List all LVs | + +### Storage Management + +| Command | Command Description | +| --- | --- | +| `pvesm add TYPE ` | Create a new storage | +| `pvesm alloc ` | Allocate disk images | +| `pvesm free ` | Delete volume | +| `pvesm remove ` | Delete storage configuration | +| `pvesm list ` | List storage content | +| `pvesm lvmscan` | An alias for pvesm scan lvm | +| `pvesm lvmthinscan` | An alias for pvesm scan lvmthin | +| `pvesm scan lvm` | List local LVM volume groups | +| `pvesm scan lvmthin VG` | List local LVM Thin Pools | +| `pvesm status` | Get status for all datastores | + +### Template Management + +| Command | Command Description | +| --- | --- | +| `pveam available` | List all templates | +| `pveam list ` | List all templates | +| `pveam download