Basic commands for the VI editor

When you need to edit files on an ESXi host directly or on a Linux-host, such as the vCenter appliance, then it is a useful skill to be able to use the VI-editor. In this article I describe the absolute basics you need to know.

The easiest way to open a file with the VI-editor is to start the program with the filename of the file to edit as a parameter. Such as this:

vi /etc/udev/rules.d/70-persistent-net-rules

vCAC and vCenter Orchestrator workflow to move Virtual Machines to a Resource Pool

This article describes how to create a workflow in vCenter Orchestrator that, when executed from vCAC, moves a provisioned Virtual Machine to a specified Resource Pool. If the Resource Pool does not exist it will be created.

Requirements:

- vCAC Plugin installed in vCO and configured (documentation and download for plugins)

Import existing virtual machines in vCloud Automation Center

Virtual machines from an existing vSphere environment can be imported into vCloud Automation Center to manage them from there. You perform this action as an Infrastructure Administrator with a tool named Infrastructure Organizer that you will find under the Infrastructure tab in your vCAC administration portal.

vCloud Automation Center Import virtual machines

Modify the Session Time Out for vCloud Automation Center 6.x

The default timeout value for the vCAC web console is 30 minutes. You might find this not long enough or too long, whatever your reasons are, if you want to change it you can.

Access the vCAC Appliance through SSH (with Putty for example) or access the virtual appliance console directly to modify this file:

for 6.0  /usr/lib/vcac/server/webapps/shell-ui-app/WEB-INF/web.xml

for 6.2  /usr/lib/vcac/server/webapps/vcac/WEB-INF/web.xml

Configure vCenter privileges for access to vCenter Operations Manager

After deployment of vCenter Operations Manager there are two users in the system that have access to the entire environment. These are the built-in admin-user of vCops and any user that is assigned to the Administrator role in vCenter. In the image below you can see that there are two privileges assigned in the Administrator role that allow anyone assigned a permission with this role to access vCenter Operations Manager as an administrative user.

How to reset vCenter Operations Manager Configuration to the default settings

It is possible to reset your vCenter Operations Manager configuration to the default settings. This applies to the default policy but also to any other policies that you may have created in your environment. Open the Configuration panel, click the Default Policy or any other policy you would like reset. Next in the Clone from field select Original Defaults and click Ok to save the settings. All configuration settings for that policy are now reset to the default vCops settings.

Extending the size of a vCenter Operations Manager data disk

vCenter Operations Manager is an application that consists of two virtual machines in a vApp-container, the UI-VM and the Analytics-VM. (There is also an installable version of vCops that you can install on Windows or Linux, but this article is only for the Appliance-based installation). When one of these two virtual machines starts to run out of disk space then it's very simple to increase the size of the data disk.

When did my ESXi host boot?

In the vSphere Client and vSphere Web Client you can find how many days your host has been running. But what happened before that period? How often did your host boot in the past? This information is stored in the file /var/log/vmksummary.log on your ESXi-host. The file is updated  hourly with information how long your host has been up and how many virtual machines are running at that moment.

How to crash your server to test HA

There are several ways to test if HA is working. You can unplug the power of your server or perform a reset of the machine and a fail over will take place. In training classes and for demo's it's nicer if you can actually have the server to crash and show a Purple Screen of Death (PSOD).

vsish command

This is the command to execute:

vsish -e set /reliability/crashMe/Panic 1

Convert a Template to a Virtual Machine from the command line

The normal procedure to convert a template to a virtual machine is to right-click the template in the vSphere Web Client and select the menu-option Convert to Virtual Machine. You would do this for example if you need to update the template with new software, patches or other modifications before using it to deploy additional virtual machines. When the virtual machine is updated you then convert it back to a template.

Import and Export Virtual Machines from the command line with VMware's OVF Tool

Importing Virual Machines (also called deploying OVF templates) or exporting them into the OVF format can be done with the vSphere Client, vSphere Web Client or from the vCloud Director management portal. But did you know you can also perform these actions from the command line? There is a utility available from VMware that runs on Linux and Windows that allows you to perform these actions from the command line, and thus can also be used in scripts.

Using a Power Bank as a UPS for your Raspberry Pi

I am running a Raspberry Pi as a USB-server for my virtual environment (see this article). That device is plugged into my server's UPS so it will keep running when there is a power failure. But when you use your Raspberry Pi for other purposes, for example in a stand-alone scenario with sensors or switches you also might want it to keep running when there is a power failure. 

Removing user-management for a vCloud Organization Administrator

In a default vCloud Director deployment Organization Administrators can manage users for their own organization. This however means that they can import users from LDAP and also create local users. This might not be something you want to allow. Organization Administrators that create local users might forget to delete local users when they leave the organization and that might allow for unauthorized access to the Organization's cloud.

VirtualHere with Raspberry Pi as USB server

When you want to use USB devices in a virtual machine you don't want to connect them to your physical ESXi-host and then from there pass through to a virtual machine. By doing this you pin the virtual machine to the host. For example with a failover the virtual machine would boot on another host and would not be able to connect to it's USB-device, which is still plugged into the failed host. Also with vMotion your options are limited.

Configure your vCenter appliance for Active Directory Single Sign-On

After deploying the vCenter Linux Appliance with a default and embedded Single Sign-On configuration you can login to vCenter with two user accounts: root and Administrator@vsphere.local. If you have Active Directory in your environment you might want to add that to your vCenter-server as an identity source for Single Sign-On.

How to change the storage adapter to Paravirtual (PVSCSI) for a Windows guest

VMware offers multiple types of virtual SCSI-adapters to use in your virtual machines. Based on your choice of operating system VMware will offer a Buslogic or LSI logic adapter. There is however a Paravirtual SCSI-controller that can improve performance for your virtual machines, especially in environments with high IO-loads. This controller will provide greater throughput and lower CPU utilization for your VMkernel.

How to change the network adapter to VMXNET3 for a Windows guest

VMware offers several types of virtual network adapters that you can add to your virtual machines. Depending on the operating system you install it will select a default adapter when you create a VM. For Windows the default adapter type is the Intel E1000. There is however an adapter that will give you a better performance, which is the VMware VMXNET3 adapter. More information about choosing the right adapter, supported operating systems and the performance benefits of this adapter can be found in these locations:

VMware Hands On Labs Online

When you have attended VMworld / VMware Explore in the past you must have seen the hands on lab environment VMware has created there each year. The labs you can take there allow you to get introduced to VMware products that you haven't worked with yet and the labs allow you to learn more about products you already work with.

These labs are now available online for free

Tags