Skip to content

Instantly share code, notes, and snippets.

View AkashRajvanshi's full-sized avatar
😎
DevOps

Akash Rajvanshi AkashRajvanshi

😎
DevOps
View GitHub Profile
# You can directly backup your vm from gui ( but if you want cli method -> )
# To create a backup
$ cd /var/lib/vz/dump
$ vzdump VM_ID # ( ID Show on GUI Pannel )
# To Restore a VM Image ( x.lzo )
$ cd /var/lib/vz/dump
# To Restore a VM
# List disk devices with lsblk
# Select a device to add
# create partions
$ fdisk /dev/sdb
# format device
$ mkfs.ext4 /dev/sdb1
# Create a physical group
$ pvcreate /dev/sdb1
# Setup
# List Drives
$ ls /dev/disk/by-id
# Create a pool
$ zpool create -f -m <mount> <pool> <type> <ids>
- create: subcommand to create the pool.
- -f: Force creating the pool to bypass the “EFI label error”.
# Github Repo for this Project: https://github.com/Weilbyte/PVEDiscordDark
# Download the Python Script & Run
$ wget https://raw.githubusercontent.com/Weilbyte/PVEDiscordDark/master/PVEDiscordDark.py
$ python3 PVEDiscordDark.py
# Proxmox by default updates from subscription based repo, for without subscription based repo update. We need to do some extra steps:
# Edit /etc/apt/sources.list ( add this )
$ vim /etc/apt/sources.list
# Not for production use
deb http://download.proxmox.com/debian buster pve-no-subscription
$ cd /etc/apt/sources.list.d
# Proxmox 6.2 and UP
# STEP1 - ssh to your proxmox server
# STEP2 - go to this dir
$ cd /usr/share/javascript/proxmox-widget-toolkit/
# STEP3 - create a backup of you proxmoxlib.js
$ cp proxmoxlib.js proxmoxlib.js.bak
# STEP3 - now edit proxmoxlib.js
-- Journal begins at Fri 2020-12-11 15:48:19 IST, ends at Sat 2020-12-12 16:08:29 IST. --
Dec 12 15:42:56 arch kernel: Linux version 5.4.82-1-lts (linux-lts@archlinux) (gcc version 10.2.0 (GCC)) #1 SMP Tue, 08 Dec 2020 12:10:59 +0000
Dec 12 15:42:56 arch kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-linux-lts root=UUID=d8ab550c-63a5-4463-968b-dd2ebf38de18 rw loglevel=3 nouveau.modeset=0 acpi_osi=! acpi_backlight=native idle=nomwait
Dec 12 15:42:56 arch kernel: KERNEL supported cpus:
Dec 12 15:42:56 arch kernel: Intel GenuineIntel
Dec 12 15:42:56 arch kernel: AMD AuthenticAMD
Dec 12 15:42:56 arch kernel: Hygon HygonGenuine
Dec 12 15:42:56 arch kernel: Centaur CentaurHauls
Dec 12 15:42:56 arch kernel: zhaoxin Shanghai
Dec 12 15:42:56 arch kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
$ cat /var/log/Xorg.0.log
[ 7.262] (--) Log file renamed from "/var/log/Xorg.pid-776.log" to "/var/log/Xorg.0.log"
[ 7.263]
X.Org X Server 1.20.10
X Protocol Version 11, Revision 0
[ 7.263] Build Operating System: Linux Arch Linux
[ 7.263] Current Operating System: Linux arch 5.4.82-1-lts #1 SMP Tue, 08 Dec 2020 12:10:59 +0000 x86_64
[ 7.263] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux-lts root=UUID=d8ab550c-63a5-4463-968b-dd2ebf38de18 rw loglevel=3 nvme_core.default_ps_max_latency_us=0
[ 7.263] Build Date: 10 December 2020 12:04:42PM
[ 7.263]
- name: Setup Kubernetes with Ansible
hosts: cluster
become: True
tasks:
- name: Updating the system
apt: update_cache=yes force_apt_get=yes cache_valid_time=3600
- name: Installing Snap
apt: name=snapd state=latest
- name: Installing MicroK8s Snap Package
snap:
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2",
"insecure-registries" : ["localhost:32000"]
}