Skip to content

Allow registering replica-first-boot scripts#448

Open
petrutlucian94 wants to merge 1 commit into
cloudbase:masterfrom
petrutlucian94:firstboot_phase
Open

Allow registering replica-first-boot scripts#448
petrutlucian94 wants to merge 1 commit into
cloudbase:masterfrom
petrutlucian94:firstboot_phase

Conversation

@petrutlucian94
Copy link
Copy Markdown
Member

We've recently extended the Coriolis API to allow specifying when a given user script should be executed. We currently support the following phases:

  • osmorphing_pre_os_mount
  • osmorphing_post_os_mount

For convenience, we'll also add the following phase:

  • replica_first_boot

These scripts will be executed when the replica VM boots for the first time. We'll inject them during os-morphing. As you may have noticed, the user can already do this but it's quite inconvenient to pass a script that injects another first-boot script.

We'll rely on systemd on Linux and cloudbase-init on Windows. All the Linux distributions that we support have switched to Systemd about 10 years ago. Also, as per this commit [1], we rely on the fact that cloudbase-init will be available all the time and that we can use it to run first-boot scripts.

Note that we did consider using scheduled tasks on Windows (as opposed to Cloudbase-init). We'd need to use an xml task definition and register it using registry keys, however it seems like we lack the privileges to create entries such as the following:

$HIVE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\$TaskGUID"

[1] b5f93fd

We've recently extended the Coriolis API to allow specifying *when*
a given user script should be executed. We currently support the
following phases:

* osmorphing_pre_os_mount
* osmorphing_post_os_mount

For convenience, we'll also add the following phase:

* replica_first_boot

These scripts will be executed when the replica VM boots for the
first time. We'll inject them during os-morphing. As you may have
noticed, the user can already do this but it's quite inconvenient
to pass a script that injects another first-boot script.

We'll rely on systemd on Linux and cloudbase-init on Windows.
All the Linux distributions that we support have switched to Systemd
about 10 years ago. Also, as per this commit [1], we rely on the
fact that cloudbase-init will be available all the time and that
we can use it to run first-boot scripts.

Note that we did consider using scheduled tasks on Windows
(as opposed to Cloudbase-init). We'd need to use an xml task definition
and register it using registry keys, however it seems like we lack the
privileges to create entries such as the following:

```
$HIVE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\$TaskGUID"
```

[1] cloudbase@b5f93fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant