VIOS Update gotchas

VIOS Update gotchas

A week ago I wrote the article about IBM PowerVM VIOS update using Ansible. But there is a small problem with the playbook.

As you remember, I first commit all the updates which was previously installed on the VIO:

No alt text provided for this image
updateios -commit Ansible way

If there are uncommitted updates, everything is fine.

The problem comes if there are NO uncommitted updates:

No alt text provided for this image
Error message from updateios

The module ibm.power_vios.updateios executes the command updateios -commit and returns back the error. It is usual behaviour of updateios command and if you execute it manually, you understand that everything is OK and you can continue with your update.

Unfortunately Ansible doesn't have a head and brains of a human VIO administrator and it wants a little bit help from us.

The easiest way you could solve the problem is to add ignore_errors into the playbook:

No alt text provided for this image
ignore_errors: yes

It will work but it will ignore more errors as you wish. For example the following error will be ignored too:

No alt text provided for this image
Media repository prevents VIO update

In this case we have to drop off ibm.power_vios collection and use the standard Ansible shell module. Using the shell module we can define return codes which are "good" and should be ignored.

No alt text provided for this image
updateios -commit command using Ansible standard shell module

We register the result of the executed shell command in the variable result and then check the value of the return code saved in result.rc.

If return code is 0, 19 or 20, then the task was executed successfully and we can execute the next task.

If return code is NOT 0, 19 or 20, then the playbook must fail.

Why these return codes?

Return code 0 means everything worked without any problems. It is returned when there were uncommitted updates and they were successfully committed.

Return code 19 I saw on VIO 3.1.1 with the message "There are no uncommitted updates".

Return code 20 I saw on VIO 3.1.4 with the same message "There are no uncommitted updates".

I have no information how oft the return codes are changed and what their actual meanings are. If you have it, write it down in the comments. They worked for me and I did ca. 40 VIO updates last week using the playbook.


Have fun with VIO updates!

Andrey

Andre Lutz

[ Technical Leader Linux on Power | SVA | IBM Power Systems Plattform | PowerVC | Devops | AI | Opensource | Linux | Ansible ]

2 年

Is there also a whole ansible role for this soon on github???

要查看或添加评论,请登录

???????Andrey Klyachkin的更多文章

社区洞察

其他会员也浏览了