Download EJBCA certificate with powershell

i came up with this today

add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
    public bool CheckValidationResult(
        ServicePoint srvPoint, X509Certificate certificate,
        WebRequest request, int certificateProblem) {
        return true;
    }
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

you can look up the thumbprint to compare which one it is
get-childitem Cert:\CurrentUser\My

$superadmin = get-childitem Cert:\CurrentUser\My\YOUR_SUPERADMIN_CERT_HASH
invoke-webrequest -Uri "https://infralab.local:32768/ejbca/publicweb/webdist/certdist?cmd=lastcert&installtobrowser=&subject=CN%3dgregu.host.com&format=chain&hidemenu=false" -method "Get" -Certificate $superadmin

what's left is to generate the cert order via csr. this just just downloading the already made cert.

polaris powershell rest api server

Add basic authentication for the REST API built using PowerShell Polaris module.

https://github.com/PowerShell/Polaris

https://github.com/Stephanevg/PSHTML

https://github.com/stijnc/polaris-pshtml-docker

vSphere Lookup Service MOB

https://<vcenter-FQDN>/lookupservice/mob

Using this link:

https://<center-FQDN>/lookupservice/mob/?moid=ServiceRegistration&method=List

You can access the list() method, you have to fill out the filterCriteria

Leave it ‘blank’:

<filterCriteria>
</filterCriteria>

and click the Invoke Method.

From the vCenter appliance itself you can  use the list() method using the lstool.py

/usr/lib/vmidentity/tools/scripts/lstool.py list –url https://localhost/lookupservice/sdk –no-check-cert | grep -v ‘SSL’

Mind that it will hide the SSL part to make screen content  more readable.

 

Matching physical disk in Dell R720 with vSan disk using naa and perccli

Really short:

check you naa in vsphere/vsan you are looking for, then using perccli installed in your esxi use:

./perccli /c0 show all | grep -i -B6 ‘WWN = 58cf32ee203db4d4’

Drive /c0/e15/s4 device attributes :
==================================
Manufacturer Id = TOSHIBA
Model Number = PX05SMB080Y
NAND Vendor = NA
SN = 6820A0FGTEFE
WWN = 58cf32ee203db4d4

Where, s4 is your slot where the disk resides, and you can also double check via idrac if s/n matches the drive in slot.

Virtual Center 6.7U1b upgrade fails with: Update installation failed, vCenter is non-operational

In order to reproduce, get a VC/PSC 6.7 . Make the /storage/log full 100% . Installation fails with unexpected problem.

2019-03-07 14_29_49-host1.greg.labs - VMware ESXi.png

Step two, you clean up the /storage/log a bit and it still fails.

2019-03-07 14_31_15-host1.greg.labs - VMware ESXi.png

After this i made sure that there is 98% free.  And same error occurs.

You can reboot PSC/VC as many times as you want, that  does not help. In order to fix it, login to your VC/PSC box and delete file:

/etc/applmgmt/appliance/software_update_state.conf

After file is gone, or moved , go back to installer and click update -> it works !

Have a look what was causing the error :

2019-03-08 13_23_22-vCenter Server Appliance11.png

And the installer script was looking at it hence failing while spotting INSTAL_FAILED with this cryptic error message that the vcenter is not operational

/usr/lib/applmgmt/update/py/vmware/appliance/update/update_state.py

2019-03-08 13_26_13-vc001-psc001 - VMware Remote Console33.png

Many thanks to Ciaran from @VMware  for spotting that!