VMware Cloud Community
Fexsun
Contributor
Contributor

How to automate ESXi CLI command?

Hello

I would like to ask you, how I can automate CLI command on ESXi host?
Command: "esxcli storage core adapter rescan -A vmhba64"
Right now, I must writing this command three minutes after every ESXi host boot up.
It would be great if it can be done without my ingerention.
Thank you so much for help.

Regards

0 Kudos
2 Replies
lamw
Community Manager
Community Manager

Have you identified _why_ you need to perform the rescan on every boot up? Is this to discover RDM devices ... If so, the solution would be to apply the perennially reserve flag as outlined in this KB https://kb.vmware.com/kb/1016106 If not, it would be good to understand the why and whether you've engaged VMware Support. While runining the command on bootup can certainly be done, it seems not ideal as you're trying to workaround an actual issue as this shouldn't be required on properly configured setup

0 Kudos
Fexsun
Contributor
Contributor

Thank you for answer lamw.

To be honest I know that automate command isn't the best solution, but I need it at present time.

I have got configure that in the short term. In the future I will be looking for better solution.

I don't know what it is certainly RDM, but from what I read now about this technology, I don't use that (probably).

So, could you tell me please how to automate ESXi commands? Is it powerCLI, good way?

Regards

0 Kudos