Proxmox: Unterschied zwischen den Versionen

Aus xinux.net
Zur Navigation springen Zur Suche springen
(21 dazwischenliegende Versionen von 5 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
=Infos - Hostsystem=
+
*[[proxmox old]]
 
+
*[[proxmox cluster]]
[[Datei:proxmox.jpg|1050px]]
+
*[[proxmox iscsi over zfs with freenas]]
 
+
*[[proxmox cloud-init]]
* über die URL: https://HOST-IP:8006/ kann man auf das Webinterface zugreifen.
+
=Bugs=
 
+
*[[Proxmox Low performance with Intel NIC with heavy udp traffic]]
* Die klassische Ansicht zeigt links die Server/VM-Liste und in der Mitte die verschiedenen Monitore/Parameter sowie Einstellungsmöglichkeiten.
 
 
 
* unten befindet sich der Serverlog, welcher die aktuellen Prozesse/Aufgaben anzeigt.
 
 
 
==Neue VM anlegen/löschen==
 
 
 
: '''1.''' Man klickt den Knotenpunkt an
 
: '''2.''' Auf den "Erstelle VM"-Button oben rechts klicken
 
: '''3.''' Die jeweiligen Spezifikationen eintragen
 
 
 
[[Datei:proxmox2.jpg]]
 
 
 
: '''4.''' VM wird normalerweise automatisch danach gestartet, wenn nicht -> starten!
 
: '''5.''' Die VM in der Hostliste links auswählen und danach auf "Konsole" oben rechts klicken. (dafür muss Java installiert sein, siehe Troubleshoot)
 
: '''6.''' Nun seht ihr ein neues Browserfenster, mit der grafischen Ausgabe der VM.
 
 
 
[[Datei:proxmox3.jpg|700px]]
 
 
 
: '''7.''' Fertig installieren.
 
: '''8.''' VM herunterfahren
 
: '''9.''' Vm anklicken, Optionen auswählen, Bootreihenfolge per Doppelklick anpassen!
 
 
 
[[Datei:proxmox5.jpg|700px]]
 
 
 
: '''10.''' anwählen der VM, und einen Klick auf "Entfernen" oben rechts, führt zum löschen der VM
 
 
 
==Storage über webinterface==
 
 
 
: '''1.''' "Rechenzentrum" anwählen
 
: '''2.''' zum Reiter "Storage" wechseln
 
: '''3.''' "Hinzufügen/entfernen/Bearbeiten" nach belieben drücken
 
 
 
'''Beispiel hier: NFS'''
 
[[Datei:proxmox6.jpg]]
 
 
 
 
 
: '''4.''' Wählt euer Storagetyp (NFS/iSCSI/Directory/etc...)
 
: '''5.''' Wählt bei Inhalt '''alles''' aus und setzt "Max Backups" nach oben. (Dieser Parameter gibt die maximale Anzahl an mlgichen Backups auf dem Speicher an.)
 
 
 
[[Datei:proxmox7.jpg]]
 
 
 
: YT-Video: http://www.youtube.com/watch?v=kHyf_l1Q1ow
 
 
 
===Storage über Konsole mounten===
 
====template/isos====
 
cd /var/lib/vz
 
rm -r iso/ && ln -s /mnt/MOUNTPUNKFÜRDEINEISOS/ iso
 
====bestehende VMs====
 
cd /var/lib/vz
 
rm -r images/ && ln -s /mnt/MOUNTPUNKFÜRDEINEVMS/ images
 
 
 
Danach müssen noch die confs kopiert werden.
 
 
 
/etc/pve/qemu-server/ vom originalsystem kopieren oder auch mounten
 
cd /etc/pve/
 
rm -r qemu-server/ && ln -s /mnt/MOUNTPUNKFÜRDEINEVMCONFS/ qemu-server
 
 
 
'''ACHTUNG: wenn die confs kopiert werden, müssen die Pfadangaben überarbeitet werden!'''
 
 
 
==Migration==
 
 
 
Rechtsklick auf die VM und "Migration" auswählen, dazu muss ein weiterer Knoten bekannt sein. (Knoten = ProxmoxVE-Host)
 
: YT-Video: http://www.youtube.com/watch?v=AkimEEHArqg
 
 
 
===Image einfügen===
 
 
 
1. auf dem Host System das gewünscht Image (raw/.img) hinterlegen
 
 
 
2. eine neue VM anlegen und den gewünschten Typ anlegen! (qcow2/raw/vmdk)
 
 
 
3. Bei Bedarf das Image konvertieren:
 
qemu-img -f raw -O qcow2 input.img output.qcow2
 
 
 
4. Das Image mit dem erstellen Datenspeicher ersetzen:
 
cp input.img ../"VM-ID"/vm-"VM-ID"-disk-1.qcow2
 
Beispiel: cp input.img ../101/vm-101-disk-1.qcow2
 
 
 
5. vm starten
 
 
 
: Link: http://agix.com.au/blog/?p=2696
 
 
 
 
 
=== Storage einfügen ===
 
 
 
==Backup==
 
 
 
Grundsätzlich gibt es 3 Arten, eine VM zu backupen.
 
 
 
: '''1.''' stop-mode (Da wird die VM komplett heruntergefahren. lange downtime)
 
: '''2.''' suspend-mode (VM wird in den Ruhemodus versetzt. kurze Downtime)
 
: '''3.''' snapshot-mode (VM bleibt aktiv beim Backup)
 
===webinterface===
 
====Backup erstellen====
 
 
 
: '''1.''' VM anwählen
 
: '''2.''' zum Reiter "Backup" wechseln
 
: '''3.''' "Backup starten" auswählen
 
: '''4.''' Kompression, Storage und mode angeben
 
 
 
[[Datei:proxmox8.jpg]]
 
 
 
: '''5.''' Wenn das Backup fertig ist, seht ihr nun einen Eintrag in der "Backup-Liste" '''(Beispiel hier: VM: -101 seven-)'''
 
: '''(eventuell noch den Storage oben rechts anpassen...
 
'''
 
[[Datei:proxmox9.jpg]]
 
 
 
====Backup aufspielen====
 
 
 
: '''oben rechts euer Backup-Storage auswählen!'''
 
 
 
: '''1.''' In der Hostleiste links, muss das Backupverzeichnis geöffnet werden
 
: '''2.''' Danach auf den Reiter "Inhalt" wechseln
 
: '''3.''' Hier ist eine Liste mit Images/Backups/Snapshots/etc. zu sehen
 
 
 
[[Datei:proxmox10.jpg]]
 
 
 
: '''4.''' Backup anwählen, und zurückspieln
 
 
 
====Snapshot live====
 
 
 
=====erstellen=====
 
 
 
: '''1.''' VM anwählen
 
: '''2.''' zum Reiter "Snapshots" wechseln
 
: '''3.''' "Snapshot erstellen" auswählen
 
: '''4.''' Beschreibung und Name eingeben.
 
 
 
=====rollback=====
 
 
 
: '''1.''' VM anwählen
 
: '''2.''' zum Reiter "Snapshots" wechseln
 
: '''3.''' gewünschtes Snapshot auswählen
 
: '''4.''' "Rollback" drücken
 
 
 
 
 
===console===
 
====Backup erstellen====
 
 
 
: '''1.''' als root einloggen
 
: '''2.''' VM-ID der zu backupenden VM auswählen
 
: '''3.''' Kompression, Storage und mode angeben
 
: '''4.''' Backup erstellen:
 
 
vzdump $VMID --remove 0 --mode $MODE --compress $COMP --storage $STOR --node $HOSTSYSTEM
 
mode-usage: snapshot | stop | suspend
 
compress-usage: 0 | 1 | gzip | lzo (lzo is default)
 
storage: im webinterface kann man die gemounteten Storages einsehen
 
 
 
Beispiel:
 
vzdump 102 --remove 0 --mode stop --compress lzo --storage bucket-one --node moxxie
 
 
 
 
 
====Backup aufspielen====
 
 
 
: '''Das Backup auf dem Storage suchen. Bei mir wurde das Verzeichnis "dump" erstellt. (bucket-one ist hier der gemountete Speicher)'''
 
 
 
: '''1.'''  lzop -d -c /mnt/pve/bucket-one/dump/vzdump-qemu-102-2013_11_07-13_40_03.vma.lzo|vma extract -v -r /var/tmp/vzdumptmp161098.fifo - /var/tmp/vzdumptmp161098
 
: '''2.''' "zurückspielen"
 
: '''3.''' VM-ID und Storage auswählen
 
: '''4.''' (Das ist btw auch ein Weg die VM zu kopieren)
 
 
 
<!----
 
====Snapshot live====
 
 
 
=====erstellen=====
 
 
 
: '''1.''' VM anwählen
 
: '''2.''' zum Reiter "Snapshots" wechseln
 
: '''3.''' "Snapshot erstellen" auswählen
 
: '''4.''' Beschreibung und Name eingeben.
 
 
 
=====rollback=====
 
 
 
: '''1.''' VM anwählen
 
: '''2.''' zum Reiter "Snapshots" wechseln
 
: '''3.''' gewünschtes Snapshot auswählen
 
: '''4.''' "Rollback" drücken
 
------>
 
 
 
==Firewall==
 
Grundaufbau:
 
<pre>
 
### BEGIN INIT INFO
 
# Provides:            kmyfirewall
 
# Required-Start:      $all
 
# Required-Stop:        $all
 
# Default-Start:        2 3 4 5
 
# Default-Stop:        0 1 6
 
# Short-Description:    Start iptables firewall
 
# Description:          Enable iptables firewall rules from kmyfirewall
 
### END INIT INFO
 
 
 
#!/bin/bash
 
case $1 in
 
start)
 
echo "starte firewall"
 
;;
 
stop)
 
echo "stoppe firewall"
 
;;
 
esac
 
</pre>
 
 
 
Das ist eine Standard-Firewall mit 2 Interfaces
 
 
 
<pre>
 
### BEGIN INIT INFO
 
# Provides: kmyfirewall
 
# Required-Start: $all
 
# Required-Stop: $all
 
# Default-Start: 2 3 4 5
 
# Default-Stop: 0 1 6
 
# Short-Description: Start iptables firewall
 
# Description: Enable iptables firewall rules from kmyfirewall
 
### END INIT INFO
 
 
 
#!/bin/bash
 
WAN=vmbr0
 
INT=vmbr1
 
 
 
case $1 in
 
start)
 
echo "starte firewall"
 
 
 
echo "forward"
 
/bin/echo 1 > /proc/sys/net/ipv4/ip_forward
 
#ip_conntrack_ftp
 
#ip_conntrack
 
 
 
echo "flush"
 
iptables -F
 
iptables -t nat -F
 
iptables -t mangle -F
 
iptables -P INPUT DROP
 
iptables -P OUTPUT DROP
 
iptables -P FORWARD DROP
 
 
 
echo "e&r"
 
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
 
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
 
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
 
 
 
echo "lo"
 
iptables -A OUTPUT -o lo -j ACCEPT
 
iptables -A INPUT -i lo -j ACCEPT
 
 
 
echo "in/output WAN"
 
iptables -A OUTPUT -o $WAN -m state --state NEW -j ACCEPT #allesraus
 
iptables -A INPUT -i $WAN -p tcp --dport 53 -m state --state NEW -j ACCEPT #DNS
 
iptables -A INPUT -i $WAN -p icmp --icmp-type 8 -j ACCEPT #ping
 
iptables -A INPUT -i $WAN -p tcp --dport 8472 -m state --state NEW -j ACCEPT #SSH
 
iptables -A INPUT -i $WAN -p tcp --dport 80 -m state --state NEW -j ACCEPT #http
 
iptables -A INPUT -i $WAN -p tcp --dport 443 -m state --state NEW -j ACCEPT #https
 
iptables -A INPUT -i $WAN -p tcp --dport 8006 -m state --state NEW -j ACCEPT #WEBINTERFACE
 
iptables -A INPUT -i $WAN -p tcp --dport 5900:5999 -m state --state NEW -j ACCEPT #VNC-Portrange
 
iptables -A INPUT -i $WAN -p tcp --dport 3128 -m state --state NEW -j ACCEPT #SPICE
 
#iptables -A INPUT -i $WAN -p udp --dport 5404 -m state --state NEW -j ACCEPT #CMAN
 
#iptables -A INPUT -i $WAN -p udp --dport 5405 -m state --state NEW -j ACCEPT #CMAN
 
 
 
echo "in/out INT"
 
iptables -A INPUT -j ACCEPT -i $INT -m state --state NEW
 
iptables -A OUTPUT -j ACCEPT -o $INT -m state --state NEW
 
 
 
echo "forward"
 
iptables -A FORWARD -j ACCEPT -i $WAN -o $WAN -m state --state NEW
 
iptables -A FORWARD -j ACCEPT -i $WAN -o $INT -m state --state NEW
 
iptables -A FORWARD -j ACCEPT -o $WAN -i $INT -m state --state NEW
 
iptables -A FORWARD -j ACCEPT -i $INT -o $INT -m state --state NEW
 
 
 
echo "log"
 
iptables -A INPUT  -j LOG  --log-prefix "--iptables-in--"
 
iptables -A OUTPUT -j LOG  --log-prefix "--iptables-out--"
 
iptables -A FORWARD -j LOG --log-prefix "--iptables-for--"
 
 
 
;;
 
stop)
 
echo "stoppe firewall"
 
iptables -F
 
iptables -P INPUT ACCEPT
 
iptables -P OUTPUT ACCEPT
 
iptables -P FORWARD ACCEPT
 
;;
 
esac
 
</pre>
 
 
 
=Troubleshoot=
 
==bridge==
 
vi /etc/network/interfaces
 
 
 
Beispiel.conf:
 
<pre>
 
auto vmbr0
 
iface vmbr0 inet static
 
        address  192.168.240.187
 
        netmask  255.255.248.0
 
        gateway  192.168.240.100
 
        bridge_ports eth0
 
        bridge_stp off
 
        bridge_fd 0
 
</pre>
 
 
 
==VNC Ports umlegen==
 
===Für Proxmox /3.X2.X===
 
vi /usr/share/perl5/PVE/Tools.pm
 
 
 
Ändern von diesen Zeilen, (ca. Zeile 724)
 
<pre>
 
sub next_vnc_port {
 
    return next_unused_port(5900, 6000);
 
}
 
</pre>
 
 
 
in diese Zeilen: (gewünschte Ports eintragen[Bsp.: 6900-7000])
 
<pre>
 
sub next_vnc_port {
 
    return next_unused_port(6900, 7000);
 
}
 
</pre>
 
 
 
Das Proxmox-System muss neugestartet werden!
 
 
 
===Für Proxmox 1.X===
 
vi /usr/share/perl5/PVE/ConfigServer.pm
 
 
 
Ändern von dieser Zeile,
 
for (my $p = 5900; $p < 6000; $p++) {
 
 
 
in diese Zeile: (gewünschte Ports eintragen[Bsp.: 6900-7000])
 
for (my $p = 6900; $p < 7000; $p++) {
 
 
 
Das Proxmox-System muss neugestartet werden!
 
 
 
==USB pass through==
 
 
 
mit das device ermitteln
 
lsusb
 
 
 
Beispiel:
 
<pre>
 
root@moxxie:/var/log/vzdump# lsusb 
 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 
Bus 008 Device 002: ID 046d:c315 Logitech, Inc. Classic New Touch Keyboard
 
Bus 008 Device 003: ID 04d8:fa0d Microchip Technology, Inc.
 
root@moxxie:/var/log/vzdump#
 
</pre>
 
 
 
Wir suchen dieses Gerät und wollen es durchtunneln:
 
Bus 008 Device 003: ID 04d8:fa0d Microchip Technology, Inc.
 
 
 
danach das USBGerät durchtunneln
 
qm set $VMID -usb0 host=$VENDOR:$PRODID
 
 
 
Beispiel:
 
qm set 110 -usb0 host=04d8:fa0d
 
 
 
==Port list==
 
 
 
Web interface: 8006
 
VNC Web console: 5900-5999
 
SPICE console: 3128
 
SSH access (only optional): 22
 
CMAN multicast (if you run a cluster): 5404, 5405 UDP
 
 
 
==VM-Killen==
 
 
 
Mit SSH auf den Knoten/server connecten.
 
 
 
Danach mit '''"ps -elf | grep kvm"''' die VM suchen und mit "kill" töten...
 
 
 
==Validation entfernen==
 
backup the file:
 
cp /usr/share/pve-manager/ext4/pvemanagerlib.js /usr/share/pve-manager/ext4/pvemanagerlib.js_org
 
 
 
open the file
 
vi /usr/share/pve-manager/ext4/pvemanagerlib.js +454
 
 
 
change the line
 
if (data.status !== 'Active') {
 
 
 
to below:
 
if (false) {
 
 
 
==Manual: qm==
 
*http://pve.proxmox.com/wiki/Manual:_qm
 
 
 
==Java Konsole==
 
 
 
Laut Proxmox einfach updaten!
 
Stable version: '''7 Patch45 32bit @Windows7'''
 
 
 
*http://pve.proxmox.com/wiki/Java_Console_%28Ubuntu%29
 
 
 
==Install Proxmox VE on Debian Squeeze==
 
: http://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Squeeze
 
==Install Proxmox VE on Debian Wheezy==
 
: http://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Wheezy
 
 
 
==Hetzner Proxmox installieren==
 
: http://wiki.hetzner.de/index.php/Proxmox_VE#Netzwerkkonfiguration_KVM.2FBridged
 
 
 
==Konfigfiles==
 
/etc/pve/qemu-server/
 
==Isos==
 
/var/lib/vz/template/iso
 
 
 
=QM=
 
== listen der virtuellen maschinen ==
 
root@betor:~# qm list
 
      VMID NAME                STATUS    MEM(MB)    BOOTDISK(GB) PID     
 
      100 jello                running    4096              32.00 6942     
 
      101 seven                stopped    4096              32.00 0       
 
      102 icinga              stopped    1024              10.00 0       
 
      103 VM 103              stopped    0                  0.00 0       
 
      104 symantec            stopped    2048            250.00 0       
 
      108 icinga              stopped    1024              10.00 0
 
== starten der virtuellen maschinen ==
 
root@betor:~# qm start 101
 
== stoppen der virtuellen maschinen ==
 
root@betor:~# qm stop 101
 
== config der virtuellen maschinen auslesen ==
 
root@betor:~# qm config 101
 
boot: dcn
 
bootdisk: ide0
 
cores: 2
 
ide0: local:101/vm-101-disk-1.qcow2,format=qcow2,size=32G
 
ide2: none,media=cdrom
 
memory: 4096
 
name: seven
 
net0: e1000=2A:06:D1:86:82:37,bridge=vmbr0
 
ostype: win7
 
sockets: 2
 
== shutdown einer virtuellen maschine ==
 
root@betor:~# qm shutdown 101
 
== status einer virtuellen maschine anzeigen ==
 
root@betor:~# qm status 101
 
status: running
 
== virtuelle maschine erstellen ==
 
  qm create 115 --cdrom local:iso/ubuntu-6.06.1-desktop-i386.iso  --name ubuntu6 --net0 virtio=62:57:BC:A2:0E:18 \
 
    --ide0  local:115/vm-115-disk-1.qcow2,format=qcow2,size=20G    --ostype l26 --memory 512 --onboot no --sockets 2
 
 
 
== virtuelle maschine inklusive Volumes löschen==
 
qm destroy 115
 
 
 
==VM lock==
 
 
 
qm lock $VMID
 
qm unlock $VMID
 
 
 
=Proxmox ssl zertifikate =
 
 
 
cp /root/domain.host.de.key /etc/pve/local/pve-ssl.key
 
 
 
cp /root/host.domain.de.crt /etc/pve/local/pve-ssl.pem
 
 
 
cp /root/certauthority_root_bundle.crt /etc/pve/pve-root-ca.pem
 
 
 
systemctl restart pveproxy.service
 
 
 
==festplatte durchreichen==
 
*http://www.andysblog.de/proxmox-ve-festplatte-an-vm-durchreichen
 
 
 
=Tastenkombinationen unter Proxmox mit Windows-Taste eingeben=
 
*Um Tastenkombinationen unter Proxmox eingeben zu können für welche die Windowstaste benötigt werden, muss zunächst das Scrolllock unter Linux aktiviert werden. Danach lässt sich die Windowstaste ganz normal in der Konsole mit benutzen.
 
==Scroll Lock aktivieren==
 
*Das Scoll lock lässt sich mit folgendem Befehl aktivieren:
 
<pre>
 
xxxxxx@xxxxxx ~ $ sudo xmodmap -e 'add mod3 = Scroll_Lock'
 
</pre>
 
 
 
 
=Links=
 
=Links=
: Link für die cmd-Liste: http://pve.proxmox.com/wiki/Command_line_tools
+
*https://www.biteno.com/tutorial/proxmox-pve/
: Link für QM-manual: http://pve.proxmox.com/wiki/Qm_manual
 

Version vom 3. August 2020, 12:06 Uhr