diff --git a/meta/io.murano/Classes/resources/Instance.yaml b/meta/io.murano/Classes/resources/Instance.yaml index a6680d3f..6ae243f0 100644 --- a/meta/io.murano/Classes/resources/Instance.yaml +++ b/meta/io.murano/Classes/resources/Instance.yaml @@ -103,7 +103,7 @@ Methods: Body: $.sharedIps: $ips - deploy: + beginDeploy: Body: - $.validateBootSource() - $securityGroupName: coalesce( @@ -162,6 +162,9 @@ Methods: # Any additional template preparation - $.instanceTemplate: $.prepareStackTemplate($.instanceTemplate) - $.environment.stack.updateTemplate($.instanceTemplate) + + endDeploy: + Body: - $.environment.stack.push() - $outputs: $.environment.stack.output() - $.ipAddresses: $outputs.get(format('{0}-assigned-ips', $this.name)).values().flatten().distinct() @@ -173,6 +176,11 @@ Methods: Then: $.setAttr(fipAssigned, true) - $.environment.instanceNotifier.trackCloudInstance($this) + deploy: + Body: + - $this.beginDeploy() + - $this.endDeploy() + detectPrimaryNetwork: Body: - $._primaryNetwork: null @@ -283,7 +291,7 @@ Methods: device_type: $blockDevice.deviceType boot_index: $blockDevice.bootIndex - releaseResources: + beginReleaseResources: Body: - $template: $.environment.stack.current() - If: bool($template.resources) and bool($template.outputs) @@ -301,6 +309,12 @@ Methods: - $template.outputs: $template.outputs.deleteAll($outputsToDelete) - $.environment.stack.setTemplate($template) + + endReleaseResources: + Body: + - $template: $.environment.stack.current() + - If: bool($template.resources) and bool($template.outputs) + Then: - $.environment.stack.push() - $.setAttr(instanceResources, []) - $.setAttr(instanceOutputs, []) @@ -309,6 +323,11 @@ Methods: - $.ipAddresses: [] - $.floatingIpAddress: null + releaseResources: + Body: + - $this.beginReleaseResources() + - $this.endReleaseResources() + validateBootSource: Body: - If: $.image = null and len($.blockDevices) = 0 @@ -347,4 +366,4 @@ Methods: getRef: Body: Return: - get_resource: $.name \ No newline at end of file + get_resource: $.name diff --git a/releasenotes/notes/two-phase-instance-deploy-81d37e7987abc792.yaml b/releasenotes/notes/two-phase-instance-deploy-81d37e7987abc792.yaml new file mode 100644 index 00000000..97591dd7 --- /dev/null +++ b/releasenotes/notes/two-phase-instance-deploy-81d37e7987abc792.yaml @@ -0,0 +1,6 @@ +--- +features: + - > + Instance.deploy() can now be split into two phases: beginDeploy() and + endDeploy(). This allows the application developer to provision multiple + instances at once without the need to push the stack for each instance.