@@ -76,52 +76,50 @@ and referenced from the `site` and `production` environments, e.g.:
7676 instances) it may be necessary to configure or proxy `chronyd` via an
7777 environment hook.
7878
79- - By default, the cookiecutter-provided OpenTofu configuration provisions a
80- volume named "$cluster_name-home" and attaches it to the control node. This
81- is used to persist the NFS-shared home directories when the control node is
82- re-built. In production environments it is undesirable to have this volume
83- deleted if the cluster is deleted. Therefore the volume should be manually
79+ - By default, the cookiecutter-provided OpenTofu configuration provisions two
80+ volumes and attaches them to the control node:
81+ - "$cluster_name-home" for NFS-shared home directories
82+ - "$cluster_name-state" for monitoring and Slurm data
83+ The volumes mean this data is persisted when the control node is rebuilt.
84+ However if the cluster is destroyed with `tofu destroy` then the volumes will
85+ also be deleted. This is undesirable for production environments and usually
86+ also for staging environments. Therefore the volumes should be manually
8487 created, e.g. via the CLI:
8588
86- openstack volume create --size 100 mycluster-home # size in GB
89+ openstack volume create --size 200 mycluster-home # size in GB
90+ openstack volume create --size 100 mycluster-state
8791
88- and OpenTofu configured to use that volume rather than managing one itself
89- by setting
92+ and OpenTofu configured to use those volumes instead of managing them itself
93+ by setting:
9094
9195 home_volume_provisioning = "attach"
96+ state_volume_provisioning = "attach"
9297
93- either for a specific environment in the cluster module block in
98+ either for a specific environment within the cluster module block in
9499 `environments/$ENV/tofu/main.tf`, or as the site default by changing the
95100 default in `environments/site/tofu/variables.tf`.
96101
97- For a development environment allowing OpenTofu to manage the volume using
98- the default value
99-
100- home_volume_provisioning = "manage"
101-
102- is usually appropriate, as it allows for multiple clusters to be created with
103- this environment.
102+ For a development environment allowing OpenTofu to manage the volumes using
103+ the default value of `"manage"` for those varibles is usually appropriate, as
104+ it allows for multiple clusters to be created with this environment.
104105
105106 If no home volume at all is required because the home directories are provided
106- by a parallel filesystem (e.g. manila) use
107+ by a parallel filesystem (e.g. manila) set
107108
108109 home_volume_provisioning = "none"
109110
110111 In this case the NFS share for home directories is automatically disabled.
111112
112- - By default, the cookiecutter-provided OpenTofu configuration provisions a
113- volume named "$cluster_name-state" and attaches it to the control node. This
114- is used to persist monitoring and Slurm data when the control node is re-built.
115- In production and staging environments it is undesirable to have this volume
116- deleted if the cluster is deleted. Therefore the volume should be manually
117- created, e.g. via the CLI:
113+ **NB:** To apply "attach" options to existing clusters, first remove the
114+ volume(s) from the tofu state, e.g.:
118115
119- openstack volume create --size 100 mycluster-state # size in GB
120-
121- and the `openstack_blockstorage_volume_v3.state` resource changed to a [data
122- resource](https://opentofu.org/docs/language/data-sources/). This ensures
123- that even if the cluster is deleted via `tofu destroy`, the volume will persist.
116+ tofu state list # find the volume(s)
117+ tofu state rm ' module.cluster.openstack_blockstorage_volume_v3.state[0]'
124118
119+ This leaves the volume itself intact, but means OpenTofu "forgets" it. Then
120+ set the "attach" options and run `tofu apply` again - this should show there
121+ are no changes planned.
122+
125123- Enable `etc_hosts` templating:
126124
127125 ```yaml
0 commit comments