You can use this function
https://github.com/openstack/cinder/blob/master/cinder/volume/utils.py#L5

On Wed, Jan 6, 2016 at 5:44 PM, Pradip Mukhopadhyay <
[email protected]> wrote:

> Hello,
>
>
> From CLI, I can see the host-name in the cinder show command as follows:
>
> |         os-vol-host-attr:host         |  openstack4@mySCSIBackend#pool1
> |
>
> How this info can be accessed from the cinder python client?
>
> I can access other information (id, size, name etc.) as follows:
>
> >>> volumes = cinder.volumes.list()
>
> >>> volumes
>
> [<Volume: e8be1df5-64fb-43fa-aacd-9bebba17fba5>]
>
> >>> volumes[0].id
>
> u'e8be1df5-64fb-43fa-aacd-9bebba17fba5'
>
> >>> volumes[0].volume_type
>
> u'iscsi_1'
>
>
>
> Thanks,
> Pradip
>
>
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: [email protected]?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [email protected]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to