May 3, 2018

Add a thin provisioned logical volume to rescue a fulled Proxmox lab

It's a great & it's so efficient to have VM running on thin provisioned disks. However, I just learnt that Proxmox will quietly put a VM into some stalled status (web GUI shows a darkened icon but without green triangle, and the console will not respond) if the volume is fulled. Having Proxmox to reset or to boot with a .iso is possible, but sooner or later, all will hit the wall again.
I don't want to lose my VM, so my solution was to move a virtual disk out from the volume. I added a small USB drive (actually a mSATA SSD, seems performed ok) to the box, created a new thin pool volume, and move one VM out. Now I can keep the VMs running again.

Create a volume group on the USB (assuming a new group "external" on the disk /dev/sdc1):
vgcreate external /dev/sdc1 Create the volume (naming it "extdata") (yes, it's small):
lvcreate -L 14G -n extdata external Convert to a thin-provisioning volume:
lvconvert --type thin-pool external/extdata It's time to add the storage using web GUI (naming it "ext" here):
[WebGUI] > [Datacenter] > [Storage] > [Add] > ID: ext, Volume group: external, Thin pool: extdata > [Add] Finally, move the virtual disk: [WebGUI] > [999 (bustedVM)] > [Hardware] > [Hard Disk (virtio0)](the disk to move) > [Move disk] > Target storage: ext > [Move disk]

Installing CUDA for deep learning while having IGP for display

Note for installing CUDA for deep learning, while keeping the integrated graphic processor handling display.
(Tested on Debian Stretch 9.3)

Credit goes to:
https://unix.stackexchange.com/questions/218163/how-to-install-cuda-toolkit-7-8-9-on-debian-8-jessie-or-9-stretch
https://www.linkedin.com/pulse/installing-nvidia-cuda-80-ubuntu-1604-linux-gpu-new-victor
https://devtalk.nvidia.com/default/topic/991849/-solved-run-cuda-on-dedicated-nvidia-gpu-while-connecting-monitors-to-intel-hd-graphics-is-this-possible-/

1. Download CUDA installation runfile.
(`cuda_9.1.85_387.26_linux.run` in my case)
(This may take a while, 1.6GB)

2. Install requirements
sudo apt-get install linux-source sudo apt-get source linux-image-$(uname -r) sudo apt-get install linux-headers-$(uname -r) sudo apt-get install gcc g++ libxi-dev libglu1-mesa libglu1-mesa-dev libxmuu-dev linux-headers-amd64 linux-source
3. Install NVIDIA driver and CUDA
(As root, although the runfile will prompt for sudo password if necessary.)
chmod +x cuda_9.1.85_387.26_linux.run ./cuda_9.1.85_387.26_linux.run --no-opengl-libs
(y)es to "install on an unsupported configuration"
(y)es to "install NVIDIA Accelerated Graphics Driver"
(n)o to "run nvidia-xconfig"
(y)es to "CUDA Toolkit"