Category Archives: Virtualization

Full column width in PowerCLI

In order to view the full column output in PowerCLI we need to format table appropriately e.x.

PS C:\> Get-VM  | Format-Table -AutoSize -Wrap

Format-Table
Formats the output as a table.

-AutoSize [<SwitchParameter>]
Adjusts the column size and number of columns based on the width of the data. By default, the column size and number are determined by the view.

-Wrap [<SwitchParameter>]
Displays text that exceeds the column width on the next line. By default, text that exceeds the column width is truncated.

Advertisements

Expand Logical Volume in Red Hat VMware

After adding a separate disk run to verify if the space was added:

  1. fdisk -l
  2. create a new partition fdisk /dev/sdb
    1. p – to print current partition table
    2. n – to create a new partition
    3. p – for primary
    4. 1 – depending on the output of the partition table output
    5. press return two times to accept the defaults (first and last sector)
    6. t – to change the system’s partition ID
    7. 8e – to change to Linux LVM
    8. w – to write the changes
  3. restart VM
  4. fdisk -l – to verify that partition was successfully created
  5. convert a partition to physical volume
    $ pvcreate /dev/sdb1
    Physical volume “/dev/sdb1” successfully created
  6. Extend current volume group
    vgextend rhel /dev/sdb1
    Volume group “rhel” successfully extended
  7. Run vgdisplay to verify if free space was added
    vgdisplay rhel | grep “Free”
    Free  PE / Size       4095 / 16.00 GiB
  8. extend logical volume with free space
    lvextend -l +100%FREE /dev/rhel/root
    Extending logical volume root to 66.00 GiB
    Logical volume root successfully resized
  9. Expand ext3 file system online inside of Logical Volume
    xfs_growfs /dev/rhel/root – Red Hat 7
    ext2online /dev/rhel/root
    resize2fs /dev/rhel/root

Setup Proxy in SUSE/VCSA

To setup proxy manually in VCSA 5.5 login as root and look into the following file:

/etc/sysconfig/proxy

PROXY_ENABLED=”yes”

HTTP_PROXY=”http://<IP address or FQDN>:<port_number>”

HTTPS_PROXY=”http://<IP address or FQDN>:<port_number>”

FTP_PROXY=”http://<IP address or FQDN>:<port_number>”

NO_PROXY=”localhost, 127.0.0.1″

 

If you need to authenticate via proxy

Create a file in your home directory,

/root/.curlrc with permissions 644

and contain the following:

# Proxy credentials

proxy-user = “<username>:<password>”

source the file to apply the changes

source /root/.curlrc

 

Windows machine gets suspended when inactive in VMware

Windows 8, Windows 8.1, Windows 10 get suspended or go to standby mode when are inactive for more than 5 mins. The issue is related to mobile devices which OSes were designed for and battery savings which disable some of the services such as RDP and users cannot login to machines.

In order to address the issue in VMware, a machine needs to be powered down and .vmx file needs to be modified. There are two ways of doing it:

  1. Directly via ssh and using text editor to append the following to <vm_name>.vmx file: suspend.disabled=”TRUE” save changes and exit file.
  2. Using vSphere Client by right clicking the machine and edit settings. Navigating to Options -> Advanced -> General and clicking ‘Configuration Parameters’ button. \
    1. Select ‘Add Row’ button.
    2. Name: suspend.disabled, Value: True
  3. Save settings and power the mahcine back on.

 

Incompatible device backing specified for device ’12’

While cloning one of my templates received the following error: “Incompatible device backing specified for device '12'.

VMWare tools were updated to the newest version and machine was powering on no problem.

To resolve the issue make sure that CD-ROM properties are set correctly.
“Edit the settings” of the virtual machine:
1) Remove the CD-ROM assigned as the device is probably pointing to some non-existing location,
2) If the device is set to Host Device change it to Client Device,
3) You may also want to try to point the device to some local ISO file if you find it easier.