Vmware Vsphere Command-Line Interface (CLI)

Introduction to CLI

IT sector is continuously developing at a rapid speed and is making things smarter and smaller day by day. Furthermore, we are now developing virtual databases, so that problems like storage of data and networking setup can be dodged easily. VMware is one of the leading IT companies in this niche and vSphere CLI is its tool to perform operations on its virtual environment.

vSphere Command-Line Interface can be taken as a measure to manage your virtual environment. With the help of this, you can easily perform desired operations on your virtual system. In simple words, vSphere CLI is a panacea for future opportunities, as we are heading towards an era of virtual advancements to make our lives easier and comfortable. Let us gain detailed knowledge of this technology.

Want to become a Certified Professional in VMware?  Visit here  Online VMware Training

 

Vmware Vsphere Command Line Interface - Table of Content

What is vSphere CLI?

 MindMajix YouTube Channel

What is VMware Datacenter CLI?

Installation and use of vCLI

VMware Scripting And CLI Tools

Manage ESXi with VMware vCLI

Check Out VMware vCLI Support Documentation

VMware ESXi CLI Commands

 

Vmware Vsphere Command Line Interface

What is vSphere CLI?

VSphere Command-Line Interface (VSphere CLI) is basically an interface that helps you in administering your VMware virtual environment. With the help of it, you can easily automate all the common tasks you use to support and deploy your virtual datacenter such as setting up networking for virtual machines and managing storage for ESXi hosts.

VSphere maintains network connection within your systems so that you will be able to run general administration commands against ESXi systems with the help of any machine. Furthermore, you are also allowed to target any ESXi system managed by any vCenter Server System by running vSphere CLI commands on that vCenter Server system. 

You will get the ESXCLI command set, vicfg commands, and some other command sets in vSphere CLI. However, you will also get Datacenter CLI (DCLI) if you use vCLI version 6.0. The DCLI helps you in managing services offered by the vSphere Automation SDK interface.

What is VMware Datacenter CLI?

VMware Datacenter Command-Line Interface is one of the company’s latest introduced CLIs. DCLI collaborates with the vSphere Automation API to offer both a scriptable and interactive mode. By this, you will be able to monitor and manage every single feature available for REST-based API. 

In version 6.5 of vSphere, DCLI is blessed with numerous new functionalities, by which you can perform VM tasks, interact with VCSA (vCenter Server Appliance), manage vSphere tags, receive environmental vSphere information, and work easily with the Content library. So, if you are working in a vSphere environment, this is a must to have tool for you.

Installation and use of vCLI

vCLI supports Windows and Linux operating systems, which means you can take its advantages if you are working on them. Let us have some details about the installation and their working on both of these platforms:

 
Windows
Linux
Installation
vCLI is supported for only a limited windows platforms including Vista Enterprise SP1, Windows 2008 and Windows 7. To get it installed in your system, you can simply follow these below-given steps:
  • Download vCLI Windows installer package via VMware Communities page.
  • Start the installer on your system.
  • If you already have an older version of vSphere SDK for Perl or vCLI, you will have to install it on any other system as it will replace both of them.
  • Click Next to the Welcome page.
  • The default location of it will be: ‘C:Program FilesVMwareVMware vSphere CLI’. However, you can change it by clicking on ‘Change’.
  • Click on Next.
  • Click on Install to start the installation. This will take several minutes to get completed.
  • Reboot your system.
vCLI supports some of the Linux operating systems including Red Hat Enterprise Linux (RHEL) 5.5 Server, SLES 10 SP1, SLES 11, SLES 11 SP1, and Ubuntu 10.04. The installation proceeds in the following way:
  • The installer firstly checks the availability of required prerequisite packages in your system including Perl, OpenSSL, LibXML2, and uuid.
  • The installer proceeds after confirming the availability. In case it finds them absent, it gets stopped and informs you to install them first.
  • The installer checks out whether the following Perl modules are installed in your system or not, which includes Crypt-SSLeay-0.55, IO-Compress-Base-2.037, Compress-Zlib-2.037, IO-Compress-Zlib-2.037, Compress-Raw-Zlib-2.037, Archive-Zip-1.28, Data-Dumper-2.121, XML-LibXML-1.63, libwww-perl-5.805, LWP-Protocol-https-6.02, XML-LibXML-Common-0.13, XML-NamespaceSupport-1.09, XML-SAX-0.16, Data-Dump-1.15, URI-1.37, UUID-0.03, SOAP-Lite-0.710.08, HTML-Parser-3.60, version-0.78, Class-MethodMaker-2.10.
  • After getting the confirmation, the installation process starts differently for RHEL (With No Internet Access) and for All other Linux Distributions (With Internet Access)
Usage
After getting your vCLI installed and rebooting your system, you can easily test the installation by running a vCLI or SDK for Perl command via Windows command prompt. You can simply follow the below given steps to run a vCLI command on windows:
  • Click on the Windows Start menu and then select, Programs>VMware>VMware vSphere CLI>Command Prompt. You will get an easy access to vSphere SDK and vCLI for Perl commands here.
  • Run the command here, passing in desired options with connection option.
After completing the installation process, you can easily run all the vCLI commands and vSphere SDK for Pearl utility applications by using the command prompt. Moreover, you can simply take some guidance from the below-given points:
  • Open the command prompt.
  • You can change the installation directory of vCLI. The default location is /user/bin.
  • Run the command, that includes connection options.

Rest of the information related to the installation and usage of the vCLI can simply be seen via the official help book provided by VMware.

VMware Scripting And CLI Tools

Scripting generally means making a script or executable guidelines to perform any operation. Similarly, VMware Scripting means developing a group of codes or commands to perform various operations such as connecting to a vCenter Server System, Managing Virtual Machines on vSphere, Creating vSphere Inventory Objects, Applying a Host Profile to a Host on vCenter Server, and many others. With the help of VMware Scripting APIs, you can also work on different languages like Microsoft Visual Basic, Microsoft Visual C++, JScript, and Perl.

[Related BlogVMware Installation and Configuration]

Coming next to the Command Line Interface Tools, we can picture them as things built with a unique purpose of solving any problem. It includes different type of scripts, programs, and libraries, which have been created by a developer to solve problems he/she faced with CLI. We can simply divide these tools into different categories, which can simply be seen in the following points mentioned below:

  • Web Development- There are many web development CLI tools associated with VMware that can make your work easier than ever.
  • Productivity- With the help of the Productivity category CLI tools, you can easily track your works and can perform actions to enhance your productivity.
  • Utility- As its name suggests, the Utility category CLI tools provide you with different utility tools like battery level, brightness, web-search, etc.
  • Visual- The Visual category CLI tools help you in playing with the visuals and make the graphics better in every step.
  • Entertainment- The entertainment category CLI tools in VMware includes tools like an iTunes-remote, movie-clip, pocket, etc.

Check Out VMware Tutorials

Manage ESXi with VMware vCLI

After getting the vCLI in your system, it’s time to check whether it is working properly or not. You can simply use the basic command VMware-cmd--server your server-I, which will prompt you, your login credentials. It will list all the VMs (Virtual Machines) accessible on your ESXi host. If all the gathered information is correct, then it is working completely fine. 

Now, to skip using your username and password every time, you can use the username and password in the command you run. This method may, however, compromise security, as the password will be entered in plain text.

To resolve this issue, you can try working with a session file, which will create a file to cache your credentials for 30 minutes. To make it done, you can simply follow the steps mentioned below:

  • First of all, activate the directory at: “C: Program FilesVVMwareVMware vSphere CLIPerlappssession”.
  • No, run this command, “save_session.pl --savessionfile tmpsession --server your server --username root”.
  • Enter the password for the specified user.

You will always have to include the --session file parameter in all the vCLI commands you run for referring the session file. By using this technique, you will see an entire list of network interface cards installed in your ESXi host, and you can easily manage them with the help of vCLI commands.

Checkout VMware Interview Questions

Check Out VMware vCLI Support Documentation

Now, it will be great if you get through the VMware Support Documentation in the initial phase. It will clear all of your doubts related to the VMware vCLI and its working with ESXi systems. You will get many resources to get all the knowledgeable points related to this technology. The documentation covers the following points, or we can say support resource materials shown below:

  • Documentation
  • Knowledge Base
  • Communities
  • Support Tools
  • Product Licensing
  • VMware Code
  • Security Center

VMware ESXi CLI Commands

VMware has offered us many ESXi CLI commands, which can be classified into 10 parts. All of those parts and categories along with their descriptions can be seen in the following points shown below:

  • Esxcli command: It includes commands that can list the description of all the ESX CLI commands.
  • Esxcli fcoe: It includes Fibre Channel over Ethernet (FCoE) commands.
  • Esxcli hardware: It includes hardware namespace commands and is used to extract information about the existing system setup.
  • Esxcli iscsi: It includes iSCSI namespace commands to manage and monitor software and hardware iSCSI.
  • Esxcli license: It includes license management commands.
  • Esxcli network: It includes network namespace commands to manage virtual networking including VMkernel network interfaces and virtual switches.
  • Esxcli software: It includes software namespace commands to install and manage VIBs and image profiles.
  • Esxcli storage: It covers core storage commands and other storage management commands.
  • Esxcli system: It includes commands for system monitoring and management.
  • Esxcli vm: It includes namespace commands to make a list of virtual machines and shut them down forcefully.

[Related Blog: VMWare AirWatch]

Conclusion

Vsphere CLI is undeniably a highly advanced and futuristic platform that can help you in maintaining the virtual environment of your organization. Looking at the exponentially increasing graph of cloud availability and usage, we can say that the demand for Vsphere CLI will increase in the years to come.

Apart from that, looking at its diverse working and availability, many of the IT aspirants are choosing it as a career option. We have showcased all the essential information related to the VCLI here. Now, it’s completely up to you whether to choose it or not.

Are you looking to get trained on VMware, we have the right course designed according to your needs. Our expert trainers help you gain the essential knowledge required for the latest industry needs. Join our VMware Certification Training program from your nearest city.

VMware Training ChennaiVMware Training DelhiVMware Training Bangalore

These courses are equipped with Live Instructor-Led Training, Industry Use cases, and hands-on live projects. Additionally, you get access to Free Mock Interviews, Job and Certification Assistance by Certified VMware Trainers

Explore VMware Sample Resumes! Download & Edit, Get Noticed by Top Employers!

Job Support Program

Online Work Support for your on-job roles.

jobservice

Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:

  • Pay Per Hour
  • Pay Per Week
  • Monthly
Learn MoreGet Job Support
Course Schedule
NameDates
VMware TrainingNov 19 to Dec 04View Details
VMware TrainingNov 23 to Dec 08View Details
VMware TrainingNov 26 to Dec 11View Details
VMware TrainingNov 30 to Dec 15View Details
Last updated: 07 Oct 2024
About Author

Ravindra Savaram is a Technical Lead at Mindmajix.com. His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.

read less