We made it!, vExpert 2019

We made it!, vExpert 2019
Use the below commands to check and delete the stale indoe
for f in $(find /var/run/vmware -type l); do if [ ! -e "$f" ]; then echo "$f"; fi; done > /tmp/suspect
find /var/run/vmware -type l | while read f; do if [ ! -e "$f" ]; then rm -f "$f"; fi; done
For instructions on how to connect to VMware PowerCLI, Follow the post here:
Run the below to get the list of orphaned VM
$allVMs=Get-VM
foreach ($vm in $allVMs) {
if ($vm.ExtensionData.Runtime.ConnectionState -eq "orphaned") {$vm.name}
}
Run the below to remove orphaned VM
foreach ($vm in $allVMs) {
if ($vm.ExtensionData.Runtime.ConnectionState -eq "orphaned") {$vm | Remove-VM}
}
Using the GUI to set up email alerts for the default alarm might be time-consuming. In this post I will show you how to use VMware PowerCLi to automate re-configuring the existing, Default alarms with the notification email address.
You will need VMware PowerCLi to run through this. if you dont have this installed already, follow the instructions found here.
Use The below script to change the enable Default email action to the email address specified in the $newEmail=” field
$newEmail = '[email protected]'
foreach ($alarm in Get-AlarmDefinition){
$action = Get-AlarmAction -AlarmDefinition $alarm
$mail = $action | where {$_.ActionType -eq 'SendEmail'}
New-AlarmAction -AlarmDefinition $alarm -Email -To $newEmail -Subject $mail.Subject -Confirm:$false
}
add user
adduser username
usermod -aG sudo username
allow user to ssh to the appliance
edit /etc/ssh/sshd_conf and add the user account here
change default shell to bash for ssh to work.
chsh -s /usr/local/bin/bash username
Desktop hardware’s are normally include Realtek nic which do now work in a base install of Esxi. In this article, The below post will walk you through steps to get Realtek nic working
Determine the nic hardware by running the below command:
root@Ryzen:~] lspci -v | grep "Class 0200" -B 1
0000:03:00.0 Network controller Ethernet controller: Realtek Semiconductor Co., Ltd. Onboard Ethernet
Class 0200: 10ec:8168
--
0000:07:00.0 Network controller Ethernet controller: QLogic Corporation QLogic NetXtreme II BCM5709 1000Base-T [vmnic2]
Class 0200: 14e4:1639
--
0000:07:00.1 Network controller Ethernet controller: QLogic Corporation QLogic NetXtreme II BCM5709 1000Base-T [vmnic3]
Class 0200: 14e4:1639
--
0000:08:00.0 Network controller Ethernet controller: QLogic Corporation QLogic NetXtreme II BCM5709 1000Base-T [vmnic0]
Class 0200: 14e4:1639
--
0000:08:00.1 Network controller Ethernet controller: QLogic Corporation QLogic NetXtreme II BCM5709 1000Base-T [vmnic1]
Class 0200: 14e4:1639
Run the below command to switch the acceptance level to community support (the VIB can only be installed in community support)
[root@Ryzen:~] esxcli software acceptance set --level=CommunitySupported
Host acceptance level changed to 'CommunitySupported'.
Allow http traffic from the shell by making changes to the firewall
[root@Ryzen:~] esxcli network firewall ruleset set -e true -r httpClient
Use the below command to download and install the VIB
[root@Ryzen:~] esxcli software vib install -d https://vibsdepot.v-front.de -n net55-r8168
Installation Result
Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
Reboot Required: true
VIBs Installed: Realtek_bootbank_net55-r8168_8.045a-napi
VIBs Removed:
VIBs Skipped:
Reboot the host and you should now have a working Realtek NIC!
root@is-dhcp40-236 [ /etc/cron.d ]# cat nuke_logs.cron
* /1 * * * * root . /usr/sbin/nukedns.sh >/dev/null 2>&1
root@is-dhcp40-236 [ /etc/cron.d ]# cat /usr/sbin/nukedns.sh
echo 0 > /var/log/vmware/dnsmasq.log
echo 0 > /var/log/vmware/other_logs_that_that_needs_to_be_nulled
change /1 to x for the min, duration
permission for cron file must be 666 or 700
an example can be found in the attachment for
https://kb.vmware.com/s/article/54526 (use WinRAR to extract the attachment, the file shows up as corrupt otherwise)
After vCenter upgrade, the Logon screen is improperly formatted and might look like the below:
the text would read like the below:
<img id=\'topSplash\' src=\'..\/..\/resources\/img\/AppBgPattern.png\'><img id=\'brand\' src=\'..\/..\/resources\/img\/vmwareLogoBigger.png\'><span>VMware<sup>®<\/sup> vCloud Automation Center<sup>™<\/sup><\/span><style type=\'text\/css\'>body { background: #3075ab; \/* Old browsers *\/ background: -moz-linear-gradient(top, #3a8dc8 0%, #183a62 100%); \/* FF3.6+ *\/ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #3a8dc8), color-stop(100%, #183a62)); \/* Chrome,Safari4+ *\/ background: -webkit-linear-gradient(top, #3a8dc8 0%, #183a62 100%); \/* Chrome10+,Safari5.1+ *\/ background: -o-linear-gradient(top, #3a8dc8 0%, #183a62 100%); \/* Opera 11.10+ *\/ background: -ms-linear-gradient(top, #3a8dc8 0%, #183a62 100%); \/* IE10+ *\/ background: linear-gradient(to bottom, #3a8dc8 0%, #183a62 100%); \/* W3C *\/ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#3a8dc8\', endColorstr=\'#183a62\', GradientType=0); \/* IE6-9 *\/ background-repeat: no-repeat; margin : 0; font-size : 12px; font-family : Arial, Helvetica, sans-serif; color: #87ceff; margin: 0; font-size: 12px; font-family: Arial, Helvetica, sans-serif;}#topSplash { position: absolute; top: 0; left: 0; z-index: 1;}#brand { position: absolute; top: 55px; left: 44px; z-index: 2;}#tenantBrand { top: 0; left: 0; margin: 0; padding: 0; width: 100%;}#tenantBrand span { position: absolute; top: 345px; left: 424px; color: #FFF; font-size: 21px;}#tenantBrand sup { font-size: 11px;}#loginForm { background-image: url(..\/..\/resources\/img\/divider.png);}.loginLabel { color: #FFFFFF;}#productName { top: 365px;}#response { color: #87CEFF;}#footer { background-color: 090B0D; color: #838689;}<\/style>
or
var tenant_brandname="<img id=\'topSplash\' src=\'..\/..\/resources\/img\/AppBgPattern.png\'><img id=\'brand\' src=\'..\/..\/resources\/img\/vmwareLogoBigger.png\'><span>VMware<sup>®<\/sup> vRealize<sup>™<\/sup> Automation<\/span><style type=\'text\/css\'>body { background: #3075ab; \/* Old browsers *\/ background: -moz-linear-gradient(top, #3a8dc8 0%, #183a62 100%); \/* FF3.6+ *\/ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #3a8dc8), color-stop(100%, #183a62)); \/* Chrome,Safari4+ *\/ background: -webkit-linear-gradient(top, #3a8dc8 0%, #183a62 100%); \/* Chrome10+,Safari5.1+ *\/ background: -o-linear-gradient(top, #3a8dc8 0%, #183a62 100%); \/* Opera 11.10+ *\/ background: -ms-linear-gradient(top, #3a8dc8 0%, #183a62 100%); \/* IE10+ *\/ background: linear-gradient(to bottom, #3a8dc8 0%, #183a62 100%); \/* W3C *\/ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#3a8dc8\', endColorstr=\'#183a62\', GradientType=0); \/* IE6-9 *\/ background-repeat: no-repeat; margin : 0; font-size : 12px; font-family : Arial, Helvetica, sans-serif; color: #87ceff; margin: 0; font-size: 12px; font-family: Arial, Helvetica, sans-serif;}#topSplash { position: absolute; top: 0; left: 0; z-index: 1;}#brand { position: absolute; top: 55px; left: 44px; z-index: 2;}#tenantBrand { top: 0; left: 0; margin: 0; padding: 0; width: 100%;}#tenantBrand span { position: absolute; top: 345px; left: 499px; color: #FFF; font-size: 21px;}#tenantBrand sup { font-size: 11px;}#loginForm { background-image: url(..\/..\/resources\/img\/divider.png);}.loginLabel { color: #FFFFFF;}#productName { top: 365px;}#response { color: #87CEFF;}#footer { background-color: 090B0D; color: #838689;}<\/style>";
This is because the STS banner flag has an inappropriate data. Inorder to fix this, download and connect to the sso using jxplorer: https://kb.vmware.com/s/article/2077170
Note: Take a snapshot of the PSC/backup the vmdird database (/storage/db/vmware-vmdir/*mdb) before proceeding, deleting the wrong object can break the psc/vCenter.
Delete/remove the value on the attribute ‘vmwSTSBrandName’ under the object dn ‘cn=vsphere.local,cn=Tenants,cn=IdentityManager,cn=Services,dc=vsphere,dc=local’ using jxplorer
(screenshot below)
export pvt key from pfx file!!, works with lets encrypt!!
export the pfx from mmc> local computer>personal
openssl pkcs12 -in yourcertfile.pfx -out out.txt -nodes
the out.txe should have the key and the certificate chain!
SELECT 'ALTER SCHEMA dbo TRANSFER ' + s.Name + '.' + o.Name FROM sys.Objects o INNER JOIN sys.Schemas s on o.schema_id = s.schema_id WHERE s.Name = 'custom_schema' And (o.Type = 'U' Or o.Type = 'P' Or o.Type = 'V')
Replace custom_schema with the schema on the database
Replace dbo with the schema you want the table to have
Note: The above query only creates commands that can be used to change the schema. you will need to run the output of the above command.