-
Notifications
You must be signed in to change notification settings - Fork 8
Notes: Persistence (Local Storage)
Each disk is a physical hard drive or partition. BOSH / RackHD CPI will not manage partition for user. User cannot change the size of a disk.
VM_CID will be stored in metadata of RackHD as:
cid: "XYZ"
- If there is a
disk_cid
in the create_vm call, then the node withdisk.id
must be selected. If node withdisk.id
(disk_locality
) cannot be found, thecreate_vm
call errors out. - If there is no persistent disk locality passed in, select node with
disk_cid
andvm_cid
randomly and wipe data from SDB (if there is one) in node by RackHD before provisioning.
VM_CID
may or may not be specified. If VM_CID
is specified, look up node based on VM_CID
. If VM_CID
is not specified, choose node randomly.
Steps:
- Assume system disk, swap and ephemeral disk are always on /dev/sda (partitioned to sda1, sda2, and sda3)
- Assume persistent disk is always on /dev/sdb
if VM_CID
is specified
-
choose node based on
VM_CID
-
If a disk is already on the VM, error out. if
VM_CID
is not specified -
choose node without
DISK
andVM_CID
randomly -
Generate GUID and add into metadata in RackHD node:
cid: "25892e17-80f6-415f-9c65-7395632f0223"
persistent_disk: {
disk_cid: "e33898de-6302-4756-8f0c-5f6c5218e02e"
location: "/dev/sdb"
attached: false
}
Set persistent_disk.attached = true
Set Agent Env with the disk location (ie. /dev/sdb). OR always assume sdb is disk to avoid communication with Agent
Set persistent_disk.attached = false
Set Agent Env to remove persistent disk info OR always assume sdb is disk to avoid communication with Agent
Scan all nodes to see if a disk with the Disk CID
- Find by disk_id
- If not found, errors out
- If disk is still attached, error out
- Remove
persistent_disk
Not implemented error OR no op
Not implemented OR no op
Scan all attached disks attached to the VM
- When create_vm is called, we pick a random node that has no disk metadata.
- User cannot pick which node / which disk to use.
- If CPI selects a node without enough capacity, it will error out at create_disk.
- Migration is not supported.
- CPI will error out when user changes the size of persistent disk.
- System disk, swap and ephemeral disk are always on /dev/sda (partitioned to sda1, sda2, and sda3)
- Persistent disk is always on /dev/sdb