1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 09:26:03 +00:00

feat(migration): encrypt migrations over TLS between hosts that have it

QEMU sends a migrating VM's memory and copied disks in the clear. A
compute gets "Encrypt migrations (TLS)" (edit page, Advanced; API
field migration_tls); a migration between two hosts that both have it
passes VIR_MIGRATE_TLS whenever data moves (not for a shut-off VM's
definition alone), and the log says TLS. The hosts need QEMU's
certificates in /etc/pki/qemu; a host without them refuses before
anything moves. Tried on two AlmaLinux 10 hosts: the TLS stream starts
with a TLS record, the plain one with QEMU's QEVM header.
This commit is contained in:
catborise 2026-11-19 15:19:18 +03:00
parent 2e3ffba851
commit eeae606d08
15 changed files with 409 additions and 309 deletions

View file

@ -4,7 +4,7 @@ from ipaddress import ip_address
from django.core.exceptions import ValidationError
from django.core.validators import MaxLengthValidator, RegexValidator
from django.db import IntegrityError, transaction
from django.db.models import CharField, DateTimeField, IntegerField, ManyToManyField, Model, Q, UniqueConstraint
from django.db.models import BooleanField, CharField, DateTimeField, IntegerField, ManyToManyField, Model, Q, UniqueConstraint
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
from django.utils.translation import gettext_noop
@ -69,6 +69,14 @@ class Compute(Model):
"empty: the address the panel reaches the host at"
),
)
migration_tls = BooleanField(
_("encrypt migrations (TLS)"),
default=False,
help_text=_(
"A VM migrating between two hosts that both have this sends its memory and disks over TLS; "
"each host needs QEMU's certificates in /etc/pki/qemu"
),
)
gstfsd_key = CharField(
_("gstfsd key"),
max_length=64,