Nomenclature : VLAN dérivé (index × 10 + zone) pour réseau convergé
Sur un trunk convergé (tenants partagent l'infra), les VLAN doivent être uniques GLOBALEMENT. deriver_nomenclature (ip-miroir) dérive VLAN = index×10 + zone : chaque tenant son bloc de 10, 1-9 réservés à l'infra partagée. Le VLAN contenant le tenant, le VMID mène avec le VLAN (VLAN·octet·seq, ≤ 9 chiffres Proxmox). compact (lab) inchangé. GUI (miroir) + validation 1-4094 : compatibles. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
a1cfe77b4a
commit
02bbba61b3
2 changed files with 16 additions and 2 deletions
|
|
@ -335,12 +335,18 @@ def deriver_nomenclature(fonction: str, seq: int, nomenclature: dict) -> dict |
|
|||
# index.categorie.service.sequence (largeur variable, VMID des instances existantes).
|
||||
schema = nomenclature.get("vmid_schema", "compact")
|
||||
if schema == "ip-miroir":
|
||||
vmid = f"{index}{int(c.get('vlan', 0)):03d}{hote:03d}{int(seq):02d}"
|
||||
# VLAN DERIVE : index x 10 + zone. Unique GLOBALEMENT sur un trunk convergE
|
||||
# (chaque tenant a son bloc de 10 ; 1-9 reserves a l'infra partagee). Le VLAN
|
||||
# contient deja le tenant (1er chiffre = index), donc le VMID MENE avec le VLAN
|
||||
# (pas de chiffre d'index separe) et tient dans les 9 chiffres max de Proxmox.
|
||||
vlan = index * 10 + int(cat)
|
||||
vmid = f"{vlan}{hote:03d}{int(seq):02d}"
|
||||
else:
|
||||
vlan = c.get("vlan")
|
||||
vmid = f"{index}{cat}{svc}{int(seq):02d}"
|
||||
return {
|
||||
"vmid": vmid,
|
||||
"vlan": c.get("vlan"),
|
||||
"vlan": vlan,
|
||||
"adresse_ip": f"{base3}.{hote}",
|
||||
"passerelle": c.get("passerelle"),
|
||||
"cidr": nomenclature.get("cidr_hote", 24),
|
||||
|
|
|
|||
Loading…
Reference in a new issue