mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 20:26:48 +00:00
feat(instances): a clone takes the size asked and starts if asked
A VM made from a template came out at the template's size and shut off, and was then resized and started by hand. The Clone tab now asks for the clone's vCPUs and memory, filled in with the VM's, and whether to start it. After the copy, before the clone is recorded, it is resized with the Resize tab's own functions and started; a step that fails is a warning of the job, and the clone stays. The quota counts the larger of the size asked and the VM's, so a resize that fails leaves the clone at a size it allowed. When the job ends the page opens the clone's, not the cloned VM's again: a template's page, shut off, read as a clone that had not started. An outcome kept for a warning links to it.
This commit is contained in:
parent
9aedb5b4d1
commit
8a809443a4
9 changed files with 423 additions and 233 deletions
|
|
@ -187,6 +187,11 @@ class Instance(models.Model):
|
|||
def config_cur_vcpu(self) -> int:
|
||||
return self.proxy.get_cur_vcpu(config=True)
|
||||
|
||||
@cached_property
|
||||
def config_memory(self) -> int:
|
||||
"""Memory (MiB) of the persistent definition, which a clone starts from."""
|
||||
return self.proxy.get_memory(config=True)
|
||||
|
||||
@cached_property
|
||||
def config_title(self) -> str:
|
||||
"""Title and description of the persistent definition, which the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue