VMware Cloud Community
rxjoseph
Enthusiast
Enthusiast
Jump to solution

AutoDeploy Unable to associate ESXi image using powercli

Hello Powercli  Experts

I have a large environment with Autodeploy Stateless, which works fine, but things are done manually now, and I now need to automate things

1. I have software depots and images created  as shown below which works great manually no issues

When i run the Get-EsxSoftwareDepot i don't get anything which is strange because I have those images and the depot.

If i run a Add-EsxSoftwareDepot -DepotUrl "\\testserver\VMWare\ESXi xxxCustom Images\Output\xxx\xxxxx-Advisor-ESXi-6.7.0-Update3-myimage-depot.zip"

I get an error "Add-EsxSoftwareDepot : Could not download from depot at zip:G:  No such file or directory: "

Now my problem is if i can see it in the GUI why can't i see the depot and images from powercli ?

Once i can see the images then I will need the commands to associate the images to ESXi host which are listed on the Deployed hosts

Please help me to resolve the issue, I have tried for 2 days and i couldnt figure out

pastedImage_0.png

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

The Add-EsxSoftwareDepot cmdlet says in its Help page "Adds an ESX software depot or offline depot ZIP file to the current PowerCLI session"

So yes, you'll have to add the depot each time you start a session.

As an alternative, you can add that cmdlet in your PS profile.


You can use Get-EsxSoftwarePackage and pipe the output to Out-GridView.


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

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

Did you already try placing the network share between single quotes?

The "\\" sequence might be interpreted as an escape sequence.

As an alternative, can you map a drive to that share, and try with the drivepath?


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

0 Kudos
rxjoseph
Enthusiast
Enthusiast
Jump to solution

Hi LucD

Thank you , by mapping the drive the issue was sorted

Add-EsxSoftwareDepot -DepotUrl 'G:\xxxx-xxxxx-ESXi-6.7.0-Update3-16316930-NSXT2.5.1-xxxxxx-01-depot.zip'

I still have a question if i need to automate

Currently all these are visible on the GUI and only i can see the Depot which are added again with the command detailed above

Why is that and if I need to automate I  have to add the Depot every time ?

My next question is if i have multiple images on a Depot can i use a Grid-View to list the images and select an image which i require and assign that to a list of VMhosts ?

Many thanks

RXJ

0 Kudos
LucD
Leadership
Leadership
Jump to solution

The Add-EsxSoftwareDepot cmdlet says in its Help page "Adds an ESX software depot or offline depot ZIP file to the current PowerCLI session"

So yes, you'll have to add the depot each time you start a session.

As an alternative, you can add that cmdlet in your PS profile.


You can use Get-EsxSoftwarePackage and pipe the output to Out-GridView.


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

0 Kudos
rxjoseph
Enthusiast
Enthusiast
Jump to solution

Thank you, as always you are very helpful

Many thanks

RXJ

0 Kudos