<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<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.<o:p></o:p></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">https://github.com/openstack/python-cinderclient/blob/master/cinderclient/v2/volume_types.py#L118</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Vipin<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></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:pradip.interra@gmail.com]
<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<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p>Hello,<o:p></o:p></p>
<p>I am trying to create and type-set some parameters to a volume-type as follows:<o:p></o:p></p>
<pre>cinder type-create nfs<o:p></o:p></pre>
<pre>cinder type-key nfs set volume_backend_name=myNFSBackend<o:p></o:p></pre>
<p>The same thing I want to achieve through python client. <o:p></o:p></p>
<p>I can create the type as follows:<o:p></o:p></p>
<pre>from cinderclient import client <o:p></o:p></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=">http://127.0.0.1:5000/v2.0</a>', service_type="volumev2")<o:p></o:p></pre>
<pre>cinder.volume_types.create('nfs')<o:p></o:p></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)?<o:p></o:p></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).<o:p></o:p></p>
<p>Any help would be great.<o:p></o:p></p>
<p>Thanks, Pradip<o:p></o:p></p>
</div>
</div>
</body>
</html>