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

fix(computes): a bulk migration shows as one job on the host's page

The host's VM list showed every migration of a bulk migration as a job
of its own (each holds the host), and kept a card for each when it
ended: 20 VMs, 20 cards down the page. The migrations a bulk migration
starts now name it as their parent, and a page leaves out a job whose
parent is that page's own: the host page shows the bulk migration, with
how many of its VMs are done as its progress; each migration still
shows on its VM's page and the Jobs page. A page also shows the jobs it
is the page of, not only those holding it: the bulk migration holds no
claim on the host.
This commit is contained in:
catborise 2026-11-15 20:00:41 +03:00
parent 60c581e5e1
commit 25e3794cc9
6 changed files with 46 additions and 4 deletions

View file

@ -35,6 +35,8 @@ class Operation(models.Model):
client_ip = models.GenericIPAddressField(null=True) # of the submission, for the job's Logs rows
submission_key = models.CharField(max_length=64)
resource = models.CharField(max_length=255, db_index=True) # the page that shows the job
# the job that started this one (a bulk migration's migrations): its page shows that one only
parent = models.ForeignKey("self", null=True, on_delete=models.SET_NULL, related_name="children")
resource_label = models.CharField(max_length=255)
state = models.CharField(max_length=16, choices=STATES, default=QUEUED, db_index=True)
params = models.JSONField(default=dict)