<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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@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:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:5.0pt;
        margin-right:0cm;
        margin-bottom:3.0pt;
        margin-left:0cm;
        text-align:justify;
        text-justify:inter-ideograph;
        text-indent:21.0pt;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:86779760;
        mso-list-type:hybrid;
        mso-list-template-ids:-1632319402 1057903300 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-text:%1\FF0E;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:1330522083;
        mso-list-type:hybrid;
        mso-list-template-ids:676244638 495379108 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:39.0pt;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-number-format:alpha-lower;
        mso-level-text:"%2\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:63.0pt;
        text-indent:-21.0pt;}
@list l1:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:84.0pt;
        text-indent:-21.0pt;}
@list l1:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:105.0pt;
        text-indent:-21.0pt;}
@list l1:level5
        {mso-level-number-format:alpha-lower;
        mso-level-text:"%5\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:126.0pt;
        text-indent:-21.0pt;}
@list l1:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:147.0pt;
        text-indent:-21.0pt;}
@list l1:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:168.0pt;
        text-indent:-21.0pt;}
@list l1:level8
        {mso-level-number-format:alpha-lower;
        mso-level-text:"%8\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:189.0pt;
        text-indent:-21.0pt;}
@list l1:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:210.0pt;
        text-indent:-21.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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="ZH-CN" link="#0563C1" vlink="#954F72" style="text-justify-trim:punctuation">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi list,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have installed a devstack environment with ironic.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">And I can successfully boot instance with the VMs (work as ironic node) created by devstack.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Now I want to create a new VM on the same physical machine and add the new VM as an ironic node.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I tried to follow steps in “devstack/lib/ironic”, here is what I have done:<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:39.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2">
<![if !supportLists]><span lang="EN-US" style="font-size:6.5pt"><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">        
</span></span></span><![endif]><span lang="EN-US" style="font-size:6.5pt">I have edited “devstack/tools/ironic/scripts/<span style="color:red">create-nodes</span>”, start 3 new VMs in libvirt:<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">virsh list --all<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">Id    Name                           State<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">----------------------------------------------------<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">4     baremetalbrbm_0                running<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">-     baremetalbrbm_1                 shut off<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">-     baremetalbrbm_2                 shut off<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">-     baremetalbrbm_CHEN_0           shut off<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">-     baremetalbrbm_CHEN_1           shut off<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">-     baremetalbrbm_CHEN_2           shut off<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:39.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2">
<![if !supportLists]><span lang="EN-US" style="font-size:6.5pt"><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman"">        
</span></span></span><![endif]><span lang="EN-US" style="font-size:6.5pt">Create chassis<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:0cm"><span lang="EN-US" style="font-size:6.5pt">ironic chassis-create<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:39.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2">
<![if !supportLists]><span lang="EN-US" style="font-size:6.5pt"><span style="mso-list:Ignore">3.<span style="font:7.0pt "Times New Roman"">        
</span></span></span><![endif]><span lang="EN-US" style="font-size:6.5pt">Create ironic node
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">ironic node-create --chassis_uuid $CHASSIS_ID --driver pxe_ssh
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">            -i ssh_virt_type=$IRONIC_SSH_VIRT_TYPE
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">            -i ssh_address=$IRONIC_VM_SSH_ADDRESS<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">            -i ssh_port=$IRONIC_VM_SSH_PORT
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">            -i ssh_username=$IRONIC_SSH_USERNAME
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">            -i ssh_key_filename=$IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">            -p cpus=$IRONIC_VM_SPECS_CPU
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">            -p memory_mb=$IRONIC_VM_SPECS_RAM
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">            -p local_gb=$IRONIC_VM_SPECS_DISK
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:13.0pt"><span lang="EN-US" style="font-size:6.5pt">            -p cpu_arch=x86_64
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:39.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2">
<![if !supportLists]><span lang="EN-US" style="font-size:6.5pt"><span style="mso-list:Ignore">4.<span style="font:7.0pt "Times New Roman"">        
</span></span></span><![endif]><span lang="EN-US" style="font-size:6.5pt">Create port<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:36.0pt;text-indent:0cm"><span lang="EN-US" style="font-size:6.5pt">        ironic port-create --address $MAC --node_uuid $NODE_ID<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:39.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2">
<![if !supportLists]><span lang="EN-US" style="font-size:6.5pt"><span style="mso-list:Ignore">5.<span style="font:7.0pt "Times New Roman"">        
</span></span></span><![endif]><span lang="EN-US" style="font-size:6.5pt">Create nova-flavor<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:36.0pt;text-indent:0cm"><span lang="EN-US" style="font-size:6.5pt">nova flavor-create --ephemeral 0 baremetal-chen auto 2048 10 2<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:36.0pt;text-indent:0cm"><span lang="EN-US" style="font-size:6.5pt">nova flavor-key baremetal-chen set "cpu_arch"="x86_64" "baremetal:deploy_kernel_id"=$kernel_id "baremetal:deploy_ramdisk_id"=$ramdisk_id<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">But these new nodes do not have power_state:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">ironic node-list<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">+--------------------------------------+--------------------------------------+-------------+-----------------+-------------+<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">| uuid                                 | instance_uuid                        | power_state | provision_state | maintenance |<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">+--------------------------------------+--------------------------------------+-------------+-----------------+-------------+<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">| 01bf3f84-baae-4220-9cf4-f600083f9d3a | None                                 | power off   | None            | False       |<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">| 44da06e9-ef49-44b0-8fc0-5073e15ed5f1 | None                                 | None        | None            | False       |<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">| 7bf9bc19-0b24-4d0f-b6f8-dd3df5c992e5 | None                                 | None        | None            | False       |<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">| 82ef47a6-16ef-46cc-9c7d-a9f50d6a9ba3 | None                                 | power off   | None            | False       |<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">| 9c6ca940-f383-4ae2-8390-47d4cc779d9c | None                                 | None        | None            | False       |<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">| 4c192e12-c81a-4995-8e26-225e0da89267 | e544641f-0c52-4357-9097-db2083e4a81b | power on    | active          | False       |<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">+--------------------------------------+--------------------------------------+-------------+-----------------+-------------+<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Error happen when I try to change the power_state:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">ironic node-set-power-state 44da06e9-ef49-44b0-8fc0-5073e15ed5f1 reboot<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">SSH connection cannot be established: Failed to establish SSH connection to host 192.168.50.1.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">Traceback (most recent call last):<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">  File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/server.py", line 137, in inner<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">    return func(*args, **kwargs)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">  File "/home/devstack/ironic/ironic/conductor/manager.py", line 249, in change_node_power_state<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">    task.driver.power.validate(task)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">  File "/home/devstack/ironic/ironic/drivers/modules/ssh.py", line 374, in validate<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">    "any port associated with it.") % task.node.uuid)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">InvalidParameterValue: SSH connection cannot be established: Failed to establish SSH connection to host 192.168.50.1.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt">(HTTP 400)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Anyone know why this happens ???<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">What should I do next ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">-chen<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:6.5pt"><o:p> </o:p></span></p>
</div>
</body>
</html>