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

2016-02-26 Thread John Griffith
On Fri, Feb 26, 2016 at 12:47 PM, Sean McGinnis 
wrote:

> On Fri, Feb 26, 2016 at 06:11:15PM +, 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-requ...@lists.openstack.org?subject:unsubscribe
> > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>

​Maybe this will help https://review.openstack.org/#/c/285471/

Additionally I've been trying to point out lately that a Volume should be
just a "thing" or resource and it's up to consumers of volumes to manage
connections (attach/detach) appropriately.​
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2016-02-26 Thread Sean McGinnis
On Fri, Feb 26, 2016 at 06:11:15PM +, 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-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2016-02-26 Thread Srinivas Sakhamuri
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?

TIA
Srini
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev