<div dir="ltr">Oops. Missed it. Thanks! It worked Vipin.<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 31, 2015 at 12:06 PM, Vipin Balachandran <span dir="ltr"><<a href="mailto:vbalachandran@vmware.com" target="_blank">vbalachandran@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal">cinder.volume_types.create<span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> returns an instance of VolumeType.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><a href="https://github.com/openstack/python-cinderclient/blob/master/cinderclient/v2/volume_types.py#L118" target="_blank">https://github.com/openstack/python-cinderclient/blob/master/cinderclient/v2/volume_types.py#L118</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Vipin<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Pradip Mukhopadhyay [mailto:<a href="mailto:pradip.interra@gmail.com" target="_blank">pradip.interra@gmail.com</a>]
<br>
<b>Sent:</b> Tuesday, March 31, 2015 10:07 AM<br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Subject:</b> [openstack-dev] [cinder] Attaching extra-spec to vol-type using Cinder py-client<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p>Hello,<u></u><u></u></p>
<p>I am trying to create and type-set some parameters to a volume-type as follows:<u></u><u></u></p>
<pre>cinder type-create nfs<u></u><u></u></pre>
<pre>cinder type-key nfs set volume_backend_name=myNFSBackend<u></u><u></u></pre>
<p>The same thing I want to achieve through python client. <u></u><u></u></p>
<p>I can create the type as follows:<u></u><u></u></p>
<pre>from cinderclient import client <u></u><u></u></pre>
<pre>cinder = client.Client('2', 'admin', 'pw', 'demo', '<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__127.0.0.1-3A5000_v2.0&d=AwMBaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=CTAUyaHvyUUJ-0QHviztQxBhCDLLSg1DksoSE4TOfZ8&m=EIUflZKBvoV_Hp3DkmTE612FqBGHpwXLuwGJ3UpwbbI&s=hk8YML4Dn_kR2cMzCB4Lohd-fnmlk8Z9zBEu1Cc3DO0&e=" target="_blank">http://127.0.0.1:5000/v2.0</a>', service_type="volumev2")<u></u><u></u></pre>
<pre>cinder.volume_types.create('nfs')<u></u><u></u></pre>
<p>However how can I associate the extra-spec through python-client code to the 'nfs' volume (same impact as the CLI 'cinder type-key nfs set volume_backend_name=myNFSBackend' does)?<u></u><u></u></p>
<p>The 'set_keys' etc. methods are there in the "v2/volume_types.py" in python-cinderclient codebase. How to call it? (it's part of VolumeType class, not VolumeTypeManager).<u></u><u></u></p>
<p>Any help would be great.<u></u><u></u></p>
<p>Thanks, Pradip<u></u><u></u></p>
</div>
</div></div></div>
</div>

<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>