Last active
November 28, 2024 23:07
-
-
Save dragolabs/f391bdda050480871ddd129aa6080ac2 to your computer and use it in GitHub Desktop.
Revisions
-
dragolabs revised this gist
Nov 25, 2017 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,8 @@ pvesh create /nodes/kvm01/qemu \ -ide0=local:101/vm-101-disk-0.qcow2 \ -ide2 local:iso/ubuntu-14.04-server-amd64.iso,media=cdrom pvesh create /nodes/kvm01/qemu/101/status/start ``` ### Remove container. Be careful, it'll destroy ct without questions ``` @@ -60,12 +61,12 @@ grep -R memory /etc/pve/local | awk '{sum += $NF } END {print sum;}' cat /etc/pve/.vmlist | grep node | cut -d '"' -f2 | sort -n ``` ### View sorted list of VMs like `vmid proxmox_host type` ``` cat /etc/pve/.vmlist | grep node | tr -d '":,'| awk '{print $1" "$4" "$6 }' | sort -n | column -t ``` ### View sorted list of VMs like `vmid proxmox_host type vm_name` ``` for i in $(cat /etc/pve/.vmlist | grep node | cut -d '"' -f2 | sort -n);do NAME=$(grep -R 'name:' /etc/pve/nodes/*/*/$i.conf | awk {'print $2'}); INFO=$(grep $i /etc/pve/.vmlist | grep node | tr -d '":,'| awk '{print $1"\t"$4"\t"$6 }'); printf "%s\t%s\n" "$INFO" "$NAME" ;done ``` -
dragolabs revised this gist
Nov 25, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,12 +60,12 @@ grep -R memory /etc/pve/local | awk '{sum += $NF } END {print sum;}' cat /etc/pve/.vmlist | grep node | cut -d '"' -f2 | sort -n ``` ### View sorted list of VMs like `vmid proxmox_host type ``` cat /etc/pve/.vmlist | grep node | tr -d '":,'| awk '{print $1" "$4" "$6 }' | sort -n | column -t ``` ### View sorted list of VMs like `vmid proxmox_host type vm_name ``` for i in $(cat /etc/pve/.vmlist | grep node | cut -d '"' -f2 | sort -n);do NAME=$(grep -R 'name:' /etc/pve/nodes/*/*/$i.conf | awk {'print $2'}); INFO=$(grep $i /etc/pve/.vmlist | grep node | tr -d '":,'| awk '{print $1"\t"$4"\t"$6 }'); printf "%s\t%s\n" "$INFO" "$NAME" ;done ``` -
dragolabs revised this gist
Nov 24, 2017 . 1 changed file with 29 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,6 +16,35 @@ pct create 100 \ --onboot 1 ``` ### Create container with pvesh command ``` pvesh create /nodes/promox01/lxc \ -vmid 1001 \ -ostemplate local:vztmpl/ubuntu-16.04-x64-base.tar.gz \ -cores 2 -cpuunits 1024 \ -memory 4096 -swap 128 \ -hostname ct1001.example.com \ -net1 name=eth1,ip=192.168.0.2/32,bridge=vmbr1 \ -rootfs local:24 \ -onboot 1 ``` ### Create KVM with pvesh command ``` pvesh create /nodes/kvm01/storage/local/content \ -filename vm-101-disk-0.qcow2 \ -format qcow2 -size 32G -vmid 101 pvesh create /nodes/kvm01/qemu \ -vmid 101 -memory 2048 \ -sockets 1 -cores 4 \ -net0 e1000,bridge=vmbr0 \ -net1 e1000,bridge=vmbr1 \ -ide0=local:101/vm-101-disk-0.qcow2 \ -ide2 local:iso/ubuntu-14.04-server-amd64.iso,media=cdrom pvesh create /nodes/kvm01/qemu/101/status/start``` ### Remove container. Be careful, it'll destroy ct without questions ``` pct destroy 100 -
dragolabs revised this gist
Nov 24, 2017 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,8 @@ ### Find next free VM ID ``` pvesh get /cluster/nextid ``` ### Create containter with external and internal nets ``` pct create 100 \ -
dragolabs revised this gist
Jul 19, 2017 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,3 +30,8 @@ cat /etc/pve/.vmlist | grep node | cut -d '"' -f2 | sort -n ``` cat /etc/pve/.vmlist | grep node | tr -d '":,'| awk '{print $1" "$4" "$6 }' | sort -n | column -t ``` ### View sorted list of VMs like `vmid proxmox_host type vm_name` ``` for i in $(cat /etc/pve/.vmlist | grep node | cut -d '"' -f2 | sort -n);do NAME=$(grep -R 'name:' /etc/pve/nodes/*/*/$i.conf | awk {'print $2'}); INFO=$(grep $i /etc/pve/.vmlist | grep node | tr -d '":,'| awk '{print $1"\t"$4"\t"$6 }'); printf "%s\t%s\n" "$INFO" "$NAME" ;done ``` -
dragolabs revised this gist
Jul 19, 2017 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,3 +25,8 @@ grep -R memory /etc/pve/local | awk '{sum += $NF } END {print sum;}' ``` cat /etc/pve/.vmlist | grep node | cut -d '"' -f2 | sort -n ``` ### View sorted list of VMs like `vmid proxmox_host type` ``` cat /etc/pve/.vmlist | grep node | tr -d '":,'| awk '{print $1" "$4" "$6 }' | sort -n | column -t ``` -
dragolabs renamed this gist
Jul 19, 2017 . 1 changed file with 11 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,10 +12,16 @@ pct create 100 \ ``` ### Remove container. Be careful, it'll destroy ct without questions ``` pct destroy 100 ``` ### View sum of memory allocated to VMs and CTs ``` grep -R memory /etc/pve/local | awk '{sum += $NF } END {print sum;}' ``` ### View sorted list of vmid ``` cat /etc/pve/.vmlist | grep node | cut -d '"' -f2 | sort -n ``` -
dragolabs revised this gist
Jun 30, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ pct create 100 \ ``` pct destroy 100 ``` ### View sum of memory allocated to VMs and CTs ``` grep -R memory /etc/pve/local | awk '{sum += $NF } END {print sum;}' ``` -
dragolabs revised this gist
Jun 30, 2017 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,8 +11,11 @@ pct create 100 \ --onboot 1 ``` ### Remove container. Be careful, it'll destroy ct without questions ``` pct destroy 100 ``` ### View sum memory allocated for VMs and CTs ``` grep -R memory /etc/pve/local | awk '{sum += $NF } END {print sum;}' ``` -
dragolabs revised this gist
Jun 29, 2017 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,4 +9,10 @@ pct create 100 \ --net1 name=eth1,ip=192.168.0.2/32,bridge=vmbr1 \ --rootfs local:24 \ --onboot 1 ``` ### Remove container. Be careful, it'll destroy ct without questions ``` pct destroy 100 ```
-
dragolabs created this gist
Jun 29, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ ### Create containter with external and internal nets ``` pct create 100 \ local:vztmpl/ubuntu-16.04-standard_16.04-1_amd64.tar.gz \ --cores 2 --cpuunits 1024 \ --memory 4096 --swap 128 \ --hostname ct100.example.com \ --net0 name=eth0,ip=1.2.3.4/32,bridge=vmbr0,gw=1.2.3.0 \ --net1 name=eth1,ip=192.168.0.2/32,bridge=vmbr1 \ --rootfs local:24 \ --onboot 1 ```