Posts

PowerCLI Script - Create a report of Virtual Machines and ESXi hosts in your infra

Image
This needs PowerCli installed https://code.vmware.com/web/tool/11.5.0/vmware-powercli 1) Download the script https://github.com/msexpertzone/VMware-PowerCLI/tree/master/vSphereInfraReport 2) Copy it to a folder and create a "Report" folder in it. 3) Update your vCenter FQDNs in vCenterList.txt file. If there are more than one vCenter, add the second one in a new line 4) Open PowerShell as administrator 5) Run the script and wait for the inventory to complete. > AllVMReport.ps1 = Will get you report of All VMs > ESXIReport.ps1 = Fetched ESXi details 6) Report is saved individually in "Report" folder Both scripts can run parallel. Note Permissions The account that's used to run the script needs Read Only permissions in vCenter. Apart from that the user also needs CIM permission to read hardware details that's collected part of  ESXIReport Script. 

vSphere Infra - Disable TLSv1 and TLSv1.1

Image
vSphere Infra - Disable TLSv1 and TLSv1.1 below are the methods used in vSphere 6.5 and 6.7 Disable TLSv1 and TLSv1.1 on vCenter Server Appliance 1) Scan to check current status /usr/lib/vmware-TlsReconfigurator/VcTlsReconfigurator/reconfigureVc scan Above scan result shows us there are TLSv1.0 and TLSv1.1 enabled.  2) Now to enable only TLS1.2 use below command Note-: This is not a live change. Proceeding this step will restart vCenter services.  /usr/lib/vmware-TlsReconfigurator/EsxTlsReconfigurator/reconfigureVc update -p TLSv1.2 Once complete you can see Disable TLSv1 and TLSv1.1 on ESXi servers 1) On VCSA appliance CD to ESXTLSReconfigu cd /us r/lib/vmware-TlsReconfigurator/EsxTlsReconfigurator You have three options. a) Run it against ESXi host / ESXi hosts b) Run it against vCenter Cluster / vCenter Clusters To run it against a vCenter cluster /  vCenter clustes   ./reconfigureEsx vCenterCluster -c Cluster_Name -u Administrative_vCenter_User -p TLSv1.2 Comm...

Configure Health Check Monitor for Horizon View Connection Server 7.X

Image
Configure Health Check Monitor for Horizon View Connection Server 7.X If you are looking got a LB health check that would know when you disable connection servers using view admin page, below is the one for you. Interval -: 30 TimeOut -: 91 Send String -: GET /favicon.ico HTTP/1.0 Receive String -: ^HTTP/1.[01] (200) You can check https://<ip or fqdn of your connection server>/ favicon.ico , this is basically a Horizon View Icon, that's available only when services are up!  ++ On your Pool, it's recommended to set  Slow Ramp Time as 300 Seconds 

Horizon View - "Failed to connect to Connection Server" when accessed via LB WIP or DNS alias

Image
Scenario Horizon View - "Failed to connect to Connection Server" when accessed via LB WIP or DNS alias Works fine when accessed with server FQDN Solution If you are facing this issue after upgrading to view 7.X, you are not alone! And this is not an issue. It's a new security feature part of 7.X and can be disable by steps mentioned in this KB. https://kb.vmware.com/s/article/2144768 All you need to do is  > Create file with the name locked.properties > Add line " checkOrigin=false" ( without quotes) > Save and copy this to C:\Program Files\VMware\VMware View\Server\sslgateway\conf folder on all your connection servers. > Reboot them or restart connection service on them one by one like you normally do

VMware Horizon View 7.X desktop “Agent unreachable” status

Image
Scenario -:  We had a VDI user reporting issues connecting to his VDI machine. Checking View Admin page shows this VDI machine  First thing first 1) Checked vCenter and made sure that the VM is up and running, not down or suspended.  2) I could remote desktop to it and checked services 3) Restarted Agent Service. No luck 4) Rebooted VM, no luck there too. Started to look at the logs at this point C:\ProgramData\VMware\VDM\logs debug-2019-12-12-150326.txt 2019-12-12T15:03:35.940+10:00 DEBUG (25A0-26C4) <Thread-4> [AgentMessageSecurityHandler] Configuring message security (ON). 2019-12-12T15:03:36.033+10:00 DEBUG (25A0-26C4) <Thread-4> [BrokerUpdateUtility] Published CHANGEKEY request 2019-12-12T15:03:51.035+10:00 DEBUG (25A0-26C4) <Thread-4> [BrokerUpdateUtility] Timeout waiting for success response So looks like it was trying to change the Key, but wasn't successful. So I decided to push it from Connection server instead  1) Login to one of out View...

vCenter SSO User password Expired

We had a vCenter SSO user created for SRM and it's password expired. Here is how you can check it and fix it. User name is srm@vsphere.local 1) Login to VCSA with SSH and below are commands root@vcenterserver [ ] cd /usr/lib/vmware-vmafd/bin/ root@vcenterserver [ /usr/lib/vmware-vmafd/bin ]# ./dir-cli user find-by-name --account srm --level 2 Enter password for administrator@vsphere.local: Account: srm UPN: srm@VSPHERE.LOCAL Account disabled: FALSE Account locked: FALSE Password never expires: FALSE Password expired: TRUE root@vcenterserver [ /usr/lib/vmware-vmafd/bin ]# ./dir-cli user modify --account srm   --password-never-expires Enter password for administrator@vsphere.local: Password set to never expire for [srm]. root@vcenterserver [ /usr/lib/vmware-vmafd/bin ]# ./dir-cli password reset --account srm --password XXXXXXXX  

applmgmt service wont start on PSC Appliace post converge operation

Scenario We had a vCenter with External PSC. We converged them and converge job was successful execpt a cert warning. After a week we tried to decommission the old PSC appliance and found that the status is shown in WebClient as "Unknown" Up on checking we found  applmgmt in stopped state. Tried to start it but it failed with below error [ ~ ]# service-control --status Running:  lwsmd pschealth vmafdd vmcad vmdird vmdnsd vmonapi vmware-analytics vmware-certificatemanagement vmware-cis-license vmware-cm vmware-rhttpproxy vmware-sca vmware-sts-idmd vmware-stsd vmware-vapi-endpoint vmware-vmon Stopped:  applmgmt vmware-statsmonitor [ ~ ]# service-control --start applmgmt Operation not cancellable. Please wait for it to finish... Performing start operation on service applmgmt... Error executing start on service applmgmt. Details {     "detail": [         {             "tra...