VMware Cloud Community
bradelms
Contributor
Contributor

Copy and execute a script to vmware center server

I need to run a script in my VMware vcenter server. The Instructions are:

  1. Download and extract the scripts from the attached 80227_cleanup_unsupported_metadata_files.zip.
  2. Copy and execute cleanup_patch_store.sh script on your vCenter Server.
  3. Run Sync Updates.

I downloaded the WMware CLI in powershell 7 using: Install-Module -Name VMware.PowerCLI -RequiredVersion 6.5.4.7155375

I connected to my vSphere server using the command Connect-VIServer -Server -My server name-

How would I run the script files from my windows PC in this CLI shell? I turned on BASH shell in my appliance.

pastedImage_1.png

Reply
0 Kudos
3 Replies
scott28tt
VMware Employee
VMware Employee

Moderator: Thread moved to the vCenter Server area.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
nachogonzalez
Commander
Commander

Hey, hope you are doing fine.
Usually .sh files are for bash shell scripts which are for unix/linux based systems.
In this case I think that script is intended to be ran on a VCSA (vCenter Server Appliance - Linux Based) instead of on windows.
If it were a windows Powershell/PowerCli script it would end on .ps1

If you have the KB where you obtained the steps or the steps you are trying to accomplish i would gladly help

Kind regards

Reply
0 Kudos
Lalegre
Virtuoso
Virtuoso

Hey bradelms​,

As i can see you are trying to follow this KB for vSphere Lifecycle Manager which has been introduced in vSphere 7: VMware Knowledge Base

What you need to do is really easy just copy the downloaded files inside the vCenter Server Appliance using WinSCP or Filezilla or any tool you are familiar with to copy files. Once inside the VCSA go to the location where you copied the files an execute the .sh file using the next command: ./cleanup_patch_store.sh

The KB does not detail anything about permissions to be assigned to the file so i just assume that is missing. If you cannot run the file with the previously mentioned command first run chmod +x cleanup_patch_store.sh and after that try to run the file again.

Let us know how it goes.

Reply
0 Kudos