-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CA-391880: Update related field 'groups' of VM when destroying VM group. #5573
CA-391880: Update related field 'groups' of VM when destroying VM group. #5573
Conversation
9ee4740
to
1b5a8a4
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In VM anti-affinity https://github.com/xapi-project/xen-api/pull/5546, there is many-many relation between VMs and VM groups. When changing the VM.groups manually, the VM_group.VMs will be updated automatically. But when removing a VM group, the VM.groups will not be updated automatically. This commit aims to update VM.groups for all VMs in a VM group when it is being removed.
Would you please add this as the description of the code commit? It will make the code commit more clear.
I didn't find a method to update it automatically. So I add some codes to update VM.groups when removing a group.
I think this is the required thing to do, as we can find the same for the other relationship:
((_pci, "attached_VMs"), (_vm, "attached_PCIs"))
vm is removed from pci.attached_VMs: Db.PCI.remove_attached_VMs
when needed, for example, when vm is destroyed.
In VM anti-affinity datamodel PR (xapi-project#5573), there is many-many relation between VMs and VM groups. When changing the VM.groups manually, the VM_group.VMs will be updated automatically. But when removing a VM group, the VM.groups will not be updated automatically. This commit aims to update VM.groups for all VMs in a VM group when it is being removed. Signed-off-by: Bengang Yuan <bengang.yuan@cloud.com>
1b5a8a4
to
2c920ed
Compare
81a05a0
into
xapi-project:feature/vm-anti-affinity
pytype_reporter extracted 50 problem reports from pytype output. You can check the results of the job here |
The |
In VM anti-affinity datamodel PR, there is many-many relation between VMs and VM groups. When changing the VM.groups manually, the VM_group.VMs will be updated automatically. But when removing a VM group, the VM.groups will not be updated automatically. This commit aims to update VM.groups for all VMs in a VM group when it is being removed.