Search Results
38 results found with an empty search
- Automate ISO File Deletion from VMware vCenter Datastores Using PowerShell
In a VMware vCenter environment, managing ISO files across multiple datastores can be a cumbersome task. If you have numerous ISO files that need to be deleted, doing it manually is time-consuming and prone to errors. Thankfully, PowerShell, combined with VMware PowerCLI, can automate this process efficiently. Prerequisites: Before running the script, ensure you have "VMware PowerCLI" installed, if not then below is the command line to install it. # Install-Module -Name VMware.PowerCLI -Scope CurrentUser A Quick Screenshots of Existing ISO Files Across Datastores: As you can see in below screenshot, I have five ISO files across two datastores for deletion. On, how to retrieve ISO files info, please refere to this blog post. Automate "ISO" File Retrieval from VMware vCenter Datastores Using PowerShell PowerShell Script & Procedure: The script below connects to your vCenter server, searches through all datastores for .iso files, and deletes them. Please note, the -WhatIf and -Confirm parameters can be used based on your wish/requirement to preview actions and get confirmation before proceeding. Connect to you vCenter Server. # Connect-VIServer -Server $vcenterServer -User $vcUser -Password $vcPassword The script below connects to your vCenter server, searches through all datastores for .iso files, and deletes them (Please note, as stated above the -WhatIf and -Confirm parameters can be used to preview the action before proceeding). In this below script I've used -Confirm switch. # Get all datastores $datastores = Get-Datastore foreach ($datastore in $datastores) { # Get all ISO files in the datastore $isoFiles = Get-ChildItem -Path $datastore.DatastoreBrowserPath -Recurse -Include *.iso foreach ($isoFile in $isoFiles) { # Delete the ISO file Remove-Item -Path $isoFile.FullName -Confirm:$true } } Disconnect-VIServer -Server vc-l-01a.corp.local -Confirm:$false Run the above PowerShell script now to perform all the ISO files deletion from the vCenter now. I've selected A (Yes to All), you can pick the option based on your situation and need. Note - Please be patient, as it needs to check through all the datastores & perform deletion so it may take some time. Now, you can verify the deletion tasks from the vCenter Recent tasks view as well. !Happy Scripting! Further Reference: Automate "ISO" File Retrieval from VMware vCenter Datastores Using PowerShell
- How to Collect SDDC Manager Logs for Troubleshooting and Diagnostics
Situation: This blog post provides a detailed, step-by-step guide on how to collect SDDC Manager logs, which can be essential for troubleshooting issues or conducting diagnostics within a VMware Cloud Foundation (VCF) environment. Procedure: SSH to SDDC Manager, switch to "root". Run the following command to begin collecting the SDDC Manager logs. # /opt/vmware/sddc-support/sos --sddc-manager-logs --zip Note: If you need to collect logs for a specific domain or the NSX Manager, you can use the following command. Additionally, you can specify any folder within SDDC Manager to store the logs. For demonstration purposes, I’ve chosen to dump the logs to the /tmp/ folder. # /opt/vmware/sddc-support/sos --nsx-log --log-dir /tmp Once the log is generated, use SCP or copy the log bundle from the SDDC Manager. The log is now ready to be uploaded to the support request for further diagnosis. Good luck! Here is a Broadcom KB article for further reference if required: How to collect SDDC Manager logs

