Blame

321130 Cédric 2025-12-23 17:55:11 1
#### Ajouter un sous-volume sous zfs
2
3
```shell
4
zfs create pool/volume-xxxx
5
```
6
Ensuite aller ajouter dans la gui le nouveau sous volume zfs pool/volume-xxx pour l'utiliser
7
8
#### Passer en mode community (pas de souscription) :
9
remplacer le repo off par : deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
10
11
#### Import VM, avec qm :
12
```shell
13
qm importovf 100 /mnt/pve/xenon-proxmox-vol/ovf/vcsa.ovf xenon-proxmox-vol
14
```
15
16
#### Utiliser le processeur physique en natif (host) :
17
```shell
18
qm set 100 --cpu host
19
```
20
21
#### Supprimer un cluster :
22
```shell
23
systemctl stop pve-cluster corosync
24
pmxcfs -l
25
rm /etc/corosync/*
26
rm -r /etc/pve/corosync.conf
27
killall pmxcfs
28
systemctl start pve-cluster
29
```
30
31
#### Supprimer un noeud d'un cluster :
32
Lister les neuds présents dans un cluster
33
```shell
34
pvecm nodes
35
```
36
Supprimer un host au sein d'un cluster
37
```shell
38
pvecm delnode <host>
39
```
40
Ensuite supprimer le répertoire /etc/pve/nodes/host
41
```shell
42
rm -r /etc/pve/nodes/<host>
43
```
44
#### Changer le poids des host dans un cluster :
45
> changer ça dans /etc/pve/corosync.conf (avec précaution)
46
47
```xml
48
nodelist {
49
node {
50
name: lancelot
51
nodeid: 1
52
quorum_votes: 2
53
ring0_addr: 172.16.16.7
54
}
55
node {
56
name: perceval
57
nodeid: 2
58
quorum_votes: 1
59
ring0_addr: 172.16.16.8
60
}
61
}
62
quorum {
63
provider: corosync_votequorum
64
}
65
66
totem {
67
cluster_name: Kaamelott
68
config_version: 3
69
interface {
70
linknumber: 0
71
}
72
ip_version: ipv4-6
73
link_mode: passive
74
secauth: on
75
version: 2
76
}
77
```
78
79
> verifier après avec un pvecm status
80
81
#### Divers :
82
```shell
83
qm rescan : rescanner des disk non utilisés sur les LVM
84
qm importdisk 100 /path/to/your/freebsd/image.raw nvme1-vg
85
```
86
#### export TrueNAS :
87
```shell
88
dd if=/dev/zvol/naspool1/rousseliere-y38mkr bs=32768 status=progress of=/mnt/naspool0/share/Temp/test.dd.raw
89
```
90
#### restore VM :
91
```shell
92
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
93
```
94
#### Creer une VM cloud-init
95
Debian : https://cloud.debian.org/images/cloud/
96
```shell
97
qm create 1000 --name "debian-11" --memory 2048 --cores 2 --net0 virtio,bridge=vmbr0,tag=200
98
qm importdisk 1000 isos-images-pegasus/debian-11-generic-amd64-20230124-1270.qcow2 zfs0-lancelot
99
qm set 1000 --scsihw virtio-scsi-pci --scsi0 zfs0-lancelot:vm-1000-disk-0qm set 1000 --ide2 zfs0-lancelot:cloudinit
100
101
qm set 1000 --boot c --bootdisk scsi0
102
qm set 1000 --serial0 socket --vga serial0
103
```
104
> Install de cloud init resize automatiquement le disk0 (suffit d'augmenter la taille du disk)
105
106
#### Reset cloud-init :
107
```shell
108
cloud-init clean --logs
109
cloud-init init --localcloud-init modules --mode=config
110
cloud-init modules --mode=final
111
```
112
113
#### Network/Interfaces :
114
```shell
115
# network interface settings; autogenerated
116
# Please do NOT modify this file directly, unless you know what
117
# you're doing.
118
#
119
# If you want to manage parts of the network configuration manually,
120
# please utilize the 'source' or 'source-directory' directives to do
121
# so.
122
# PVE will preserve these directives, but will NOT read its network
123
# configuration from sourced files, so do not attempt to move any of
124
# the PVE managed interfaces into external files!
125
126
auto lo
127
iface lo inet loopback
128
129
iface enp2s0 inet manual
130
131
iface enp0s31f6 inet manual
132
133
auto vmbr0
134
iface vmbr0 inet static
135
bridge-ports enp3s0
136
bridge-stp off
137
bridge-fd 0
138
bridge-vlan-aware yes
139
bridge-vids 2-4094
140
141
auto vmbr0.1
142
iface vmbr0.1 inet static
143
address 172.16.16.7/24
144
gateway 172.16.16.230
145
146
iface vmbr0.1 inet6 dhcp
147
```
148
149
#### Export image en qcow :
150
```shell
151
pvesm path local-lvm:vm-101-disk-0
152
/dev/pve/vm-101-disk-0
153
```