Proxmox

HOWTO: First Steps After Installation
aptitude update aptitude -y safe-upgrade

HOWTO: Set System Locale
dpkg-reconfigure locales  (and choose en_GB.utf8)

Thanks - https://wiki.debian.org/Locale

Install Software
aptitude install mdadm

Prepare Disks
sgdisk -R=/dev/sdb /dev/sda sgdisk -t 2:fd00 /dev/sdb sgdisk -t 3:fd00 /dev/sdb sgdisk -R=/dev/sdc /dev/sda sgdisk -t 2:fd00 /dev/sdc sgdisk -t 3:fd00 /dev/sdc parted GNU Parted 2.3 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print Model: ATA WDC WD3000FYYZ-0 (scsi) Disk /dev/sda: 3001GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start   End     Size    File system  Name     Flags 1     1049kB  2097kB  1049kB               primary  bios_grub 2     2097kB  537MB   535MB   ext3         primary  boot 3     537MB   3001GB  3000GB               primary  lvm (parted) (parted) select /dev/sdb Using /dev/sdb (parted) print Model: ATA WDC WD3000FYYZ-0 (scsi) Disk /dev/sdb: 3001GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start   End     Size    File system  Name     Flags 1     1049kB  2097kB  1049kB               primary  bios_grub 2     2097kB  537MB   535MB                primary  raid 3     537MB   3001GB  3000GB               primary  raid

Create RAID Arrays
mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdb2 mdadm --create /dev/md1 --level=1 --raid-disks=2 missing /dev/sdb3 cat /proc/partitions /proc/mdstat

Copy Boot Files To RAID Array
mkfs.ext3 /dev/md0 mkdir /mnt/tmp mount /dev/md0 /mnt/tmp cp -ax /boot/* /mnt/tmp umount /mnt/tmp rmdir /mnt/tmp

Change Boot Filesystem Tab
nano /etc/fstab /dev/pve/root / ext3 errors=remount-ro 0 1 /dev/pve/data /var/lib/vz ext3 defaults 0 1 /dev/md0 /boot ext3 defaults 0 1 /dev/pve/swap none swap sw 0 0 proc /proc proc defaults 0 0
 * 1) UUID=46b4d3d6-fdec-43b6-a4cb-3f8f8a9c6c10 /boot ext3 defaults 0 1

Do not reboot now as per kbDone's page!

Update GRUB Bootloader
echo 'GRUB_DISABLE_LINUX_UUID=true' >> /etc/default/grub echo 'GRUB_PRELOAD_MODULES="raid dmraid"' >> /etc/default/grub echo raid1 >> /etc/modules echo raid1 >> /etc/initramfs-tools/modules grub-install /dev/sda grub-install /dev/sdb grub-install /dev/sdc  (because we will actually be adding sdc below) update-grub update-initramfs -u

Now reboot.

reboot

Prepare First Disk (Part 1)
sgdisk -t 2:fd00 /dev/sda mdadm --add /dev/md0 /dev/sda2

Move LVM Data
pvcreate /dev/md1 vgextend pve /dev/md1 pvmove /dev/sda3 /dev/md1  <-- this takes a very long time! vgreduce pve /dev/sda3 pvremove /dev/sda3

Prepare First Disk (Part 2)
sgdisk -t 3:fd00 /dev/sda mdadm --add /dev/md1 /dev/sda3  <-- this takes a long time as well cat /proc/mdstat

Wait for RAID to sync.

Add Extra (Spare) Disks As Required
mdadm --add /dev/md0 /dev/sdc2 mdadm --add /dev/md1 /dev/sdc3

Update GRUB (Again)
grub-install /dev/sda grub-install /dev/sdb grub-install /dev/sdc update-grub update-initramfs -t -u sync

Finish
reboot cat /proc/mdstat

Thanks - http://kbdone.com/proxmox-ve-3-2-software-raid/

HOWTO: Add ISO Files
Storage View > Datacenter > server > local Upload

HOWTO: Add Virtual Machine (VM)
Server View > Datacenter > server Create VM

Ubuntu Linux
Copy Existing - Physical To Virtual (P2V)

Physical


 * https://help.ubuntu.com/community/BackupYourSystem/TAR
 * sudo tar -czvpf /backup.tar.gz --exclude=/backup.tar.gz --one-file-system /

Virtual

''STOP PRESS - new method?! - http://www.fsarchiver.org/QuickStart''


 * Boot with SystemRescueCD iso in virtual cdrom
 * either use the proxmox console, or set root password and restart ssh, and ssh in
 * Partition and Format virtual hard disk drive (1:swap,2:ext4)
 * mkdir /mnt/sda2 and mount -v /dev/sda2 /mnt/sda2/
 * scp physical:/backup.tar.gz /mnt/sda2/
 * sudo tar -xzvpf /mnt/sda2/backup.tar.gz -C /mnt/sda2/ --numeric-owner (close console window for this)
 * mount -t proc none /mnt/sda2/proc
 * mount -o bind /dev /mnt/sda2/dev
 * mont -t sysfs /sys /mnt/sda2/sys
 * chroot /mnt/sda2 /bin/bash
 * nano /etc/mtab /etc/fstab /etc/hosts /etc/network/interfaces (change IP address to different to physical)
 * touch /var/lock/aptitude
 * aptitude -y -v purge mdadm lm-sensors hddtemp smartmontools cpufrequtils
 * rm -rfv /var/lib/smartmontools/
 * grub-install /dev/sda
 * update-initramfs -u
 * update-grub
 * exit
 * reboot

Finish


 * When you are happy, then shut down the Physical and change the Virtual IP address, then reboot Virtual :-)

Windows 7
Fresh Installation


 * Create an ISO of the Windows 7 DVD

dd if=/dev/sr0 of=/var/lib/vz/template/iso/win7pro-sp1.iso


 * Download the VirtIO Drivers ISO
 * Create VM according to the Windows 7 Best Practices page
 * CDROM #1 = win7pro-sp1.iso
 * CDROM #2 = virtio-win-0.1-81.iso
 * CDROM #3 = VMware-tools-windows-9.4.11-2400950.iso
 * Start VM and read instructions below

Mouse Driver

This gives you much better mouse performance and uses less resources (than the default 'usb tablet mouse').

The vmmouse driver need a reboot to get activated but then you can enable/disable the 'usb device tablet' on the fly.


 * extract setup.exe from iso
 * extract datas from setup.exe
 * setup.exe /A /P C:\Extract
 * drivers are in C:\extract\Program Files\VMware\VMware Tools\VMware\Drivers\mouse

Mouse Driver (64 Bit) - http://packages.vmware.com/tools/esx/latest/windows/x64/index.html (e.g. VMware-tools-windows-9.4.11-2400950.iso)

Mouse Driver (32 Bit) - http://packages.vmware.com/tools/esx/latest/windows/x86/index.html (e.g. VMware-tools-windows-9.4.11-2400950.iso)

Links

Tweaks - https://pve.proxmox.com/wiki/Performance_Tweaks

Thanks - https://pve.proxmox.com/wiki/Windows_7_guest_best_practices

Thanks - https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers#Choose_the_right_driver

Shut Down Stop The Virtual Machine
Shut down and Stop the VM using the GUI or command line.

GUI
Server View > Datacenter > Node > VM > Hardware > Hard Disk > Resize

COMMAND LINE
In this example, we will be increasing the first virtual hard disk sda from 20Gb to 68Gb.

Resize Virtual Hard Disk

Find out the name of the virtual machine and hard disk, using the GUI (shown above), for example 105 and sata0.

Now, you can resize the virtual disk...

qm resize 105 sata0 +48G

Resize Hard Disk Partition

Boot the VM with a live CD such as SystemRescueCD, and then use 'parted' to resize the partition (in our case partition #2)...

parted /dev/sda (parted) print (parted) resizepart 2 (parted) End? -1    <-- this is the magic to fill remaining space (parted) print (parted) quit

Check Hard Disk Filesystem (I)

e2fsck -f /dev/sda2

Resize Hard Disk Filesystem

resize2fs /dev/sda2

Check Hard Disk Filesystem (II)

e2fsck -f /dev/sda2

Poweroff The Virtual Machine

Now, you can shutdown the SystemRescueCD...

poweroff

START THE VIRTUAL MACHINE
Start the VM using the GUI or command line, login and check your disk size.

df -H

http://pve.proxmox.com/wiki/Resize_disks

http://pve.proxmox.com/wiki/Resizing_disks

HOWTO: Add CPU Frequency Scaling
aptitude install cpufrequtils

Thanks - https://wiki.debian.org/HowTo/CpuFrequencyScaling

From Proxmox RAW Image To VirtualBox Qcow
-rw-r--r-- 1 root root 20G 2015-02-18 12:54 disk-drive-sata0.raw -rw-r--r-- 1 root root 330 2015-02-18 12:51 qemu-server.conf

qemu-img convert -f raw -O qcow disk-drive-sata0.raw disk-drive-sata0.qcow

-rw-r--r-- 1 root root 9.8G 2015-02-20 11:03 disk-drive-sata0.qcow -rw-r--r-- 1 root root 20G 2015-02-18 12:54 disk-drive-sata0.raw -rw-r--r-- 1 root root 330 2015-02-18 12:51 qemu-server.conf

OVA IMAGE TO Qcow
http://www.jamescoyle.net/how-to/1218-upload-ova-to-proxmox-kvm

http://forum.proxmox.com/threads/9309-Convert-OVA-to-working-Proxmox-VM

HOWTO: Command Line Tools
https://pve.proxmox.com/wiki/Command_line_tools

Add A User Using Domain Based Authentication
pveum aclmod / -user joebloggs@DOMAIN -role PVEAuditor

Shell Script To List Status Of Virtual Machines
cd /etc/pve/nodes/ /qemu-server/ for FILE in *.conf do  VMID="${FILE%%.*}" echo -n "vm $VMID " /usr/sbin/qm status $VMID; done
 * 1) !/bin/bash

HOWTO: Change Cron Scheduled Backup Time
sudo nano /etc/pve/vzdump.cron

HOWTO: System Update
https://pve.proxmox.com/wiki/Downloads


 * Change DNS Server to modem

nano /etc/resolv.conf nameserver 192.168.0.1


 * Shut down all running Virtual Machines
 * Turn off Start at Boot for each Virtual Machine (using WebGUI) or...

nano /etc/pve/nodes/proxmox1/qemu-server/*.conf onboot: 1   <-- delete this line


 * Update system software...

screen -rd apt-get update apt-get check apt-get --download-only dist-upgrade apt-get --simulate dist-upgrade apt-get --quiet dist-upgrade (answer YES to Continuing Without Installing GRUB) grub-mkdevicemap -n grub-install /dev/sda grub-install /dev/sdb grub-install /dev/sdc update-grub update-initramfs -t -u sync touch /root/misc/system_updated (exit screen) reboot

Wiki
https://pve.proxmox.com/wiki/Main_Page

Forum
http://forum.proxmox.com/