bosh icon indicating copy to clipboard operation
bosh copied to clipboard

external CPI - create vm. No hint from bosh director for persistent disk, cant optimize for local storage

Open poblin-orange opened this issue 11 years ago • 8 comments

The CPI contract indicates that bosh director can give indication for the persistent disk that will be attached to a new VM. https://github.com/cloudfoundry/bosh/wiki/BOSH-CPI-API-v1-(WIP)#create_vm

This information is critical to enable local storage type, with an optimized external CPI. Despite testing different configuration, i never got any disk_id hint in create_stemcell. Is there a configuration to bosh director to enable disk_id hint ? Thks for your feedback

poblin-orange avatar Sep 03 '15 10:09 poblin-orange

http://bosh.io/docs/cpi-api-v1.html#create-vm mentions disk_cids as one of its arguments.

disk_cids [Array of strings] Array of disk cloud IDs for each disk that created VM will most likely be attached; they could be used to optimize VM placement so that disks are located nearby.

We do not guarantee that it will always be populated since Director may make later decisions in the deployment flow about which disks to attach.

I'm not sure though I understand what you mean by "enable local storage type". Do you mean you want to create ephemeral disk on local storage or do you mean you want persistent disks to be on the local storage?

cppforlife avatar Sep 03 '15 18:09 cppforlife

Yes the aim is to target local storage type for persistent disk. My understanding is the cpi api does not manage ephemeral disk, only persistent disk. The idea is to target the persistent disk when recreating vm (typically after a bosh release update)

poblin-orange avatar Sep 03 '15 19:09 poblin-orange

Are you thinking that CPI would pick specific hosts for VM creation based on where persistent disk is located? Would you also be able to move persistent disks from host to host if needed?

Separately from that, are you planning to support network attached storage for persistent disks?

CPIs do manage ephemeral disk but transparently inside create_vm call. If you want to pass in special configuration for ephemeral disk you should do that through resource pool's cloud properties.

We planning to support a similar configuration in vsphere cpi so that we can optionally place persistent disks onto local storage; however, it would not be a default in our case.

cppforlife avatar Sep 03 '15 22:09 cppforlife

Yes, we added a cloud_properties ephemeral_disk_offering, so our cloudstack CPI can use a dedicated iaas disk offering, generally local, for ephemeral disk. This cause no issue, as the ephemeral disk and vm lifecycle are the same. For the persistent disk, a cloud_properties disk_offering let the CPI place the persistent disk with a distinct offering (local / or shared - nas, its up to the iaas admin).

As our external CPI has intimate link with the Iaas, it will have special support if the persistent disk is local, ie create the vm on the same host. We are also considering moving the disk, with a snapshot / recreate api call sequence for example.

Hooking this mecanism in create_vm is more "ops intuitive" , and the disk_ids hint from Bosh Director would be usefull. If not, this mechanism could be plugged @attach_disk time

poblin-orange avatar Sep 04 '15 07:09 poblin-orange

@poblin-orange fair enough. Unless I missed something I believe disk_cids provide you with enough information for moving things around. Can this issue be closed?

cppforlife avatar Sep 16 '15 17:09 cppforlife

@cppforlife yes disk_cids would be enough, if bosh director feeds it, which it doesnt (it was my initial point. Is there a configuration to bosh director to enable disk_id hint ? )

poblin-orange avatar Sep 16 '15 19:09 poblin-orange

@poblin-orange Hmm. It doesnt feed the disk CID on initial create I believe because we first create VM and then the disk, but on subsequent recreates of the VM I believe it does send it it.

cppforlife avatar Nov 14 '15 02:11 cppforlife

Closing for inactivity. If you'd like to continue the conversation, feel free to reopen this thread.

mfine30 avatar Aug 07 '18 18:08 mfine30