[openstack-dev] [Cinder] [nova] Work flow for detaching a volume

Sean McGinnis sean.mcginnis at gmx.com
Fri Feb 26 19:47:48 UTC 2016


On Fri, Feb 26, 2016 at 06:11:15PM +0000, Srinivas Sakhamuri wrote:
> I want to confirm the correct work flow for detaching a volume, Both nova
> and cinder (unpublished, available through cinder.volumes.detach) provides
> detach volume API. Only nova seems to have correct work flow in terms of
> detaching a volume i.e.
>     1) detaches the volume from the VM (libvirt.volume_detach)
>     2) Informs Cinder to do Cinder-side detach
>     3) delete BlockDeviceMapping from Nova DB
> 
> On the other hand cinder just modifies cinder DB entries and let's the
> driver handle the detaching the volume. No API call to nova to let it know
> about the volume detaching.
> 
> - Does that mean nova is the only work flow to use to correctly detach a
> volume from instance?
> - And cinder detach API serves only to cleanup internal state in the DB and
> cinder driver?

I guess it depends on what you are trying to accomplish. If a volume is
being used by nova, then the nova APIs are the correct ones to use to
have it fully detached from the host and cleaned up.

Internally, Nova calls the Cinder APIs to perform the storage
management.

If you are just looking to perform storage management, for example
with bare metal and not using Nova, then you would call the
Cinder APIs.

So to answer your first question of whether the nova API is the correct
way to detach a volume from an instance - yes.

Sean

> 
> TIA
> Srini

> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev




More information about the OpenStack-dev mailing list