Pilu1978
Enthusiast
Enthusiast

Install .vmexe file using POSH-SSH

Jump to solution

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.

0 Kudos
30 Replies
Pilu1978
Enthusiast
Enthusiast

This time getting the below error:

pastedImage_0.png

0 Kudos
Pilu1978
Enthusiast
Enthusiast

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

0 Kudos
LucD
Leadership
Leadership

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

0 Kudos
Pilu1978
Enthusiast
Enthusiast

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

0 Kudos
LucD
Leadership
Leadership

With the force flag (-f)?


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

0 Kudos
Pilu1978
Enthusiast
Enthusiast

getting below error with -f option

pastedImage_0.png

0 Kudos
Pilu1978
Enthusiast
Enthusiast

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

0 Kudos
LucD
Leadership
Leadership

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

0 Kudos
Pilu1978
Enthusiast
Enthusiast

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

0 Kudos
LucD
Leadership
Leadership

Did you try adding a TimeOut value?


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

View solution in original post

0 Kudos
Pilu1978
Enthusiast
Enthusiast

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

0 Kudos