Skip to content
This repository has been archived by the owner on Dec 9, 2020. It is now read-only.

Network Deployment Options

Fabio Rapposelli edited this page Sep 1, 2014 · 1 revision

We're going to talk about the three most common deployment topologies:

  • Protected vApp Network with Organization VDC Edge Gateway fronting the Organization VDC Network to the External Network (common scenario for accessing VMs over the internet).
  • Protected vApp Network connected to an External Network (common scenario for hybrid cloud).
  • VMs directly connected to an Organization VDC Network / External Network (very common scenario for hybrid cloud).

Protected vApp Network with Organization VDC Edge Gateway

Protected vApp Network with Organization Edge

In this scenario the vApp deployed by vagrant-vcloud has a private vApp Network (you can specify your own subnet with ip_subnet, otherwise defaults to 10.1.1.0/24) that is fronted by a vApp vShield Edge that does all the port forwarding duties for Vagrant (e.g. SSH port forwarding and all the additional forwardings you specify in your Vagrantfile).

The vShield Edge has an uplink to the Organization VDC Network specified with vdc_network_name and automatically consumes an IP from its Pool, vdc_edge_gateway and vdc_edge_gateway_ip configure the Organization VDC Edge Gateway device that connects the Organization VDC Network (vdc_network_name) with the External Network. It is important to specify vdc_edge_gateway_ip as we can't guess the external IP to be used, and this is critical for Organization VDC Edge Gateways that are directly connected to the Internet.

This Vagrantfile represents the configuration depicted in the diagram above:

# Set our default provider for this Vagrantfile to 'vcloudair'
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'vcloudair'

nodes = [
  { hostname: 'vagrant-test1', box: 'gosddc/trusty64' },
  { hostname: 'vagrant-test2', box: 'gosddc/trusty64' }  
]

Vagrant.configure('2') do |config|

  # vCloud Air provider settings
  config.vm.provider :vcloudair do |vcloudair|

    vcloudair.username = '<username@domain>'
    vcloudair.password = '<password>'

    # if you're using a vCloud Air Dedicated Cloud, put the cloud id here, if
    # you're using a Virtual Private Cloud, skip this parameter.
    vcloudair.cloud_id = '<dedicated cloud id>'
    vcloudair.vdc_name = '<vdc name>'

    # Set configuration for vApp-level networking.
    vcloudair.ip_subnet = '172.16.32.125/255.255.255.240'    # optional
    vcloudair.ip_dns = ['208.67.222.222', '208.67.222.220']  # optional
    vcloudair.network_bridge = false                         # optional
 
    # Set the network to deploy our VM on
    vcloudair.vdc_network_name = '<vdc network name>'
 
    # Set our Edge Gateway and the public IP we're going to use.
    vcloudair.vdc_edge_gateway = '<vdc edge gateway>'
    vcloudair.vdc_edge_gateway_ip = '<vdc edge gateway public ip>'

    # Catalog that holds our templates.
    vcloudair.catalog_name = 'Vagrant'

  end

  # Go through nodes and configure each of them.
  nodes.each do |node|
    config.vm.define node[:hostname] do |node_config|
      # Set the box we're using
      node_config.vm.box = node[:box]
      # Set the hostname for the box
      node_config.vm.hostname = node[:hostname]
      # Fix a customization problem on Ubuntu and vCloud Air.
      node_config.vm.provision 'shell', inline: 'echo "nameserver 8.8.8.8" >> tmp; sudo mv tmp /etc/resolvconf/resolv.conf.d/base; sudo resolvconf -u'
      # Declare NFS non functional as our plugin doesn't provide for it.
      node_config.nfs.functional = false
    end
  end

end

Protected vApp Network connected to an External Network

Protected vApp Network connected to an External Network

In this scenario the vApp deployed by vagrant-vcloud has a private vApp Network (you can specify your own subnet with ip_subnet, otherwise defaults to 10.1.1.0/24) that is fronted by a vApp vShield Edge that does all the port forwarding duties for Vagrant (e.g. SSH port forwarding and all the additional forwardings you specify in your Vagrantfile).

The vApp vShield Edge has an uplink to the Organization VDC Network specified with vdc_network_name and automatically consumes an IP from its Pool, the Vagrant User must either have access to the Organization VDC Network, or to the External Network that might be bridged to it (Organization vDC Network in Direct Mode) in order to perform a vagrant ssh successfully.

This Vagrantfile represents the configuration depicted in the diagram above:

# Set our default provider for this Vagrantfile to 'vcloudair'
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'vcloudair'

nodes = [
  { hostname: 'vagrant-test1', box: 'gosddc/trusty64' },
  { hostname: 'vagrant-test2', box: 'gosddc/trusty64' }  
]

Vagrant.configure('2') do |config|

  # vCloud Air provider settings
  config.vm.provider :vcloudair do |vcloudair|

    vcloudair.username = '<username@domain>'
    vcloudair.password = '<password>'

    # if you're using a vCloud Air Dedicated Cloud, put the cloud id here, if
    # you're using a Virtual Private Cloud, skip this parameter.
    vcloudair.cloud_id = '<dedicated cloud id>'
    vcloudair.vdc_name = '<vdc name>'

    # Set configuration for vApp-level networking.
    vcloudair.ip_subnet = '172.16.32.125/255.255.255.240'    # optional
    vcloudair.ip_dns = ['208.67.222.222', '208.67.222.220']  # optional
    vcloudair.network_bridge = false                         # optional
 
    # Set the network to deploy our VM on
    vcloudair.vdc_network_name = '<vdc network name>'
 
    # Catalog that holds our templates.
    vcloudair.catalog_name = 'Vagrant'

  end

  # Go through nodes and configure each of them.
  nodes.each do |node|
    config.vm.define node[:hostname] do |node_config|
      # Set the box we're using
      node_config.vm.box = node[:box]
      # Set the hostname for the box
      node_config.vm.hostname = node[:hostname]
      # Fix a customization problem on Ubuntu and vCloud Air.
      node_config.vm.provision 'shell', inline: 'echo "nameserver 8.8.8.8" >> tmp; sudo mv tmp /etc/resolvconf/resolv.conf.d/base; sudo resolvconf -u'
      # Declare NFS non functional as our plugin doesn't provide for it.
      node_config.nfs.functional = false
    end
  end

end

VMs directly connected to an Organization VDC Network / External Network

VMs directly connected to an Organization VDC Network / External Network

In this scenario the vApp deployed by vagrant-vcloud doesn't have any private vApp Network, by using network_bridge = true we connect every VM in the Vagrantfile directly to the Organization VDC Network specified with vdc_network_name and every VM deployed will consume an IP from that Organization VDC Network IP Pool.

The Vagrant User must have access to the Organization VDC Network/External Network in order to perform a vagrant ssh succesfully.

This Vagrantfile represents the configuration depicted in the diagram above:

# Set our default provider for this Vagrantfile to 'vcloudair'
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'vcloudair'

nodes = [
  { hostname: 'vagrant-test1', box: 'gosddc/trusty64' },
  { hostname: 'vagrant-test2', box: 'gosddc/trusty64' }  
]

Vagrant.configure('2') do |config|

  # vCloud Air provider settings
  config.vm.provider :vcloudair do |vcloudair|

    vcloudair.username = '<username@domain>'
    vcloudair.password = '<password>'

    # if you're using a vCloud Air Dedicated Cloud, put the cloud id here, if
    # you're using a Virtual Private Cloud, skip this parameter.
    vcloudair.cloud_id = '<dedicated cloud id>'
    vcloudair.vdc_name = '<vdc name>'

    # Set configuration for vApp-level networking.
    vcloudair.network_bridge = true                          # optional
 
    # Set the network to deploy our VM on
    vcloudair.vdc_network_name = '<vdc network name>'
 
    # Catalog that holds our templates.
    vcloudair.catalog_name = 'Vagrant'

  end

  # Go through nodes and configure each of them.
  nodes.each do |node|
    config.vm.define node[:hostname] do |node_config|
      # Set the box we're using
      node_config.vm.box = node[:box]
      # Set the hostname for the box
      node_config.vm.hostname = node[:hostname]
      # Fix a customization problem on Ubuntu and vCloud Air.
      node_config.vm.provision 'shell', inline: 'echo "nameserver 8.8.8.8" >> tmp; sudo mv tmp /etc/resolvconf/resolv.conf.d/base; sudo resolvconf -u'
      # Declare NFS non functional as our plugin doesn't provide for it.
      node_config.nfs.functional = false
    end
  end

end