I wanted to automate deployment of the CSR 1000V locally in my OS X/VMWare Fusion environment and found that I could leverage the OVF Runtime Environment feature that is supported by the CSR 1000V (which I will discuss shortly).
In addition to deploying the CSR 1000V, the role does some useful things like setting up a DHCP reservation and creating an entry in your
file. I’m not going to cover these details in this article, rather just discuss an interesting feature of VMWare called the OVF Runtime Environment, how the CSR 1000V uses this feature, and how my Ansible role automates configuration of this environment on VMWare Fusion.
The OVF Runtime Environment
The CSR 1000V includes support for the OVF Runtime Environment, which allows you to pre-configure the CSR 1000V virtual machine at deployment time.
If you import the CSR 1000V OVA image into VMWare vCenter (File -> Deploy OVF Template), you are able to specify a number of different parameters before the virtual machine is deployed:
vCenter automatically creates the OVF runtime environment, which incorporates the configuration parameters shown above and makes them available to the guest virtual machine.
How the guest virtual machine gets access to these parameters is via the OVF environment transport. VMWare supports two OVF environment transport options:
ISO method - an XML-based OVF environment file is mounted as an IDE device using an ISO file created during the OVA import process. The guest operating system processes the environment file accordingly. This method is used by the CSR 1000V.
VMWare Tools method - the guest operating system uses VMWare tools to introspect the OVF environment file via the guestInfo.ovfEnv variable.
You can examine the OVF environment settings by selecting Inventory -> Virtual Machine -> Settings and then clicking the Options tab:
Clicking the View… button in the OVF Environment section shows the OVF environment document. This is handy as it shows you exactly how the OVF environment file is constructed.
As you can see, vCenter fully supports deployment via the OVF environment. Unfortunately VMWare Fusion does not support OVF environment creation, so if you want to take advantage of the OVF environment feature, you have to manually create the environment yourself.
This is where we can use Ansible to automate the various manual steps we normally would need to take.
Creating the OVF Environment on VMWare Fusion
To create the OVF environment on VMWare Fusion (using the ISO transport supported by the CSR 1000V), the following steps are required:
element contains all of the various configuration parameters that can be applied to the CSR 1000V at deployment time as part of its provisioning process.
For example, the following snippet would configure the CSR 1000V virtual machine to have a login name of
and password of
Applying Custom Configurations
You can also specify in the OVF environment file any number of custom configuration commands to apply to the deployed CSR 1000V virtual machine:
The above will run the equivalent snippet from a standard Cisco configuration file:
Creating an ISO for the OVF Environment
The ISO method of creating the OVF Environment Runtime is simple:
Create OVF Environment File in a file called
Create an ISO that contains the
You can complete all of the tasks above manually, however the
role automates these tasks for you as outlined below.
Here is how the OVF environment file is created based upon the OVF environment template file listed above:
Here is how custom configuration commands are added by reading in the custom config file (if specified) and using the
loop to add the commands to the OVF environment file:
Here is how to create the OVF Environment ISO using the
OS X utility:
Connecting the OVF Environment ISO
The final step of connecting the OVF Environment ISO to the virtual machine is achieved by configuring the virtual machine VMX file:
With the ISO connected, the virtual machine can be started. The CSR 1000V will detect the presence of the OVF environment ISO and will configure itself according to the OVF environment file settings.
CSR 1000V Deployment Walkthrough
The CSR 1000V deployment process consists of a number of phases discussed in this section.
Upon initial boot the CSR 1000V detects an operating system does not current exist.
The CSR 1000V installs the operating system from the CSR 1000V install ISO (this is a different ISO from the OVF environment ISO):
After installation, the CSR 1000V reboots and loads the newly flashed operating system. The operating system detects that the nvram startup configuration file is missing:
The operating system detects the OVF runtime environment via the attached OVF ISO. Instead of defaulting to the standard user system configuration wizard, the operating system applies the OVF environment configuration:
In this article, I described how the CSR 1000V can be configured at deployment time using the VMWare OVF runtime environment feature.
Although this feature is fully supported on VMWare vCenter, it is not supported on other VMWare platforms such as VMWare Fusion.
You’ve seen that you can easily manually create the OVF runtime environment, but doing this manually is cumbersome. I have created an Ansible role
that automates creating the OVF runtime environment, which can save significant time and effort if you regularly need to create the CSR 1000V in VMWare Fusion environments for development or demonstration purposes.