How to renew vSphere 6.5 & 6.7 certificates.

When the VCenter Certificate is expired , you will be blocked from logging in to the VCenter . However , the Appliance Management will continue to work. Be noted that there a 2 categories of certificates.

  • VMware Security Token Service (STS)
  • Solution , Machine , Root and Other certificates.

Import Notes:

  1. You could avoid all these messy steps , had you monitor and check for the
    warnings on the VCenter Administration page for Certificate expiry events.
  2. For Windows based VCenter , you can refer the same KB’s mentioned here for the detailed steps.
  3. You may face an error when uploading the scripts to the VCSA via WinSCP . The Solution is provided in the same KB’s.
  4. Certificate Manager may fail during the process , you could refer the https://mueller-tech.com/2019/06/28/replacing-expired-certificates/ for the solution.

I used the below mentioned steps to confirm the expiry date for both of these certificates

STS – Please refer the KB:
https://kb.vmware.com/s/article/79248 (It will require to download a script – checksts.py)

Others – Run the below command in the VCSA.
for i in $(/usr/lib/vmware-vmafd/bin/vecs-cli store list); do echo STORE $i; sudo /usr/lib/vmware-vmafd/bin/vecs-cli entry list –store $i –text | egrep “Alias|Not After”; done

In my situation , both of the certificate types were expired and I had to replace all of them. To replace the STS certifcate , you could utilize a script provided by VMWare (fixsts.sh) using the KB : https://kb.vmware.com/s/article/76719

Once it is done , you need to restart the VCenter services using the below commands.

service-control –stop –all

service-control –start –all

service-control –status.

Thereafter , you could proceed to replace the other certificates using the VSphere Certificate Manager https://kb.vmware.com/s/article/2112283

July 13, 2021 at 3:38 pm Leave a comment

How to verify SPF/DKIM/DMARC/DomainKey/RBL tests parsed on the email.

Hi All

In some situations , when an email is blocked by the antispam device , you need to analyze the headers to findout the actual root cause. However , sometimes the blocked reasons shown by the antispam device are not descriptive especially when you are troubleshooting DKIM related failures.

This is crucial as we need notify the sender’s domain owner to rectify the issues. In these cases you could use the below tool to analyze the tests performed in the email and findout the actual reason for the email blockage in a much descriptive manner.

https://www.appmaildev.com/en/dkimfile

I found it very useful , and thought of sharing it with the community.

Good luck guys.

December 31, 2020 at 12:01 pm Leave a comment

DCPromo Fails – The directory service is missing mandatory configuration information

Last week , we worked on a AD migration project. This project involved deploying a Windows 2016 based Domain Controller and then decommission the Windows 2008R2 domain controller.

We successfully transferred the FSMO roles . During the decommissioning process when we ran the dcpromo command we received the error “The directory service is missing mandatory configuration information”

During the troubleshooting the  MS KB (https://docs.microsoft.com/en-us/troubleshoot/windows-server/identity/dcpromo-demotion-fails) was pointing us to correct direction. The issue was related to  fsmoroleowner attribute  on CN=Infrastructure is not set properly. In my case it was pointing to the server which I am trying to demote.

You can see this by opening ADSI Edit;

Right click the ADSI Edit root and click on Connect to…
Use the following connection point: DC=DomainDNSZones,DC=abc,DC=local  (Replace it with your actual AD DNS Zone)
Click on Default Naming Context [DC.abc.local] to populate it.
Click on DC=DomainDNSZones,DC=abc,DC=local folder.
Double click on CN=Infrastructure.
Locate the fSMORoleOwner attribute

Ensure you connect to DC=ForestDNSZones as well to verify the attribute.

In my case DomainZones was showing the correct DC .But the ForestDNSZones pointing to the Windows 2008R2 Server.

I have tried the manual method using the ADSI Edit to change the value. However it was failing with the error  “The role owner attribute could not be read”

In this case you need to refer the MS KB https://docs.microsoft.com/en-us/troubleshoot/windows-server/identity/dcpromo-demotion-fails to create the .vbs file to fix this issue.( I have seen suggestions to run the dcpromo /forceremoval instead and then run a metadata cleanup. I do not recommend this approach)

The script provided in the KB does not work due to incorrect end statements. Luckily the Blogger veducate.co.uk (https://veducate.co.uk/dcpromo-fails-missing-mandatory-configuration/) have provided a fixed version.

NOTE: You need to  run these commands from the current owner of the FSMO roles.

Create a .vbs file via CMD
fsutil file createnew fixfsmo.vbs 0

Copy the below contents to the file
================================================

const ADS_NAME_INITTYPE_GC = 3
const ADS_NAME_TYPE_1779 = 1
const ADS_NAME_TYPE_CANONICAL = 2

set inArgs = WScript.Arguments

if (inArgs.Count = 1) then
‘ Assume the command line argument is the NDNC (in DN form) to use.
NdncDN = inArgs(0)
Else
Wscript.StdOut.Write “usage: cscript fixfsmo.vbs NdncDN”
End if

if (NdncDN <> “”) then

‘ Convert the DN form of the NDNC into DNS dotted form.
Set objTranslator = CreateObject(“NameTranslate”)
objTranslator.Init ADS_NAME_INITTYPE_GC, “”
objTranslator.Set ADS_NAME_TYPE_1779, NdncDN
strDomainDNS = objTranslator.Get(ADS_NAME_TYPE_CANONICAL)
strDomainDNS = Left(strDomainDNS, len(strDomainDNS)-1)

Wscript.Echo “DNS name: ” & strDomainDNS

‘ Find a domain controller that hosts this NDNC and that is online.
set objRootDSE = GetObject(“LDAP://” & strDomainDNS & “/RootDSE”)
strDnsHostName = objRootDSE.Get(“dnsHostName”)
strDsServiceName = objRootDSE.Get(“dsServiceName”)
Wscript.Echo “Using DC ” & strDnsHostName

‘ Get the current infrastructure fsmo.
strInfraDN = “CN=Infrastructure,” & NdncDN
set objInfra = GetObject(“LDAP://” & strInfraDN)
Wscript.Echo “infra fsmo is ” & objInfra.fsmoroleowner

‘ If the current fsmo holder is deleted, set the fsmo holder to this domain controller.

if (InStr(objInfra.fsmoroleowner, “\0ADEL:”) > 0) then

‘ Set the fsmo holder to this domain controller.
objInfra.Put “fSMORoleOwner”, strDsServiceName
objInfra.SetInfo

‘ Read the fsmo holder back.
set objInfra = GetObject(“LDAP://” & strInfraDN)
Wscript.Echo “infra fsmo changed to:” & objInfra.fsmoroleowner

End if

End if

=================================================

Run the file twice as below
1) cscript fixfsmo.vbs dc=forestdnszones,dc=abc,dc=local

2) cscript fixfsmo.vbs dc=domaindnszones,dc=abc,dc=local

Voila , The fsmoroleowner attribute got updated with the correct server name , and  I was able to demote the server successfully.

Source: (Helped me to fix the syntax errors on script provided by Microsoft)

DCPromo Fails – The directory service is missing mandatory configuration information

 

Thanks.

 

November 19, 2020 at 2:56 pm Leave a comment

How to create a Ubuntu 18.04.5 template in VSphere ESXi 6.7

As usual you need to create a VM and install Ubuntu in to it. Thereafter you need to follow the below steps to strip out the unique data being propagated to the VM’s you create from the template.

+Update the OS
#sudo apt -y update
#sudo apt -y upgrade

+Clear audit logs
truncate -s0 /var/log/wtmp
truncate -s0 /var/log/lastlog

+Clear the tmp
#rm -rf /tmp/*
rm -rf /var/tmp/*

+Clear the SSH
#rm -f /etc/ssh/ssh_host_*

+Reset the hostname
#sed -i ‘s/preserve_hostname: false/preserve_hostname: true/g’ /etc/cloud/cloud.cfg
#truncate -s0 /etc/hostname
#hostnamectl set-hostname localhost

+Clean apt
#apt clean

+Remove the default *.yaml file from the /etc/netplan. The VMware customizaion will create it’s own file 99-netcfg-vmware.yaml.
#rm -f /etc/netplan/*.yaml

+Reset the machine id
#echo -n > /etc/machine-id

+Clear the history & shutdown the VM
#history -c
#shutdown -h now

On the vCenter you need to create a VM Customization specification to be used when deploying the VM’s from the template(Refer:How to create a RHEL 7 template in VSphere ESXi 6.7 for steps).

However , when I created the VM’s from this template I realised that

  • All the VM’s are having the same hostid. Some applications uses the hostid in their licensing .Thus, it has to be unique across the VM’s. Since I did not find a way to solve this while deploying the VM’, I had to do a manual modification as mentioned below on the VM’s after it being created.

    #vi /etc/hosts
    replace the line “127.0.1.1 localhost” with
    your IP FQDN Hostname (E.g: 1.1.1.1 server.test.local server).

  • You need to manually select the “Connected” option in The VM network Adapter in the VM properties.

October 14, 2020 at 4:19 pm Leave a comment

The Microsoft Exchange Replication service couldn’t find a valid configuration for database ‘mydb’ on server ‘server1’. Error: An Active Manager operation failed. Error: The active copy for database could not be determined:

Recently one of our customer had an Exchange Server outage. Whereas one of the node from 2 node DAG was not able to communicate with other server. We tried to rebooting the server but no luck . The symptoms were

– Cluster service was not starting.
– On the other node FCM was not able to connect to the DAG cluster.
– Unable to open the ECP/OWA.
– Outlook / Mobile Users cannot access their mailboxes.

The environment consist of 2 Exchange Server 2016 & DAG.

So we started with removing the failed node by typing the below commands in the healthy exchange server:
# Open Exchange PowerShell
#Get-ClusterNode -Name node1 | Remove-Clusternode
# net stop clussvc
# net start clussvc 
# Remove-DatabaseAvailabilityGroupServer -Identity “DAG Name” -MailboxServer “Failed Exchange Server Name” -ConfigurationOnly
# Get-ClusterNode “Failed Exchange Server Name” | Remove-ClusterNode

However , still no luck. Then we tried to remove the mailbox database copies form the failed node(I believe the copies were active on the second server) we got a new error stating that “Mailbox databse copies cannot be disabled on the Databases with circular logging enabled. So we had to remove the circular logging and then delete the database copies.

#Get-MailboxDatabse | Set-MailboxDatabase -CircularLoggingEnabled $False
# Get-MailboxDatabaseCopy -Identity “DatabaseName” |Remove-MailboxDatabaseCopy -Identity “DatabaseName\ServerName”

Now it is the time for mounting the databses: When we ran the below command

#Get-MailboxDatabase | Mount-Database

We received the below error”

Failed to mount database “———-“. Error: An Active Manager operation failed. Error: An Active Manager operation
encountered an error. To perform this operation, the server must be a member of a database availability group, and the
database availability group must have quorum. Error: Automount consensus not reached (Reason: FSW boot time did not
match (FSW-Remote: 2020-10-01T11:37:09.4930830Z FSW-Reg: 0001-01-01T00:00:00.0000000)). [Server:———-]
+ CategoryInfo : InvalidOperation: (—-:ADObjectId) [Mount-Database], InvalidOperationException
+ FullyQualifiedErrorId : [Server=————,RequestId=5022acdd-0c48-4584-b2eb-1d0a2c692f0d,TimeStamp=10/7/2020
11:09:14 AM] [FailureCategory=Cmdlet-InvalidOperationException] BCF4F25E,Microsoft.Exchange.Management.SystemConfi
gurationTasks.MountDatabase

Here , we wanted to check the DAG status

#Get-DatabaseAvailabilityGroup -status

Output :

WARNING: Unable to get Primary Active Manager information due to an Active Manager call failure. Error: An Active
Manager operation failed. Error: An Active Manager operation encountered an error. To perform this operation, the
server must be a member of a database availability group, and the database availability group must have quorum. Error:
Automount consensus not reached (Reason: FSW boot time did not match (FSW-Remote: 2020-10-01T11:37:09.4930830Z FSW-Reg:
0001-01-01T00:00:00.0000000)). [Server: ———-]

Name : DAGName
Memberservers: {Server1}
Operational Servers {}

The output confirmed that there a no operatinal servers. So we had to restart the DAG with the surviving node.

#Start-DatabaseAvailabilityGroup -Identity “DAGNAME” -MailboxServer ServerName”

Now the Get-DatabaseAvailabilityGroup -status cmd will gave the below output:

Name : DAGName
Memberservers: {Server1}
Operational Servers {Server1}

Now it is the time for mounting all the databases:

Get-MailboxDatabase | Mount-Database

Voila , The MailboxDatabases were started mounting and the ECP access is restored.

October 7, 2020 at 3:39 pm Leave a comment

Free Radius : Auth: (0) Invalid user (Rejected: User-Name contains multiple ..s): [xxx]

Recently we performed a Yum update on our Free Radius Server. The newer version is FreeRADIUS Version 3.0.13. At that time , we started receiving complains from the users that they are not able to login to the network devices.

After reviewing the logs , we noticed the error “Auth: (0) Invalid user (Rejected: User-Name contains multiple ..s)” being logged during the authentication. This is due to the changes applied in the filter file(/etc/raddb/policy.d/filter ).

Before Update:

if (&User-Name =~ /\\.\\./ ) {

After Update:

if (&User-Name =~ /\.\./ ) {

The new Regex syntax style doesn’t escape backslashes anymore. So you need to ensure that the correct_escapes = true property is set in /etc/raddb/radiusd.conf.

Source:https://access.redhat.com/solutions/3241961

September 27, 2020 at 11:34 am Leave a comment

How to update ESXi 6.x using an Offline Bundle

We all know there are multiple ways to upgrade the ESXi to the desired version. In this post I am going to discuss about upgrading the ESXi using an offline bundle. In my opinion this method is much convenient when you are having a single ESXi host , or you want a more controlled upgrade process. The steps are very minimal.(Please make sure that , you have powered off all the VM’s and the Host is put to the Maintenance mode)

– Download the ESXi bundle and upload it to a Datastore.
– Login to the ESXi via SSH.

Run the below command to verify the bundle

#esxcli software sources profile list -d /vmfs/volumes/datastore1/VMware-ESXi-6.7.0-Update3-15160138-HPE-Gen9plus-670.U3.10.5.5.25-Mar2020-depot.zip

Output:

Thereafter , run the below command to install the file.

#esxcli software profile update -p HPE-ESXi-6.7.0-Update3-Gen9plus-670.U3.10.5.5.25 -d /vmfs/volumes/datastore/VMware-ESXi-6.7.0-Update3-15160138-HPE-Gen9plus-670.U3.10.5.5.25-Mar2020-depot.zip

-p xxxxxxxxx (Name of the ESXi bundle as per the output).

Once the process is completed you need to reboot the server(The host may restart automatically for the 2nd time as well).

Update1: In case if you receive an error “Could not find a trusted signer” ., when you try to install you can run the same command with –no-sig-check as below:

#esxcli software profile update -p HPE-ESXi-6.7.0-Update3-Gen9plus-670.U3.10.5.5.25 -d /vmfs/volumes/datastore/VMware-ESXi-6.7.0-Update3-15160138-HPE-Gen9plus-670.U3.10.5.5.25-Mar2020-depot.zip –no-sig-check

September 21, 2020 at 3:00 pm Leave a comment

How to properly update kernel in RHEL/CentOS 7/8 Linux

When you perform a yum update in CentOS 7 or higher , you will notice the newer kernel version is not reflected. You can use the below commands to verify the current version.

#uname -r
#hostnamectl

You can confirm whether the new kernel is installed successfully or not by using the command below;

#yum list kernel
#grep saved /boot/grub2/grubenv

In order to apply the kernel you need to restart the server.

In some instances you need to manually set the correct kernel version to boot by using the below commands;

#awk -F\’ ‘$1==”menuentry ” {print i++ ” : ” $2}’ /etc/grub2.cfg

(If you have multiple versions installed all of them will be listed with 0 , 1 & etc. In the example the newer version is 0,)

#sudo grub2-set-default 0

Source1: https://www.howtoforge.com/
Source2: https://www.golinuxcloud.com/

September 20, 2020 at 2:25 pm Leave a comment

“ Error 432 4.3.2 STOREDRV.Deliver; recipient thread limit exceeded in Exchange 2016

One of our customer complained that the Internal E-mails are not being delivered. When we checked the Queue Viewer we observed the emails are stuck at the queue with the error “Error- 432 4.3.2 STOREDRV.Deliver; recipient thread limit exceeded”

This could be due to large number of emails being sent internally(either to one mailbox / several mailboxes).In our case , the customer’s processing server was down for some days, and when it was restored it started sending all the backlog emails.

To overcome this issue we had to temporarily disable the throttling , by adding the below text in the EdgeTransport.exe.config file(located in the Exchange Bin Folder)

add key=”MailboxDeliveryThrottlingEnabled” value=”False”

(Some articled recommends to add the value in the MSExchangedelivery.exe.config file instead).

Thereafter , you need to restart the MS Exchange Transport & Exchange Mailbox Transport Delivery services.

In case if you don’t completely disable the throttling you could add the below keys.

add key=”RecipientThreadLimit” value=”2″
add key=”MaxMailboxDeliveryPerMdbConnections” value=”3″

Good Luck.

September 17, 2020 at 3:33 pm Leave a comment

How to modify the iSCSI initiator ID in Linux

When you deploy Linux VM’s using a Template (in ESXi) ,you may come across a situation , where the iSCI initiator ID on these VM’s will be identical. To resolve this issue we need to modify the iscsi initiator ID’s.

In case if you have logged in to the iscsi session already you need to log out first.

#iscsiadm -m node -T iqn.xxxxxxxxxxxxxx -p iscsiserver-ip -u

Thereafter:

backup the file initiatorname.iscsi
#cp /etc/iscsi/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi.bak

#echo “InitiatorName=`/sbin/iscsi-iname`” > /etc/iscsi/initiatorname.iscsi

You can login again to the iscsi session
#iscsiadm -m node -T iqn.xxxxxxxxxxxxxx -p iscsiserver-ip -l


Source:https://www.thegeekdiary.com/



September 15, 2020 at 8:47 am Leave a comment

Older Posts


Archives

Categories

Follow Hope you like it.. on WordPress.com

Blog Stats

  • 44,073 hits

%d bloggers like this: