VMware Cloud Community
Pilu1978
Enthusiast
Enthusiast
Jump to solution

Install .vmexe file using POSH-SSH

Hi,

I am trying to automate the HBA firmware installation using Posh-SSH module on my HP Gen8 6.5 hosts. The firmware installer comes in zip format and it contains the following files:

CP032799.exe

CP032799.vmfile

CP032799.xml

payload.json

Readme.txt

So the script will ask for host name and the datastore on which these files are uploaded.

However it is failing to execute the vmexe file. It is telling vmfile not found.

Any help would be appreciated.

Reply
0 Kudos
30 Replies
Pilu1978
Enthusiast
Enthusiast
Jump to solution

This time getting the below error:

pastedImage_0.png

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

Let me try to install it on another host with this updated code. I will get back to with the result shortly.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

It looks as if error code 3 indicates a 'downgrade'.

Apparently the 'force' flag is required.

Try adding the -s -f parameters on the call to the vmexe.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

I have tried it on another host but giving same error. Firmware is not getting installed.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

With the force flag (-f)?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

getting below error with -f option

pastedImage_0.png

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

At last its executed after putting semi colon at the end as as shown below:

$code = @'

cd $dspath; ls -l; chmod +x CP032799.vmexe; ./CP032799.vmexe -f;

'@

However getting the below after the installation. How to get rid of it.

pastedImage_7.png

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

That looks to be a timeout happening.
The Invoke-SSHCommand cmdlet has a Timeout parameter, you could try using that.


I have no clue how long this vmexe is supposed to run.
How long did it run when you executed it from an interactive session?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

It takes around 40 - 60 seconds to complete the installation.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Did you try adding a TimeOut value?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

At last it worked after adding the timeout parameter.  Thanks a lot.

Reply
0 Kudos