Posts

Testing

Process Document – ESXi Active Directory Group Configuration Automation using VMware Aria Orchestrator (vRO) 1. Purpose This document describes the VMware Aria Orchestrator (vRO) workflow developed to automate the addition of an Active Directory (AD) group to the local ESXi authorization configuration using ESXCLI commands. The workflow supports execution against either a single ESXi host or all ESXi hosts within a selected cluster. 2. Objective Automate the manual ESXi configuration process by: Executing predefined ESXCLI commands over SSH. Supporting both single-host and cluster-based execution. Validating target objects before execution. Generating execution status reports for cluster operations. Reducing manual effort and configuration inconsistencies. 3. Scope The workflow performs the following operations: Validates the selected ESXi host or cluster. Retrieves ESXi hosts from the selected cluster when applicable. Retrieves SSH credentials from the configured Resource Ele...

esxcli random

 esxcli network vswitch standard policy failover set  --active-uplinks=vmnic0,vmnic1 -v vSwitch0 esxcli network vswitch standard portgroup add --portgroup-name=Prod-789  --vswitch-name=vSwitch0 esxcli network vswitch standard portgroup add --portgroup-name=Prod-787  --vswitch-name=vSwitch0 esxcli network vswitch standard portgroup set --portgroup-name=Prod-789 --vlan-id=789 esxcli network vswitch standard portgroup set --portgroup-name=Prod-787 --vlan-id=787 esxcli network vswitch standard portgroup add --portgroup-name=VMotion1 --vswitch-name=vSwitch0 esxcli network vswitch standard portgroup set --portgroup-name=VMotion1 --vlan-id=722 esxcli network ip interface add --interface-name=vmk1 --portgroup-name=VMotion1 esxcli network ip interface ipv4 set --interface-name=vmk1 --ipv4=10.232.x.x --netmask=255.255.254.0 --type=static vim-cmd hostsvc/vmotion/vnic_set vmk1 esxcli network ip dns search add --domain=corp.test.com esxcli network ip dns server add --server=10.19...

govc random

 #!/bin/sh export GOVC_URL='<VC URL>' export GOVC_USERNAME='<USERNAME>' export GOVC_PASSWORD='<PASSWORD>' export GOVC_INSECURE=1 export GOVC_DATACENTER=<DATACENTER> export no_proxy=IPs & DOMAIN date=`echo "'"$(date +%F)"'"` ################# Scan for ESXi / HW Data ####################################### for cluster in `govc ls /OpenShift/host/ | grep -v OLD | grep -v Maint|awk -F '/' '{print $4}'` do         for host in `govc ls /OpenShift/host/$cluster | grep -v Resources |awk -F '/' '{print $5}'`         do                 vendor=`echo "'"$(govc host.info /OpenShift/host/$cluster/$host | grep Manufacturer: |awk '{print $2}')"'"`                 memory=`expr  $(govc host.info /OpenShift/host/$cluster/$host | grep Memory:|awk -F 'MB' '{print $1}'|awk '{print $2}') / 1024`                 cpu...

Random One Liners

 /usr/sbin/rear -v mkbackup nfs://nas_name/linux_bkp/images  in  /etc/rear/local.conf blockdev --rereadpt /dev/sdb pvresize /dev/sdb free && sync && echo 3 > /proc/sys/vm/drop_caches && free echo 1 > /proc/sys/vm/drop_caches  echo 2 > /proc/sys/vm/drop_caches echo 3 > /proc/sys/vm/drop_caches date --set="$(ssh user@server date)" echo "body" | mailx -s "subject" test@hello.com for i in /var/spool/postfix/*;do echo $i; find $i |wc -l; done find /var/Secured_History -size  0 -print0 |xargs -0 rm zoneadm list -cv find / \( -fstype ext2 -o -fstype ext3 -o -fstype ext4 -o -fstype btrfs \) -exec setfattr -x security.selinux {} \; arp -a|grep SP timeout 1 bash -c 'cat < /dev/null > /dev/tcp/test_server/37410' append fastboot to kernel line to skip fsck ss -ln src :22 alternatives --display java find / -size +1000 -xdev -exec du -sh {} \;|sort -nk1 from jump to remote server = ssh test_server date -s @`( date -u...

F5 Health to postgrsql

 #!/bin/sh for cluster in `cat f5inventory` do clusterid=`echo $cluster |awk -F [/:-]  '{print $4}'` url=`echo https://$clusterid-master.test.com:8443/healthz` output=`curl -k  $url` if [ $output == ok ] then         stat=`echo "'"200"'"`         link=`echo "'"$url"'"`         PGPASSWORD=postgres psql -U postgres -d ocpinfra -h test_server -p 5432  -c "UPDATE f5 SET Status = $stat WHERE F5_URL=$link;" else         stat=`echo "'"400"'"`         link=`echo "'"$url"'"`         PGPASSWORD=postgres psql -U postgres -d ocpinfra -h test_server -p 5432  -c "UPDATE f5 SET Status = $stat WHERE F5_URL=$link;" fi done

Jenkins Job Cleanup

 def jobName = "Test Removal Job" def job = Jenkins.instance.getItem(jobName) job.getBuilds().each { it.delete() } job.nextBuildNumber = 1 job.save()

Grafana Setup

 [root@server grafana]# rpm -qa |grep -i grafana grafana-7.0.6-1.x86_64 [root@server grafana]# cat /etc/grafana/grafana.ini [paths] [server] [database] [remote_cache] [dataproxy] [analytics] [security] allow_embedding = true [snapshots] [dashboards] [users] [auth] [auth.anonymous] enabled = true org_name = Main Org. org_role = Viewer [auth.saml] # Enterprise only [auth.grafana_com] [auth.proxy] [auth.basic] [auth.ldap] enabled = false [smtp] enabled = true host = relay_host:25 user = testuser@gmail.com from_address = testuser@gmail.com from_name = Hello_World [emails] [log] filters = ldap:debug [log.console] [log.file] [log.syslog] [alerting] [explore] [metrics] [metrics.graphite] [tracing.jaeger] [grafana_com] [external_image_storage] [external_image_storage.s3] [external_image_storage.webdav] [external_image_storage.gcs] [external_image_storage.azure_blob] [external_image_storage.local] [rendering] [enterprise] [panels] disable_sanitize_html = true [plugins]