Adressage fédéré : index d'instance (préfixe VMID + supernet)
Le VMID n'est plus codé 9CSNN en dur : il prend le préfixe d'un `index` déclaré en tête de plan/nomenclature.yml. Convention : supernet = 10.(index*10).0.0/16, VMID = index·CSNN. Permet à N écosystèmes de coexister sans collision (Chezlepro=1, Technolibre=2). Sans index → 9CSNN (rétro-compatible, bacs à sable en 172.19.x). deriveServeur JS mort retiré. Doc multi-instances.md mise à jour. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8cc5ce8112
commit
8029083536
4 changed files with 36 additions and 8 deletions
|
|
@ -3,6 +3,13 @@
|
|||
## 2026-06-30
|
||||
|
||||
### Ajouté
|
||||
- **Adressage fédéré : index d'instance.** Le VMID n'est plus codé `9CSNN` en dur :
|
||||
il prend le préfixe d'un `index` déclaré en tête de `plan/nomenclature.yml`
|
||||
(`{index}{catégorie}{service}{séq}`). Convention : `supernet = 10.(index×10).0.0/16`,
|
||||
`VMID = index·CSNN`. Permet à N écosystèmes de **coexister/s'interconnecter** sans
|
||||
collision (Chezlepro=1 → `10.10`/`1xxxx`, Technolibre=2 → `10.20`/`2xxxx`). Sans
|
||||
index → `9CSNN` (rétro-compatible ; bacs à sable, plages ad-hoc `172.19.x`).
|
||||
Code mort retiré (`deriveServeur` JS). Voir `docs/multi-instances.md`.
|
||||
- **Doc `docs/multi-instances.md`** : cadrage « un moteur, N écosystèmes » — l'instance
|
||||
comme dépôt autonome, la bascule, l'isolation, et le socle multi-tenant.
|
||||
- **Bascule d'instance (`make instance-utiliser NOM=…`).** Repointe le symlink
|
||||
|
|
|
|||
|
|
@ -88,6 +88,30 @@ moteur, isolé. C'est la base concrète de la **portabilité des tenants**.
|
|||
> (NetBox, AWX, un coffre type Vault HashiCorp) **à adopter aux seuils**, pas à
|
||||
> réimplémenter dans le moteur. Cf. [`positionnement.md`](positionnement.md).
|
||||
|
||||
## Adressage fédéré (index d'instance)
|
||||
|
||||
Pour que plusieurs écosystèmes **coexistent et puissent s'interconnecter** sans
|
||||
collision, chaque instance de production reçoit un **index** (déclaré en tête de
|
||||
`plan/nomenclature.yml` : `index: N`). Il pilote :
|
||||
|
||||
- le **supernet** : `10.(index × 10).0.0/16` (zéro chevauchement) ;
|
||||
- le **préfixe VMID** : `index·catégorie·service·séq` (ex. `21101`) au lieu du `9` fixe.
|
||||
|
||||
| Instance | index | Supernet | VMID |
|
||||
| --- | --- | --- | --- |
|
||||
| Chezlepro | 1 | `10.10.0.0/16` | `1CSNN` |
|
||||
| Technolibre | 2 | `10.20.0.0/16` | `2CSNN` |
|
||||
| … | N | `10.(N×10).0.0/16` | `N·CSNN` |
|
||||
| Bacs à sable | *(aucun)* | `172.19.x` ad-hoc | `9CSNN` (défaut) |
|
||||
|
||||
Sans `index` déclaré, on retombe sur `9CSNN` (rétro-compatible) : c'est ce qu'utilisent
|
||||
les **bacs à sable**, qui vivent hors fédération (plages jetables `172.19.x`) et n'ont
|
||||
pas vocation à s'interconnecter.
|
||||
|
||||
Plafond : un index à 1 chiffre = **9 écosystèmes** prod fédérés (VMID à 5 chiffres) ;
|
||||
élargir l'index pour davantage. Au-delà d'une poignée d'instances co-localisées, confier
|
||||
l'allocation à un **IPAM** (NetBox) plutôt qu'au moteur — cf. `positionnement.md`.
|
||||
|
||||
## Voir aussi
|
||||
- [`meta-classe.md`](meta-classe.md) — le plan d'une instance instancie sa flotte.
|
||||
- [`config-proxmox.md`](config-proxmox.md) — voûte unique + cible Proxmox par instance.
|
||||
|
|
|
|||
|
|
@ -1231,13 +1231,6 @@ HTML = r"""<!doctype html>
|
|||
serveursModifie = false;
|
||||
}
|
||||
|
||||
function deriveServeur(nom, fonction) {
|
||||
const info = infoFonction(fonction);
|
||||
const seq = fonctionDe(nom).seq;
|
||||
if (!info || seq == null) return {vmid: '?', ip: '?', vlan: '?'};
|
||||
const base3 = info.sous_reseau.split('.').slice(0, 3).join('.');
|
||||
return {vmid: '9' + info.categorie + info.service + String(seq).padStart(2, '0'), ip: base3 + '.' + (info.service * 10 + seq), vlan: String(info.vlan)};
|
||||
}
|
||||
|
||||
function marquerServeursModifie() { serveursModifie = true; majIndicateurSauvegarde(); }
|
||||
function choisirServeur(i) { selServeur = i; dessiner(); }
|
||||
|
|
|
|||
|
|
@ -321,8 +321,12 @@ def deriver_nomenclature(fonction: str, seq: int, nomenclature: dict) -> dict |
|
|||
if not c:
|
||||
return None
|
||||
base3 = ".".join(str(c.get("sous_reseau", "")).split(".")[:3])
|
||||
# Prefixe VMID = index d'instance (federation multi-ecosystemes). Defaut 9 :
|
||||
# retro-compatible (instances sans index, bacs a sable). 1 chiffre -> 9 instances
|
||||
# prod federables avec un VMID a 5 chiffres ; elargir l'index pour davantage.
|
||||
index = nomenclature.get("index", 9)
|
||||
return {
|
||||
"vmid": f"9{cat}{svc}{int(seq):02d}",
|
||||
"vmid": f"{index}{cat}{svc}{int(seq):02d}",
|
||||
"vlan": c.get("vlan"),
|
||||
"adresse_ip": f"{base3}.{svc * 10 + int(seq)}",
|
||||
"passerelle": c.get("passerelle"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue