[ovirt-users] python sdk and /api/hosts/{host:id}/install

Juan Hernández jhernand at redhat.com
Thu Apr 21 16:06:43 UTC 2016


On 04/21/2016 04:58 PM, Fabrice Bacchella wrote:
> I'm trying to the use the API to reinstall an hosts.
> 
> But if a post the following content :
> POST /api/hosts/XXXXX/install
> 
>> <action>
>>     <host>
>>         <override_iptables>false</override_iptables>
>>     </host>
>>     <ssh>
>>         <port>22</port>
>>         <fingerprint>SHA256:XXXX</fingerprint>
>>         <authentication_method>publickey</authentication_method>
>>     </ssh>
>> </action>
> 
> I get the error :
> [Cannot edit Host. Power Management is enabled for Host but no Agent type selected.]
> 
> But the agent was set when I created the host, the GUI don't ask for power management informations when reinstalling the hosts and when I look the the rsdl ( at https://ovirt/api?rsdl), the agent type was not required.
> 
> So what's wrong with the install command and that is not in the rsdl ?
> 

There is nothing wrong with you command, but there is a error in the
server side that makes this fail. Please open bug. The only workaround
at the moment is to disable power management, do the install, and then
re-enable power management.

> I'm using ovirt-engine 3.6.5.3
> 
> The rsdl for install that I got :
> 
> <link href="/api/hosts/{host:id}/install" rel="install">
>     <description>
>         install vdsm and other packages required to get the host ready to be used in the engine
>     </description>
>     <request>
>         <http_method>POST</http_method>
>         <headers>
>             <header required="false">
>                 <name>Correlation-Id</name>
>                 <value>any string</value>
>             </header>
>             <header required="true">
>                 <name>Content-Type</name>
>                 <value>application/xml|json</value>
>             </header>
>         </headers>
>         <url>
>             <parameters_set>
>                 <parameter required="false" type="xs:boolean" context="matrix">
>                     <name>async</name>
>                     <value>true|false</value>
>                 </parameter>
>             </parameters_set>
>         </url>
>         <body>
>             <type>Action</type>
>           ...
>             <parameters_set>
>                 <description>
>                     install vdsm and other packages required to get the host ready to be used in the engine providing the ssh password
>                 </description>
>                 <parameter required="false" type="xs:int">
>                     <name>action.ssh.port</name>
>                 </parameter>
>                 <parameter required="false" type="xs:string">
>                     <name>action.ssh.fingerprint</name>
>                 </parameter>
>                 <parameter required="false" type="xs:string">
>                     <name>action.ssh.authentication_method</name>
>                 </parameter>
>                 <parameter required="false" type="xs:string">
>                     <name>action.ssh.user.user_name</name>
>                 </parameter>
>                 <parameter required="false" type="xs:string">
>                     <name>action.ssh.user.password</name>
>                 </parameter>
>                 <parameter required="false" type="xs:string">
>                     <name>action.image</name>
>                 </parameter>
>                 <parameter required="false" type="xs:boolean">
>                     <name>action.host.override_iptables</name>
>                 </parameter>
>                 <parameter required="false" type="xs:boolean">
>                     <name>action.async</name>
>                 </parameter>
>                 <parameter required="false" type="xs:long">
>                     <name>action.grace_period.expiry</name>
>                 </parameter>
>             </parameters_set>
>         </body>
>     </request>
>     <response>
>         <type>Action</type>
>     </response>
> </link>
> 
> 
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 


-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.



More information about the Users mailing list