Blame
|
1 | #### Si vous avez des problemes pour vous connecter à une console VNC |
||||||
|
2 | |||||||
| 3 | L'erreur en "permission denied" générale quand vous essaye de lancer une console est liée à l'impossibilité du node depuis lequel vous vous connectez vers la vm située sur un autre node |
|||||||
| 4 | ||||||||
| 5 | Il faut être certain de pouvoir SSH directement les comptes admin de chaque node sans utiliser de mot de passe via la clef privée du compte root. Est-ce que le host depuis lequel vous vous connectez peut ssh vers l'autre machine sur laquelle se trouve la VM directement sans password ? |
|||||||
| 6 | (sa clef publique se trouve dans authorized\_keys du host cible ou pas ?) |
|||||||
| 7 | ||||||||
|
8 | #### Ajouter une connexion VNC directe et temporaire sur une VM s'executant sur le serveur : |
||||||
| 9 | Ajouter ou modifier la ligne dans le fichier de conf de la vm : /pve/qemu-server/numero-de-vm.conf |
|||||||
| 10 | Cette ligne, args: -vnc 0.0.0.0:displayvnc,password=off |
|||||||
| 11 | displayvnc = par exemple 3, dans ce cas, le port VNC a ouvrir est serveur-proxmox:5903 |
|||||||
| 12 | ||||||||
|
13 | #### Ajouter un sous-volume sous zfs |
||||||
| 14 | ||||||||
| 15 | ```shell |
|||||||
| 16 | zfs create pool/volume-xxxx |
|||||||
| 17 | ``` |
|||||||
| 18 | Ensuite aller ajouter dans la gui le nouveau sous volume zfs pool/volume-xxx pour l'utiliser |
|||||||
| 19 | ||||||||
| 20 | #### Passer en mode community (pas de souscription) : |
|||||||
| 21 | remplacer le repo off par : deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription |
|||||||
| 22 | ||||||||
| 23 | #### Import VM, avec qm : |
|||||||
| 24 | ```shell |
|||||||
| 25 | qm importovf 100 /mnt/pve/xenon-proxmox-vol/ovf/vcsa.ovf xenon-proxmox-vol |
|||||||
| 26 | ``` |
|||||||
| 27 | ||||||||
| 28 | #### Utiliser le processeur physique en natif (host) : |
|||||||
| 29 | ```shell |
|||||||
| 30 | qm set 100 --cpu host |
|||||||
| 31 | ``` |
|||||||
| 32 | ||||||||
| 33 | #### Supprimer un cluster : |
|||||||
| 34 | ```shell |
|||||||
| 35 | systemctl stop pve-cluster corosync |
|||||||
| 36 | pmxcfs -l |
|||||||
| 37 | rm /etc/corosync/* |
|||||||
| 38 | rm -r /etc/pve/corosync.conf |
|||||||
| 39 | killall pmxcfs |
|||||||
| 40 | systemctl start pve-cluster |
|||||||
| 41 | ``` |
|||||||
| 42 | ||||||||
| 43 | #### Supprimer un noeud d'un cluster : |
|||||||
| 44 | Lister les neuds présents dans un cluster |
|||||||
| 45 | ```shell |
|||||||
| 46 | pvecm nodes |
|||||||
| 47 | ``` |
|||||||
| 48 | Supprimer un host au sein d'un cluster |
|||||||
| 49 | ```shell |
|||||||
| 50 | pvecm delnode <host> |
|||||||
| 51 | ``` |
|||||||
| 52 | Ensuite supprimer le répertoire /etc/pve/nodes/host |
|||||||
| 53 | ```shell |
|||||||
| 54 | rm -r /etc/pve/nodes/<host> |
|||||||
| 55 | ``` |
|||||||
| 56 | #### Changer le poids des host dans un cluster : |
|||||||
| 57 | > changer ça dans /etc/pve/corosync.conf (avec précaution) |
|||||||
| 58 | ||||||||
| 59 | ```xml |
|||||||
| 60 | nodelist { |
|||||||
| 61 | node { |
|||||||
| 62 | name: lancelot |
|||||||
| 63 | nodeid: 1 |
|||||||
| 64 | quorum_votes: 2 |
|||||||
| 65 | ring0_addr: 172.16.16.7 |
|||||||
| 66 | } |
|||||||
| 67 | node { |
|||||||
| 68 | name: perceval |
|||||||
| 69 | nodeid: 2 |
|||||||
| 70 | quorum_votes: 1 |
|||||||
| 71 | ring0_addr: 172.16.16.8 |
|||||||
| 72 | } |
|||||||
| 73 | } |
|||||||
| 74 | quorum { |
|||||||
| 75 | provider: corosync_votequorum |
|||||||
| 76 | } |
|||||||
| 77 | ||||||||
| 78 | totem { |
|||||||
| 79 | cluster_name: Kaamelott |
|||||||
| 80 | config_version: 3 |
|||||||
| 81 | interface { |
|||||||
| 82 | linknumber: 0 |
|||||||
| 83 | } |
|||||||
| 84 | ip_version: ipv4-6 |
|||||||
| 85 | link_mode: passive |
|||||||
| 86 | secauth: on |
|||||||
| 87 | version: 2 |
|||||||
| 88 | } |
|||||||
| 89 | ``` |
|||||||
| 90 | ||||||||
| 91 | > verifier après avec un pvecm status |
|||||||
| 92 | ||||||||
| 93 | #### Divers : |
|||||||
| 94 | ```shell |
|||||||
| 95 | qm rescan : rescanner des disk non utilisés sur les LVM |
|||||||
| 96 | qm importdisk 100 /path/to/your/freebsd/image.raw nvme1-vg |
|||||||
| 97 | ``` |
|||||||
| 98 | #### export TrueNAS : |
|||||||
| 99 | ```shell |
|||||||
| 100 | dd if=/dev/zvol/naspool1/rousseliere-y38mkr bs=32768 status=progress of=/mnt/naspool0/share/Temp/test.dd.raw |
|||||||
| 101 | ``` |
|||||||
| 102 | #### restore VM : |
|||||||
| 103 | ```shell |
|||||||
| 104 | zstd -q -d -c /mnt/pve/backups1-panzer/dump/vzdump-qemu-103-2022_12_22-04_28_36.vma.zst | vma extract -v -r /var/tmp/vzdumptmp389993.fifo - /var/tmp/vzdumptmp389993 |
|||||||
| 105 | ``` |
|||||||
| 106 | #### Creer une VM cloud-init |
|||||||
| 107 | Debian : https://cloud.debian.org/images/cloud/ |
|||||||
| 108 | ```shell |
|||||||
| 109 | ||||||||
|
110 | qm importdisk 10000 debian-13-generic-amd64.qcow2 zfs |
||||||
| 111 | qm set 10000 --scsihw virtio-scsi-pci --scsi0 zfs:vm-10000-disk-0 |
|||||||
| 112 | qm resize 10000 scsi0 15G |
|||||||
| 113 | qm set 10000 --ide2 zfs:cloudinit |
|||||||
| 114 | qm set 10000 --agent enabled=1 |
|||||||
| 115 | qm set 10000 --boot c --bootdisk scsi0 |
|||||||
| 116 | qm set 10000 --serial0 socket --vga serial0 |
|||||||
| 117 | qm set 10000 --ipconfig0 ip=dhcp |
|||||||
| 118 | qm template 10000 |
|||||||
|
119 | ``` |
||||||
|
120 | > Install de cloud init resize automatiquement le disk0 |
||||||
|
121 | |||||||
| 122 | #### Reset cloud-init : |
|||||||
| 123 | ```shell |
|||||||
| 124 | cloud-init clean --logs |
|||||||
| 125 | cloud-init init --localcloud-init modules --mode=config |
|||||||
| 126 | cloud-init modules --mode=final |
|||||||
| 127 | ``` |
|||||||
| 128 | ||||||||
| 129 | #### Network/Interfaces : |
|||||||
| 130 | ```shell |
|||||||
| 131 | # network interface settings; autogenerated |
|||||||
| 132 | # Please do NOT modify this file directly, unless you know what |
|||||||
| 133 | # you're doing. |
|||||||
| 134 | # |
|||||||
| 135 | # If you want to manage parts of the network configuration manually, |
|||||||
| 136 | # please utilize the 'source' or 'source-directory' directives to do |
|||||||
| 137 | # so. |
|||||||
| 138 | # PVE will preserve these directives, but will NOT read its network |
|||||||
| 139 | # configuration from sourced files, so do not attempt to move any of |
|||||||
| 140 | # the PVE managed interfaces into external files! |
|||||||
| 141 | ||||||||
| 142 | auto lo |
|||||||
| 143 | iface lo inet loopback |
|||||||
| 144 | ||||||||
| 145 | iface enp2s0 inet manual |
|||||||
| 146 | ||||||||
| 147 | iface enp0s31f6 inet manual |
|||||||
| 148 | ||||||||
| 149 | auto vmbr0 |
|||||||
| 150 | iface vmbr0 inet static |
|||||||
| 151 | bridge-ports enp3s0 |
|||||||
| 152 | bridge-stp off |
|||||||
| 153 | bridge-fd 0 |
|||||||
| 154 | bridge-vlan-aware yes |
|||||||
| 155 | bridge-vids 2-4094 |
|||||||
| 156 | ||||||||
| 157 | auto vmbr0.1 |
|||||||
| 158 | iface vmbr0.1 inet static |
|||||||
| 159 | address 172.16.16.7/24 |
|||||||
| 160 | gateway 172.16.16.230 |
|||||||
| 161 | ||||||||
| 162 | iface vmbr0.1 inet6 dhcp |
|||||||
| 163 | ``` |
|||||||
| 164 | ||||||||
| 165 | #### Export image en qcow : |
|||||||
| 166 | ```shell |
|||||||
| 167 | pvesm path local-lvm:vm-101-disk-0 |
|||||||
| 168 | /dev/pve/vm-101-disk-0 |
|||||||
| 169 | ``` |
|||||||
