Last week I wrote an article about creating offline update repository for VMware virtual appliances and demonstrating the use of the VAMI web interface for updating and upgrading a VMware virtual appliance. However, from an automation perspective, the web interface is probably not the right tool for the job and this where the vamcli can help.
Usage: vamicli [options]
may be:
network Network Configuration
update Update Management
version Version Information
service Service Management
Use vamicli to see a list of options.
The vamicli is a command-line tool that is available on all virtual appliances built using VMware Studio and it provides a subset of the functionality of the VAMI web interface. Using the "update" operation, you can check for available updates as well as performing the installation of an update.
To check for the latest update just like you would using the VAMI web interface, you would run the following command:
vamicli update --check
To install the latest update, you would run the following command:
vamicli update --install latest --accepteula
Here is a screenshot example of going through both of these commands on a VIN 1.2 virtual appliance and then upgrading to VIN 2.0:
As you can see the process is pretty straight forward and this allows you to easily automate the updates of your virtual appliances without having to resort to the VAMI web interface.
For those of you who read my previous article and wish to configure a custom update repository without using the VAMI web interface, you can add the following configuration to /opt/vmware/var/lib/vami/update/provider/provider-runtime.xml where value specifies the HTTP address to your update repository as you would configure using the VAMI web interface.
If you would like to configure additional authentication properties such as username and password, then the /opt/vmware/var/lib/vami/update/provider/provider-runtime.xml should look like the following: The password value is encoded using base64, so to generate the encoding you can use the following python snippet (where password is the password you wish to encode:
python -c "import base64; print base64.b64encode('password')"
Note: The configuration changes above go into effect immediately and you can then use vamicli to perform both check and install operations.
Marco says
That VAMI web interface hung on searching update for the VCSA. The command line (as always) worked like a charm and resolved the situation XD
virtuallyGhetto rules, thanks for sharing your experience!
Greetings from Italy!!!!
Navin says
Hi All, its a wonderful article. But, in my case am facing an issue at updating the vCenter with /opt/vmware/bin/vamicli update --check after setting the LocalRepository to my own in provider-runtime.xml. After changing the Repository in XML file, executing the vamicli update is showing the message like "ERROR:Please contact your vendor.......". So how can i resolve my issue, please help me. Thanks in advance.
--navin
gummalln says
Hi,
I want to update the vCenter server through Command Line Interface. Here i don't want to use VMware vCenter server appliance web interface. So for this update i want to change repository from default repository to my own specified repository. For this change, in command line i have specified my repository url in provider-runtime.xml. Where provider-runtime.xml is located in "/opt/vmware/var/lib/vami/update/provider/" location of my vcenter. So after editing this provider-runtime.xml file, am going for checking updates for vcenter which are available in my repository. For that am giving "/opt/vmware/vmware/vamicli update --check" as command in vcenter CLI, but it's giving an Error saying "Failure. Error downloading manifest.please contact your vendor". Before this, for confirming the change in repository i opened Web interface, there the change is reflected to my own repository. After that if i press "save settings" button and run the update command in CLI , then its showing about the avaialable updates. So in that XML file, the save settings is not doing. So for enabling save settings what i need to do in the XML file? please provide me the solution.
Thanks in advance...
Tejas says
Hi,
I tried to update my appliance using the auto scheduling mechanism of VAMI through the commandline. The steps I had to follow are as follows :
1. sudo /etc/init.d/vami-sfcb stop
2. modify /opt/vmware/var/lib/vami/update/provider/provider-runtime.xml
3. modify /opt/vmware/var/lib/vami/core/provider/provider-runtime.xml
change the 'RunStartInterval' value to desired auto update time
4. sudo /etc/init.d/vami-sfcb start
This will schedule the appliance auto update. The update process will be started by VAMI automatically at the specified time.