I have recently been spending some time exploring the latest release of Photon Controller (v0.8). One of the new features in this release is the ability to deploy Photon Controller using a new UI installer provided by a virtual appliance. Since I already have a vCenter Server running in my lab environment, I decided to deploy the Photon Controller Installer OVA using the vSphere Web Client. There are several OVF properties that you can configure as part of deploying the appliance, just like you would with any VMware/3rd Party based virtual appliance. Below is a screenshot of the available OVF properties when deploying the Photon Controller Installer OVA.
Slick way of deploying OVF/OVA directly to ESXi & vCenter Server using govc CLI
I have been meaning to write about this neat little feature that was added to the govc CLI late last year that allows you to easily deploy any OVF/OVA without the need of ovftool. You might ask, why not use ovftool? Well, if you just need to perform a very basic OVF/OVA deploy and prefer not to install anything on your desktop, this can be a nice alternative. govc is provided as a simple binary that is platform agnostic and supports Windows, Linux & Mac OS X. govc is built using govmomi which is also known as the vSphere SDK for Go and this also means you can consume this capablitity beyond just the CLI but also programmatically if you wish. Obviously, the CLI is the easiest method which I will demonstrate below.
Just to be clear, there is still a huge amount of value in using ovftool as it contains a large mount of functionality that is not found any where else. It is still the recommended tool for deploying OVF/OVA across all VMware based Hypervisors and is extensively used by other VMware's products for general OVF/OVA deployment.
Cheatsheet for the entire VMware AppCatalyst API using cURL
There were a few questions recently about the required syntax for specific VMware AppCatalyst operations when consuming the REST API using cURL. I figured I put together a quick "cheatsheet" that contains cuRL examples for the entire VMware AppCatalyst API which not only would it help me in future but could also benefit others. Like many, I also learn by example and having explicit samples to start with is a great way to get familiar with a new technology or product. If you are new to VMware AppCatalyst and would like a quick run down on how to quickly get started, be sure to check out my getting started article here for more details.
While going through the AppCatalyst API, I did find a couple of API operations which had some inconsistencies and did not strictly adhere to the JSON format. Thanks to Roman Tarnvski for providing the solution. I am hopeful that these issues will be resolved in a future update of AppCatalyst as I do like the ease of use of their API. For the majority of the API, the self documentation via the AppCatalyst API Explorer is accurate, which you can see from the screenshot below.
Before you can interact with the AppCatalyst REST API, you will need to start the AppCatalyst Daemon by running the following command:
/opt/vmware/appcatalyst/bin/appcatalyst-daemon
Once the AppCatalyst Daemon is running, you can open a new terminal and start working with the REST API via cURL or any other tool of choice.
1. Create a new VM from the default Photon OS VM template:
You technically only need to specify the unique "id" property, but you can also give a display name for the VM by using the "name" property.
curl -d '{"id":"VM1", "name":"MyAppCat-VM1"}' -X POST localhost:8080/api/vms
2. Clone a VM from an existing VM:
Similar to creating a new VM, you also have option of using the "tag" property to associate additional metadata with the VM.
curl -d '{"id":"VM2", "parentid":"VM1", "name":"MyAppCat-VM2", "tag":"Development"}' -X POST localhost:8080/api/vms
curl -X GET localhost:8080/api/vms
To retrieve a specific VM, you will need to power on the VM before this operation is allowed. I did find it strange that this was the case, but perhaps this could be enhanced in the future to not have this requirement, especially if you want to pull out details such as the "tag" property.
curl -X GET localhost:8080/api/vms/VM1
curl -d 'on' -X PATCH localhost:8080/api/vms/power/VM1
Note: Other VM Power Operations: off, shutdown, suspend, pause & unpause
6. Get the power state of a VM:
curl -X GET localhost:8080/api/vms/power/VM1
7. Get the IP Address of a VM:
curl -X GET localhost:8080/api/vms/VM1/ipaddress
8. Enable folder sharing for a VM:
curl -d "true" -X PATCH localhost:8080/api/vms/VM1/folders
9. Create a shared folder mapping for a VM:
The "guestPath" property is not an absolute path within the guestOS, but rather a logical name. For more details about shared folders in AppCatalyst, please have a look at this article here. Currently there is only one "flags" property with the value of 4 which enables read/write, please refer to the article in the link above for more details about folder sharing in AppCatalyst.
curl -d '{"guestPath":"shared-folder","hostPath":"/Users/wlam/git","flags":4}' -X POST localhost:8080/api/vms/VM1/folders
10. List all shared folders to a VM:
curl -X GET localhost:8080/api/vms/VM1/folders
11. List a specific shared folder for a VM:
curl -X GET localhost:8080/api/vms/VM1/folders/shared-folder
12. Delete a shared folder for a VM:
curl -X DELETE localhost:8080/api/vms/VM1/folders/shared-folder
curl -X DELETE localhost:8080/api/vms/VM1
- « Previous Page
- 1
- …
- 13
- 14
- 15
- 16
- 17
- 18
- Next Page »