Pages

Thursday, February 17, 2022

Ubuntu Server - static IP address

To assign a static IP address to ens3 interface, edit the file as follows:

  • Set DHCP to dhcp4: no.
  • Specify the static IP address. Under addresses: you can add one or more IPv4 or IPv6 IP addresses that will be assigned to the network interface.
  • Specify the gateway.
  • Under nameservers, set the IP addresses of the nameservers.
/etc/netplan/01-netcfg.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    ens3:
      dhcp4: no
      addresses:
        - 192.168.121.221/24
      gateway4: 192.168.121.1
      nameservers:
          addresses: [8.8.8.8, 1.1.1.1]

When editing Yaml files, make sure you follow the YAML code indent standards. If the syntax is not correct, the changes will not be applied.

Once done, save the file and apply the changes by running the following command:

sudo netplan apply

Verify the changes by typing:

ip addr show dev ens3 

Wednesday, February 9, 2022

Perform a reset of the STS certificate and perform a trustfix on the vCenter server

Request you to perform a reset of the STS certificate and perform a trustfix on the vCenter server.



The activity should take less than an hour to complete and would require restart of services across all vCenter servers. 

This should not impact any of the virtual machines in the environment.

Note:
Request you to take powered off snapshots of the vCenter/ all nodes in linked mode, prior to making any changes.


Firstly, request you to run trust fix with the LS doctor utility.
    • Download the LS doctor tool from the below URL .

        https://kb.vmware.com/s/article/80469

    • Place the LS doctor tool in the /tmp folder of the vCenter server using scp clients.
        Note : If you are denied access when connecting the scp cliant, execute the below command and open a new session.
        #chsh -s /bin/bash
    • Run the bellow commands in sequence.

  1.  cd /tmp/
  2. unzip lsdoctor.zip
  3. cd /tmp/lsdoctor-master
  4. python lsdoctor.py -l

    • Run trust fix and stale fix accordingly as suggested from the previous output.

  1. Trustfix : python lsdoctor.py -t
  2. Stalefix : python lsdoctor.py -t

         
Reference:
https://kb.vmware.com/s/article/80469

Secondly, to renew the STS please follow the below KB.
https://kb.vmware.com/s/article/76719

Monday, February 7, 2022

stdout & stderr

There are two main output streams in Linux (and other OSs), standard output (stdout) and standard error (stderr). Error messages, like the ones you show, are printed to standard error. The classic redirection operator (command > file) only redirects standard output, so standard error is still shown on the terminal. To redirect stderr as well, you have a few choices:

  1. Redirect stdout to one file and stderr to another file:

    command > out 2>error
    
  2. Redirect stdout to a file (>out), and then redirect stderr to stdout (2>&1):

    command >out 2>&1
    
  3. Redirect both to a file (this isn't supported by all shells, bash and zsh support it, for example, but sh and ksh do not):

    command &> out
    

For more information on the various control and redirection operators, see here.