«

»

vCloud Director vApp Template IP Mode bug

2013-05-06  – I am happy to inform you that the vCloud Director version 5.1.2 does not contain the problem described in this blog post // Magnus Andersson

I have been involved in several vCloud Director (vCD) implementations lately where the customer requires the following:

  • One virtual machine per vApp and/or vApp Template.
  • The vApp virtual machine must be directly connected to an Organization VDC Network directly which is directly connected to the Eternal Network.
  • vCD must manage the IP assignment for the External Network meaning the virtual machine requires the “IP Mode” set to “Static IP Pool”
  • The “Customize VM Settings” must be configured for the vApp Template.

The below figure shows the vApp diagram.
Screen Shot 2013-04-03 at 20.57.49

The virtual machine NIC configuration is presented in the below figure.
Screen Shot 2013-04-03-01 at 20.58.06

When adding the vApp to the Catalog using the “Customize VM settings” the “IP Mode” configuration change from “Static – IP Pool” to “DHCP” meaning vCD will not provide an IP address to the vApp virtual machine.Screen Shot 2013-04-03 at 21.21.41

Screen Shot 2013-04-03-01 at 21.04.21

There is one fix which requires database interaction and one workaround for this problem. Let’s start with the workaround.

When deploying a new vApp from the vApp Template you need to mark the check box “Switch to the advanced networking workflow” and select “Static – IP Pool” as the “IP Assignment” method. See figure below.Screen Shot 2013-04-03-01at 21.31.33
The workaround is applicable when:

  • Selecting “Add to My Cloud” from the Catalogs -> vApp Templates section of the Organization VDCs view
  • Using the option “Add vApp from Catalog” option in the My Cloud section of the Organization VDCs view.

To solve the problem we need to change the ip_addressing_mode setting to the correct value in the database. The different IP Modes are defined in the database by the following configuration:

  • 0 = None
  • 1 = Static IP Pool
  • 2 = Static Manual
  • 4 = DHCP

To change the IP Mode from “DHCP” to “Static IP Pool” you can use the below commands and create a script or run the commands manually.

  • select id from catalog where name='<catalogName>’
  • select entity_id from catalog_item where name='<vAppTemplateName>’ and catalog_id=<id>
  • select svm_id from vapp_vm where vapp_id=<entity_id> and name='<vmName>’
  • select nic.nic_id from network_interface as nic inner join vapp_vm as vm on nic.netvm_id = vm.nvm_id where svm_id=<svm_id>
  • update network_interface set ip_addressing_mode = 1 where nic_id = <nic_id>

I used the below command sequence last time i had to change the “IP Mode”:

  • select id from catalog where name=’demo-catalog-01′
  • select entity_id from catalog_item where name=’vApp-XP-01-custom’ and catalog_id=0xDE37C0EC98754521AF9EB23564900553
  • select svm_id from vapp_vm where vapp_id=0xA37EFAA3CA2A405AAEC764C2B0494EFD and name=’vApp-XP-01′
  • select nic.nic_id from network_interface as nic inner join vapp_vm as vm on nic.netvm_id = vm.nvm_id where svm_id=0xA8500FB2144449CC91F661F33082B43E
  • select ip_addressing_mode from network_interface as nic where nic_id = 0xA9333F50EB1A402BA80098A3BD857469
    update network_interface set ip_addressing_mode = 1 where nic_id = 0xA9333F50EB1A402BA80098A3BD857469
    select ip_addressing_mode from network_interface as nic where nic_id = 0xA9333F50EB1A402BA80098A3BD857469

I added one select statement before updating the IP Mode to verify it is set to 4 and one select statement after the update to verify the IP Mode is changed to 1. See below figures.

Screen Shot 2013-04-03 at 22.00.35

Screen Shot 2013-04-03 at 22.02.44

Screen Shot 2013-04-03 at 22.05.40

Screen Shot 2013-04-03 at 22.07.29

Screen Shot 2013-04-03 at 22.13.57

I started a thread on the VMware communities website back in November 2012 but since quite a few of my customers facing the problem i figured a more structured problem description and its solution could be useful.