Skip to main content

Posts

Create a vCenter role using vCenter MOB

 Requirement: Finding a way to automate the creation of Role for any services with its permissions. Example: Citrix service account to be integrated with vCenter. Steps: 1) Login to vCenter : https://192.168.1.68/mob  2) Click on 'Content'                3) Click on Authorization Manager                                     4) Click on  'AddAuthorizationRole'                             5) Provide name in name field & privId in xml format & Click Invoke Method                        This should give you a return value and then the Role will be reflected on vCenter. 

Script to Collect the BMC/OOB/CIMC IP Address of ESXi hosts connected to vCenter

 Requirement: We needed to collect all the iDRAC/ILO/CIMC/OOB/BMC IPs of the ESXi host connected to vCenter Note: Create a directory and update the path. Script: # Prompt for vCenter $vcenter = Read-Host "Enter vCenter IP or FQDN" $cred = Get-Credential # Output file $OutputPath = "C:\Users\TestUser\Documents\ESXi_Full_Report.csv" # Connect Connect-VIServer -Server $vcenter -Credential $cred -WarningAction SilentlyContinue Write-Host "Connected to vCenter. Gathering data..." -ForegroundColor Green $report = @() $vmhosts = Get-VMHost foreach ($vmhost in $vmhosts) {     Write-Host "Processing host: $($vmhost.Name)" -ForegroundColor Cyan     $view = Get-View $vmhost.Id     # --- SERIAL NUMBER LOGIC ---     $serial = $view.Hardware.SystemInfo.SerialNumber     if (-not $serial) {         foreach ($id in $view.Summary.Hardware.OtherIdentifyingInfo) {             if ($id.IdentifierType.Key ...

Script to collect the service tag and the model of ESXi hosts connected to vCenter

 Requirement: Need to gather all the service tags and hardware models of ESXi hosts connected to vCenter.   Script: To be saved as ps1 script and execute it and create temp directory to save the file. $vcenter = Read-Host "vCenter" $cred = Get-Credential Connect-VIServer $vcenter -Credential $cred $result = Get-VMHost | ForEach-Object {     $h = $_     $esxcli = Get-EsxCli -VMHost $h -V2     try {         $bmc = $esxcli.hardware.ipmi.bmc.get.Invoke()         # Extract IPv4 only         $ipv4 = $bmc.IPv4Address         [PSCustomObject]@{             Host        = $h.Name             IPv4Address = $ipv4         }     }     catch {         [PSCustomObject]@{             Host        = $...

Script to collect LLDP Information of all the hosts connected to vCenter

  Challenge : To have a clean inventory of host to switch mapping, we had to gather the lldp information of all the ESXi hosts. It would be easier if the hosts are a few/ in a single digit.  We had to find an easy and automated script which can generate the output.  Pre-requisites : 1) Requires power-cli to be installed. 2) Install-Module -Name VMware.PowerCLI -Scope CurrentUser  Powershell script :  1) To ignore ssl certificate error Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$true  2) Script to connect to vCenter and provide valid credentials, and the script will provide the output in a csv format to the provided location, which can be customized.  # Array of vCenter Server names or IP addresses $vCenterServers = @("192.168.1.62") # Add all your vCenter Servers here # Output file path $OutputPath = "C:\Users\asyed\Documents\ESXi_LLDP_Report1.csv" # Change this to your desired output path # --- Script Start --- Write-Host "Con...

Convert an activated Windows 2019 Standard VM to Windows 2019 Datacenter VM

Requirement: To convert a windows activation from Windows 2019 STD to Windows 2019 DC   Issue: Unable to convert using dism command    What has been done: After reviewing the logs and few online documentation, found a procedure to first forcefully convert the license to GVLK.  GVLK: Microsoft Generic Volume License Key  Procedure followed: Running the following commands from the powershell CLI  1) dism /online /Get-CurrentEdition  2) dism /online /Get-TargetEditions 3)  DISM /online /Set-Edition:ServerDatacenter /ProductKey:WMDGN-G9PQG-XVVXX-R3X43-63DFG /AcceptEula  reboot  Once the VM is back online  4) DISM /online /Set-Edition:ServerDatacenter /ProductKey:own-key /AcceptEula     This will convert the windows edition from STD to DC

System Recovery Partition Disk Blocks The Extension of Windows Disk - Sysprep Issues

Requirement : Windows Activated Template on vCenter  Issue : After the windows is installed, system recovery partition end up created next to windows disk.  Resolution Credit : Mohammed Junaid Ahmed                           Resolution :  1) Create a VM using standard procedure on vCenter  2) Power ON the VM and follow below screen instructions  Click Next   Click on ' Repair your computer '  Click on Troubleshoot       Click on Command Prompt     You should see the command prompt Begin with Diskpart   Click Turn off your PC Restart your computer and continue windows installation, and you will see the disk partitions as below
 VCF 9.0.1 How to update DNS IPs for VCF 9.0.1 environment. While deploying the VCF, I deployed it with only one Domain Controller which was serving NTP & DNS for the deployment itself. Post deployment, I had to reboot the DC and realised that there is only one DNS and NTP serving the whole stack, so I had to build a redundant DC and join it as secondary DC.  Once I finished with secondary DC, I had to update the secondary IP address on all the components, so make the new IP usable on all components, you have to update it on SDDC Manager and follow these steps. I have used VCF API Explorer in the SDDC Manager's Developer Center. Step 1: Perform a GET request to view the current configuration. Step 2: Perform a PUT request with the updated DNS servers in the request body, ensuring the isPrimary flag is set correctly for each server.  For example: {   "dnsServers": [     {       "ipAddress": "172.16.128.225",       "isPrim...
  Resolving Cross-vCenter Migration Issues with Large VMs (>30TB) Credits of this article: During cross-vCenter migrations, we encountered issues with large VMs (>30TB), resulting in prolonged migration times (days) and frequent failures (every 3rd migration). VMware support provided a workaround to extend the port reservation timeout. *Workaround Steps:* Step 1:  SSH to vCenter and take a backup `vpxd.cfg`:  cp /etc/vmware-vpx/vpxd.cfg /etc/vmware-vpx/vpxd.cfg.bak   Step 2:   Edit `vpxd.cfg` and add below ``` <vpxd> <dvs> <PortReserveTimeoutInMin>7200</PortReserveTimeoutInMin> </dvs> </vpxd> ```   This extends the port reservation timeout to 5 days (7200 minutes). 1. Restart `vpxd` service: ` service-control --restart vmware-vpxd ` 2. Retry vMotion for large VMs. 3. Post-migration, revert `vpxd.cfg` to its original state: `cp /etc/vmware-vpx/vpxd.cfg.bak /etc/vmware-vpx/vpxd.cfg` 4. Restart `vpxd` service ag...

Renew SSL Certificate for vCloud Director 10.4

Hello There, I would like to give credit for this article to my colleague Muhannad S. Aljaghthami who worked on this task and gave us full insight on how to do. Now lets talk about replacing an expired/ about to expire SSL certificate for the vCloud Director application which is hosted on internet. Prerequisites: Digicert Certificate utility for windows.  Putty/Mobaxterm application for SSH to vCD cells. Winscp to transfer the files to vCD cells. SSH access should be validated on vCD Cells Backup tool to take a backup of vCD cells. Versions & products used while writing this article: vCloud Director 10.4 NSX AVI 22.1.1 Step by step procedure: Initiated a CSR request using Digicert utility for windows and shared the CSR with the team who manages the SSL certificates.  Post submission of CSR,we received the root & SSL certificate for our vCloud Director URL. Using the Digicert utility, we have extracted the pfx file and key file, sample screenshot below.     No...

VCF Host expansion task failed at "Validate vSAN disks for ESXi Host(s)"

Hello There, This article briefs about an issue faced during expanding the cluster with vSAN ready node via SDDC Manager. VCF: 4.5.0 ESXi : VMware ESXi 7.0.3 build-20328353 Thanks to my colleague Ahmed Alameri for his contribution. We were recently working on cluster expansion via SDDC Manager and the task was failed at "Validate vSAN disks for ESXi Host(s)" We had to quickly login to the ESXi host and check if the disks are healthy and are eligible to be used for vSAN. We enabled SSH service on the host, and through CLI we validated if the disks were eligible for vSAN by running command ' vdq -q ' Output Sample: [    {       "Name"     : "t10.NVMe_NVMe_Pxxxx_MU_U.2_1x.xTB________000xxxxxxxxx",       "VSANUUID" : "",       "State"    : "Eligible for use by VSAN",       "Reason"   : "None",       "IsSSD" ...

How to get iDRAC IP from ESXi

Hello There, In this article, I shall share you with two commands in order to get the iDRAC IP address from esxcli or localcli 1) esxc li command: esxcli hardware ipmi bmc get 2) localcli command: localcli hardware ipmi bmc get                                                

JobQueue is full in iDRAC and unable to upgrade firmware??

  Hello There, I was working recently on upgrading the firmware for Dell Power Edge servers due a requirement. As usual, I did the download of the necessary firmware update file and uploaded it in the iDRAC and started the upgrade. Waited for couple of minutes, If I can say, it was almost 15 minutes without any progress. I tried to check the log/job queue in the iDRAC and found it was full of old entries and I tried clearing it but found no option. Later after findings, I managed to find a command which clears the jobqueue, and below is the command I used after logging into iDRAC via SSH. racadm jobqueue delete -i JID_CLEARALL_FORCE Once the above command was executed, I tried to login to iDRAC and check the job queue and found everything was cleared. Whats next?? Tried uploading the file again and then managed to successfully update the firmware.

Not able to access the console of VM over the internet - vCloud Director

What to do if you are not able to access the virtual machine console from the vCloud Director based portal My first thought is, is it because of SSL certificates?? was it ?? No... It wasn't.   I tried inspecting from the browser to understand the flow but found everything normal.   Later found out that its a common issue with v10.2 and can be fixed by running below command on all the cells.     /opt/vmware/vcloud-director/bin/cell-management-tool manage-config -n consoleproxy.cores.max -v "0"   service vmware-vcd restart     The workaround applied will set the console connections counter to unlimited.

Having an issue for getting vxlan vmk installed on ESXi host?

Hi There, I was working on a host expansion and unfortunately after following the standard procedure, NSX manager was not able to install the vxlan vmkernels. The first thing I had to do is to put the host into cluster in maintenance mode and immediately had to follow the log file esxupdate.log file under the folder /var/log/ and then found the below error for three vibs. ESXi : 6.7 build # 13981272 NSX: 6.4.4 ----------------------------------------------------------------------------------------------------------------------------- esxupdate: 2106395: esxupdate: ERROR: vmware.esximage.Errors.DependencyError: VIB QLC_bootbank_qedi_2.10.15.0-1OEM.670.0.0.8169922 requires qedentv_ver = X.11.6.0, but the requirement cannot be satisfied within the ImageProfile.  esxupdate: 2106395: esxupdate: ERROR: VIB QLC_bootbank_qedf_1.3.35.0-1OEM.600.0.0.2768847 requires qedentv_ver = X.11.6.0, but the requirement cannot be satisfied within the ImageProfile.  esxupdate: 2106395: esxupdat...