This repository was archived by the owner on Aug 3, 2021. It is now read-only.
Support instant provisioning from VM templates #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this change instant provisiong of VMs from the template would not work. This affected the "Quick Create" button in XenCenter or any other programmatic use of the clone, provision, start API calls. This change matches the actions taken when converting to template with XenCenter.
Adding
instant
to other config comes directly from XenCenter: https://github.com/xenserver/xenadmin/blob/92b3dc839524497168305a9c3e8f77a37536ec16/XenAdmin/Commands/ConvertVMToTemplateCommand.cs#L82I can't remember exactly how I figured out to remove the
disks
XML from other config as well as it was difficult to follow the xen-api OCaml code. IIRC I saw the difference by comparing output fromxe
between a Packer produced template and one converted from a VM using XenCenter. The only decent reference to what the disks XML is that I could find was https://github.com/xapi-project/xen-api/blob/fe3dacf19fa179dbe4aae57c1b4e83e8dfab52bc/scripts/examples/python/provision.py#L16-L19 which also suggests that templates created from an actual VM wouldn't have it.