A virtual machine might need to be fully initialized before proceeding with Cloud Assembly deployment.
For example, deploying a machine that is still installing packages and starting a web server might lead to conditions where a fast user tries to reach the application before it's available.
Be aware of the following considerations when using this feature.
- The feature makes use of the cloud-init phone_home module and is available when deploying Linux machines.
- Phone home isn't available for Windows because of Cloudbase-init limitations.
- Phone home can affect deployment order like an explicit dependency, but has more flexibility around timing and processing options.
See Creating bindings and dependencies between resources in Cloud Assembly.
- Phone home requires a cloudConfig section in the cloud template.
- Your creativity is a factor. Initialization commands might include embedded wait time between operations, which can be used in concert with phone home.
- Cloud template-based phone home won't work if the machine template already contains phone_home module settings.
- The machine must have outbound communication access back to Cloud Assembly.
To introduce a deployment delay in Cloud Assembly, add a
cloudConfigSettings section to the cloud template:
cloudConfigSettings: phoneHomeShouldWait: true phoneHomeTimeoutSeconds: 600 phoneHomeFailOnTimeout: true
|phoneHomeShouldWait||Whether to wait for initialization, true or false.|
|phoneHomeTimeoutSeconds||When to decide whether to proceed with deployment even though initialization is still running. Default is 10 minutes.|
|phoneHomeFailOnTimeout||Whether to proceed with deployment after timing out, true or false. Note that even when proceeding, deployment might still fail for separate reasons.|