Description
The Q release (v2.5) of the CloudControl API has introduced support for explicitly controlling the storage controllers in a deployed server.
Because the behaviour of disk management when using custom storage controllers diverges from the existing behaviour, storage controllers and their disks will be managed via a separate ddcloud_storage_controller
resource type:
resource "ddcloud_server" {
name = "My server"
// Disks can either be specified here (order now matters)
disk {
// SCSI unit Id can no longer be specified here
size_gb = 10
speed = "STANDARD"
}
}
resource "ddcloud_storage_controller" {
server = "${ddcloud_server.my_server.id}"
adapter_type = "LSI_LOGIC_PARALLEL"
bus_number = 1
// Or disks can be specified here (order does not matter)
disk {
scsi_unit_id = 0 // SCSI unit Id can now be specified here
size_gb = 10
speed = "STANDARD"
}
}
For a given ddcloud_server
, you can either specify disks the old way (inline, but without a SCSI unit Id) or with an explicit storage controller (but not both). Since disks specified the old way no longer have an explicit SCSI unit Id, their order now matters (i.e. you cannot have 3 disks and remove disk 2). Disks specified via the new way (with explicit storage controller) have an explicit SCSI unit Id and their order there does not matter.
These breaking API changes are expected to also require refactoring of the existing ddcloud_server
resource implementation due to changes in the format of information returned by v2.5 of the CloudControl API.
Note that it's theoretically possible to to support specifying disks and controllers in the same ddcloud_server
resource but this would greatly complicate the provider implementation for this resource type (disks with a value for controller_id
would have to be processed after any controller
entries, and Terraform may no longer be able to automatically warn the user about changes that force a new resource or are otherwise invalid).
See below for an alternative design proposal.
See also: