The existing updateHostPassword API call would allow only database changes, which means that the passwords would have to be updated manually in all the hosts. in addition, the API was only available for XenServer based hosts. The lack of functionality, which leads to manual, or not standardised, work and the limitations of the API urged us to apply some changes in order to improve its current behaviour.
With the improvements applied we will be able to:
XenServer hosts can only be updated if the Cluster ID is informed. An attempt to update a XenServer hosts alone will result in the following error:
Single host update is not supported by XenServer hypervisors. Please try again informing the Cluster ID.
Although the API has changed, we kept backwards compatibility by adding only a parameter to which the operator will either say "true" or "false". In case the operator wants to work as before, by updating the hosts passwords manually, the parameter "update_passwd_on_host" has "false" as default value, so the operator doesn't need to inform it.
The cloudmonkey calls below can be used for both XenServer and KVM hosts.
update hostpassword clusterid=53963278-f9d1-42d5-bab5-18c7ec466a0b username=root password=admin123
update hostpassword hostid=9ae1d93b-d09c-4e1c-94fa-9082e81cca26 username=root password=admin123
update hostpassword clusterid=53963278-f9d1-42d5-bab5-18c7ec466a0b username=root password=admin123
The cloudmonkey calls below can be used for both XenServer and KVM hosts.
update hostpassword clusterid=53963278-f9d1-42d5-bab5-18c7ec466a0b username=root password=admin123 update_passwd_on_host=true
update hostpassword hostid=9ae1d93b-d09c-4e1c-94fa-9082e81cca26 username=root password=admin123
update hostpassword clusterid=53963278-f9d1-42d5-bab5-18c7ec466a0b username=root password=admin123 update_passwd_on_host=true