cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [01/53] [abbrv] git commit: updated refs/heads/reporter to 5c99784
Date Wed, 15 Apr 2015 08:05:01 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/reporter 178a938ca -> 5c9978471 (forced update)


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01864ef7/test/integration/component/test_bigswitch_bcf.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_bigswitch_bcf.py b/test/integration/component/test_bigswitch_bcf.py
new file mode 100644
index 0000000..c4cec8f
--- /dev/null
+++ b/test/integration/component/test_bigswitch_bcf.py
@@ -0,0 +1,776 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+""" P1 tests for BigSwitchBcf network Plugin
+"""
+#Import Local Modules
+from nose.plugins.attrib import attr
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.cloudstackAPI import *
+from marvin.lib.utils import (cleanup_resources,
+                              random_gen, validateList)
+from marvin.lib.base import (Account,
+                             VirtualMachine,
+                             ServiceOffering,
+                             NetworkOffering,
+                             VpcOffering,
+                             Network,
+                             PublicIPAddress,
+                             FireWallRule,
+                             NATRule,
+                             Configurations)
+from marvin.lib.common import (get_domain,
+                               get_zone,
+                               get_template)
+from marvin.sshClient import SshClient
+from marvin.codes import PASS
+import subprocess
+import time
+
+
+class Services:
+    """Test BigSwitchBcf plugin
+    """
+
+    def __init__(self):
+        self.services = {
+                         "account": {
+                                    "email": "cloudstack@cloudmonkey.com",
+                                    "firstname": "cloudstack",
+                                    "lastname": "bob",
+                                    "username": "bobbuilder",
+                                    "password": "password",
+                         },
+                         "service_offering": {
+                                    "name": "Tiny Instance",
+                                    "displaytext": "Tiny Instance",
+                                    "cpunumber": 1,
+                                    "cpuspeed": 100,    # in MHz
+                                    "memory": 128,       # In MBs
+                         },
+                         "virtual_machine": {
+                                    "displayname": "TestVM",
+                                    "username": "root",
+                                    "password": "password",
+                                    "ssh_port": 22,
+                                    "hypervisor": 'KVM',
+                                    "privateport": 22,
+                                    "publicport": 22,
+                                    "protocol": 'TCP',
+                                },
+                         "natrule": {
+                                    "privateport": 22,
+                                    "publicport": 22,
+                                    "startport": 22,
+                                    "endport": 22,
+                                    "protocol": "TCP",
+                                    "cidrlist": '0.0.0.0/0',
+                                },
+                         "net1_net2_aclrule": {
+                                    "protocol": "ICMP",
+                                    "cidrlist": '0.0.0.0/0',
+                                },
+                         "big_switch_bcf_device": {
+                                "hostname": '10.212.1.104',
+                                "username": 'admin',
+                                "password": 'bsn',
+                                "retrycount": '4',
+                                "retryinterval": '60'
+                         },
+                         #services supported by Big Switch BCF for isolated networks.
+                         "network_offering": {
+                                    "name": 'BCF network offering (marvin)',
+                                    "displaytext": 'BCF (marvin)',
+                                    "guestiptype": 'Isolated',
+                                    "supportedservices": 'Dhcp,SourceNat,Connectivity,StaticNat,PortForwarding,Firewall',
+                                    "traffictype": 'GUEST',
+                                    "availability": 'Optional',
+                                    "serviceProviderList": {
+                                            "PortForwarding": 'VirtualRouter',
+                                            "Dhcp" : 'VirtualRouter',
+                                            "Connectivity" : 'BigSwitchBcf',
+                                            "StaticNat" : 'VirtualRouter',
+                                            "SourceNat" : 'VirtualRouter',
+                                            "Firewall" : 'VirtualRouter'
+                                    },
+                         },
+                         "vpc_network_offering": {
+                                    "name": 'BCF VPC network offering (marvin)',
+                                    "displaytext": 'BCF VPC (marvin)',
+                                    "guestiptype": 'Isolated',
+                                    "supportedservices": 'Dhcp,SourceNat,Connectivity,PortForwarding,StaticNat,NetworkACL',
+                                    "traffictype": 'GUEST',
+                                    "availability": 'Optional',
+                                    "useVpc": 'on',
+                                    "serviceProviderList": {
+                                            "Dhcp": 'VpcVirtualRouter',
+                                            "SourceNat": 'VpcVirtualRouter',
+                                            "PortForwarding": 'VpcVirtualRouter',
+                                            "StaticNat": 'VpcVirtualRouter',
+                                            "NetworkACL": 'VpcVirtualRouter',
+                                            "Connectivity" : 'BigSwitchBcf'
+                                        },
+                                },
+                         "vpc_offering": {
+                                    "name": 'BCF VPC',
+                                    "displaytext": 'BCF VPC',
+                                    "supportedservices": 'Dhcp,SourceNat,PortForwarding,StaticNat,NetworkACL,Connectivity',
+                                },
+                         "vpc": {
+                                 "name": "TestVPC",
+                                 "displaytext": "TestVPC",
+                                 "cidr": '10.0.0.1/16'
+                                 },
+                         "network": {
+                                  "name": "BCF network",
+                                  "displaytext": "BCF network",
+                         },
+                         "ostype": 'CentOS 5.3 (64-bit)',
+                         "sleep": 60,
+                         "timeout": 10
+                    }
+
+class TestBigSwitchBcf(cloudstackTestCase):
+
+
+    @classmethod
+    def setUpClass(cls):
+        cls._cleanup = []
+        cls.testClient = super(TestBigSwitchBcf, cls).getClsTestClient()
+        cls.api_client = cls.testClient.getApiClient()
+
+        cls.services = Services().services
+
+        # Get Zone, Domain and templates
+        cls.domain = get_domain(cls.api_client)
+        cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+        cls.template = get_template(
+                            cls.api_client,
+                            cls.zone.id,
+                            cls.services["ostype"]
+                           )
+        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+        cls.services["virtual_machine"]["template"] = cls.template.id
+
+        # Get test parameters
+        cls.bigswitch_services = cls.services["big_switch_bcf_device"]
+        try:
+           # Get physical network
+           resp = listPhysicalNetworks.listPhysicalNetworksCmd()
+           resp.zoneid = cls.zone.id
+           physical_networks = cls.api_client.listPhysicalNetworks(resp)
+           if isinstance(physical_networks, list):
+               cls.debug("phy net %s" % physical_networks)
+               physical_network = physical_networks[1]
+
+           # Get bigswitch network service provider
+           resp = listNetworkServiceProviders.listNetworkServiceProvidersCmd()
+           resp.name = 'BigSwitchBcf'
+           resp.physicalnetworkid = physical_network.id
+           nw_service_providers = cls.api_client.listNetworkServiceProviders(resp)
+           if isinstance(nw_service_providers, list):
+               bigswitch_provider = nw_service_providers[0]
+               cls.debug("net serv prov %s" % nw_service_providers)
+           else:
+               # Create bigswitch provider if not already existent
+               resp_add_nsp = addNetworkServiceProvider.addNetworkServiceProviderCmd()
+               resp_add_nsp.name = 'BigSwitchBcf'
+               resp_add_nsp.physicalnetworkid = physical_network.id
+               bigswitch_provider = cls.api_client.addNetworkServiceProvider(resp_add_nsp)
+               # add BCF controller
+               resp_add_device = addBigSwitchBcfDevice.addBigSwitchBcfDeviceCmd()
+               resp_add_device.physicalnetworkid = physical_network.id
+               resp_add_device.username = cls.bigswitch_services["username"]
+               resp_add_device.password = cls.bigswitch_services["password"]
+               resp_add_device.hostname = cls.bigswitch_services["hostname"]
+               resp_add_device.retrycount = cls.bigswitch_services["retrycount"]
+               resp_add_device.retryinterval = cls.bigswitch_services["retryinterval"]
+               cls.bigswitch = cls.api_client.addBigSwitchBcfDevice(resp_add_device)
+
+           if bigswitch_provider.state != 'Enabled':
+               cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd()
+               cmd.id = bigswitch_provider.id
+               cmd.state = 'Enabled'
+               cls.api_client.updateNetworkServiceProvider(cmd)
+
+           # Create non-VPC network offering
+           cls.network_offering = NetworkOffering.create(
+                                            cls.api_client,
+                                            cls.services["network_offering"],
+                                            conservemode=True
+                                            )
+           cls._cleanup.append(cls.network_offering)
+
+           cls.network_offering.update(cls.api_client, state='Enabled')
+
+           # Create VPC network offering
+           cls.vpc_network_offering = NetworkOffering.create(
+                                            cls.api_client,
+                                            cls.services["vpc_network_offering"],
+                                            conservemode=False
+                                            )
+           cls._cleanup.append(cls.vpc_network_offering)
+
+           cls.vpc_network_offering.update(cls.api_client, state='Enabled')
+
+           # Create VPC offering
+           cls.vpc_offering = VpcOffering.create(
+                                            cls.api_client,
+                                            cls.services["vpc_offering"]
+                                            )
+           cls._cleanup.append(cls.vpc_offering)
+
+           cls.vpc_offering.update(cls.api_client, state='Enabled')
+
+           # Create compute service offering
+           cls.service_offering = ServiceOffering.create(
+                                            cls.api_client,
+                                            cls.services["service_offering"]
+                                            )
+           cls._cleanup.append(cls.service_offering)
+
+        except Exception as e:
+           cls.tearDownClass()
+           raise Exception ("Warning: Exception in setUpClass: %s" % e)
+        return
+
+    @classmethod
+    def tearDownClass(cls):
+        try:
+            cleanup_resources(cls.api_client, cls._cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    def setUp(self):
+        self.apiclient = self.testClient.getApiClient()
+        self.dbclient = self.testClient.getDbConnection()
+        self.account = Account.create(
+                                     self.apiclient,
+                                     self.services["account"],
+                                     admin=True,
+                                     domainid=self.domain.id
+                                     )
+#        self._cleanup = [self.account]
+        return
+
+    def tearDown(self):
+        try:
+            self.debug("Cleaning up the resources")
+            cleanup_resources(self.apiclient, self._cleanup)
+            interval = Configurations.list(
+                                    self.apiclient,
+                                    name='network.gc.interval'
+                                    )
+            wait = Configurations.list(
+                                    self.apiclient,
+                                    name='network.gc.wait'
+                                    )
+            time.sleep(int(interval[0].value) + int(wait[0].value))
+            self.debug("Cleanup complete!")
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+
+    @attr(tags = ["advancedns"])
+    def test_network_bcf(self):
+        """Test basic workflow with BigSwitch BCF plugin
+           1. Create a non-VPC guest network
+           2. Create two VMs on the network
+           3. Add firewall rule to make virtual router pingable
+           4. Test ping to virtual router public IP
+           5. Add static NAT to vm_1, with firewall rule to allow ssh
+           6. Ssh to vm_1, ping vm_2 private address, ping google.com
+        """
+
+        self.debug("STEP 1: Creating network with network offering: %s" %
+                                                    self.network_offering.id)
+        self.network = Network.create(
+                                      self.apiclient,
+                                      self.services["network"],
+                                      accountid=self.account.name,
+                                      domainid=self.account.domainid,
+                                      networkofferingid=self.network_offering.id,
+                                      zoneid=self.zone.id
+                                     )
+        self.debug("Created network with ID: %s" % self.network.id)
+
+        self.debug("STEP 2: Deploying VMs in account: %s" % self.account.name)
+
+        vm_1 = VirtualMachine.create(
+                                     self.apiclient,
+                                     self.services["virtual_machine"],
+                                     accountid=self.account.name,
+                                     domainid=self.account.domainid,
+                                     serviceofferingid=self.service_offering.id,
+                                     networkids=[ str(self.network.id), ]
+                                    )
+        self.debug("Deployed VM in network: %s" % self.network.id)
+        list_vm_response = VirtualMachine.list(
+                                               self.apiclient,
+                                               id=vm_1.id
+                                              )
+        self.debug(
+                   "Verify listVirtualMachines response for virtual machine: %s" \
+                   % vm_1.id
+                  )
+        self.assertEqual(
+                         isinstance(list_vm_response, list),
+                         True,
+                         "Check list response returns a valid list"
+                        )
+        vm_response = list_vm_response[0]
+
+        self.assertEqual(
+                         vm_response.state,
+                         "Running",
+                         "VM state should be running after deployment"
+                        )
+
+        vm_2 = VirtualMachine.create(
+                                     self.apiclient,
+                                     self.services["virtual_machine"],
+                                     accountid=self.account.name,
+                                     domainid=self.account.domainid,
+                                     serviceofferingid=self.service_offering.id,
+                                     networkids=[ str(self.network.id), ]
+                                    )
+        self.debug("Deployed VM in network: %s" % self.network.id)
+        list_vm_response = VirtualMachine.list(
+                                               self.apiclient,
+                                               id=vm_2.id
+                                              )
+
+        self.debug(
+                   "Verify listVirtualMachines response for virtual machine: %s" \
+                   % vm_2.id
+                  )
+
+        self.assertEqual(
+                         isinstance(list_vm_response, list),
+                         True,
+                         "Check list response returns a valid list"
+                        )
+        vm_response = list_vm_response[0]
+
+        self.assertEqual(
+                            vm_response.state,
+                            "Running",
+                            "VM state should be running after deployment"
+                        )
+
+        self.debug("STEP 3: Add FW rule to allow source nat ping")
+        src_nat_list = PublicIPAddress.list(
+                                        self.apiclient,
+                                        associatednetworkid=self.network.id,
+                                        account=self.account.name,
+                                        domainid=self.account.domainid,
+                                        listall=True,
+                                        issourcenat=True,
+                                        )
+        self.assertEqual(
+                         isinstance(src_nat_list, list),
+                         True,
+                         "List Public IP should return a valid source NAT"
+                         )
+        self.assertNotEqual(
+                    len(src_nat_list),
+                    0,
+                    "Length of response from listPublicIp should not be 0"
+                    )
+
+        src_nat = src_nat_list[0]
+
+        #Create Firewall rules on source NAT
+        fw_rule_icmp = FireWallRule.create(
+                            self.apiclient,
+                            ipaddressid=src_nat.id,
+                            protocol='ICMP',
+                            cidrlist=["0.0.0.0/0",]
+                            )
+        self.debug("Created firewall rule: %s" % fw_rule_icmp.id)
+
+        self.debug("STEP 4: Trying to ping source NAT %s" % src_nat.ipaddress)
+        # User should be able to ping router via source nat ip
+        try:
+            self.debug("Trying to ping source NAT %s" % src_nat.ipaddress)
+            result = subprocess.call(
+                ['ping', '-c 1', src_nat.ipaddress])
+
+            self.debug("Ping result: %s" % result)
+            # if ping successful, then result should be 0
+            self.assertEqual(
+                             result,
+                             0,
+                             "Check if ping is successful or not"
+                            )
+        except Exception as e:
+            self.fail("Ping failed for source NAT %s (%s)"
+                      % (src_nat.ipaddress, e))
+
+        self.debug("STEP 5: Add static NAT to vm_1 with FW rule to allow SSH")
+        floating_ip_1 = PublicIPAddress.create(
+                                               self.apiclient,
+                                               accountid=self.account.name,
+                                               zoneid=self.zone.id,
+                                               domainid=self.account.domainid,
+                                               networkid=self.network.id,
+                                              )
+        self.debug("Associated %s with network %s" % (
+                                                      floating_ip_1.ipaddress,
+                                                      self.network.id
+                                                     )
+                  )
+        NATRule.create(
+                                  self.apiclient,
+                                  vm_1,
+                                  self.services["natrule"],
+                                  ipaddressid=floating_ip_1.ipaddress.id,
+                                  openfirewall=False,
+                                  networkid=self.network.id
+                                  )
+
+        # Should be able to SSH vm_1 via static nat, then ping vm_2 & Internet
+        try:
+            self.debug("STEP 6: SSH into vm_1: %s" % floating_ip_1)
+
+            ssh = vm_1.get_ssh_client(
+                                  ipaddress=floating_ip_1.ipaddress.ipaddress
+                                  )
+            self.debug("Ping vm_2 at %s" % vm_2.ipaddress)
+            # Ping vm_2
+            res_1 = ssh.execute("ping -c 1 %s" % vm_2.ipaddress)
+
+            self.debug("Ping to google.com from VM")
+            # Ping Internet
+            res_2 = ssh.execute("ping -c 1 www.google.com")
+
+            # res = 64 bytes from maa03s17-in-f20.1e100.net (74.125.236.212):
+            # icmp_req=1 ttl=57 time=25.9 ms
+            # --- www.l.google.com ping statistics ---
+            # 1 packets transmitted, 1 received, 0% packet loss, time 0ms
+            # rtt min/avg/max/mdev = 25.970/25.970/25.970/0.000 ms
+        except Exception as e:
+            self.fail("SSH Access failed: %s" % e)
+
+        self.debug("ping result1: %s" % res_1);
+        self.debug("ping result2: %s" % res_2);
+
+        result1 = str(res_1)
+        self.assertEqual(
+                         result1.count("1 received"),
+                         1,
+                         "Ping vm_2 from vm_1 should be successful"
+                         )
+
+        result2 = str(res_2)
+        self.assertEqual(
+                         result2.count("1 received"),
+                         1,
+                         "Ping Internet from vm_1 should be successful"
+                         )
+
+        # Deleting two test VMs
+        VirtualMachine.delete(vm_1, self.apiclient, expunge=True)
+        VirtualMachine.delete(vm_2, self.apiclient, expunge=True)
+
+        # Delete Network
+        Network.delete(self.network, self.apiclient)
+
+        return
+
+    @attr(tags = ["advancedns"])
+    def test_vpc_network_bcf(self):
+        """Test VPC workflow with BigSwitch BCF plugin
+           1. Create a VPC with three networks
+           2. Create one VM on each of the three networks
+           3. Add firewall rule to make virtual router pingable
+           4. Test ping to virtual router public IP
+           5. Add static NAT to vm_1, with firewall rule to allow ssh
+           6. Add NAT rule to allow ping between net1 and net2
+           7. Ssh to vm_1, ping vm_2 private address, should succeed
+           8. continue ... ping vm_3 private address, should fail
+           9. continue ... ping Internet, should succeed
+        """
+
+        self.debug("STEP 1: Creating VPC with VPC offering: %s" %
+                            self.vpc_offering.id)
+        vpc = VPC.create(
+                         self.apiclient,
+                         self.services["vpc"],
+                         accountid=self.account.name,
+                         domainid=self.account.domainid,
+                         vpcofferingid=self.vpc_offering.id,
+                         zoneid=self.zone.id
+                        )
+        self.debug("Created VPC with ID: %s" % self.vpc.id)
+
+        # Creating network using the vpc network offering created
+        self.debug("Creating networks with vpc network offering: %s" %
+                    self.vpc_network_offering.id)
+        net1 = Network.create(
+                              self.apiclient,
+                              self.services["vpc_network"],
+                              accountid=self.account.name,
+                              domainid=self.account.domainid,
+                              networkofferingid=self.vpc_network_offering.id,
+                              zoneid=self.zone.id,
+                              gateway="10.0.100.1",
+                              vpcid=vpc.id
+                             )
+        self.debug("Created network with ID: %s" % net1.id)
+
+        net2 = Network.create(
+                              self.apiclient,
+                              self.services["vpc_network"],
+                              accountid=self.account.name,
+                              domainid=self.account.domainid,
+                              networkofferingid=self.vpc_network_offering.id,
+                              zoneid=self.zone.id,
+                              gateway="10.0.101.1",
+                              vpcid=vpc.id
+                             )
+        self.debug("Created network with ID: %s" % net2.id)
+
+        net3 = Network.create(
+                              self.apiclient,
+                              self.services["vpc_network"],
+                              accountid=self.account.name,
+                              domainid=self.account.domainid,
+                              networkofferingid=self.vpc_network_offering.id,
+                              zoneid=self.zone.id,
+                              gateway="10.0.102.0",
+                              vpcid=vpc.id
+                             )
+        self.debug("Created network with ID: %s" % net3.id)
+
+        self.debug("STEP 2: Deploying VMs in networks")
+
+        vm_1 = VirtualMachine.create(
+                                     self.apiclient,
+                                     self.services["virtual_machine"],
+                                     accountid=self.account.name,
+                                     domainid=self.account.domainid,
+                                     serviceofferingid=self.service_offering.id,
+                                     networkids=[ str(net1.id), ]
+                                    )
+        self.debug("Deployed VM in network: %s" % net1.id)
+        list_vm_response = VirtualMachine.list(
+                                               self.apiclient,
+                                               id=vm_1.id
+                                              )
+        self.debug(
+                   "Verify listVirtualMachines response for virtual machine: %s" \
+                   % vm_1.id
+                  )
+        self.assertEqual(
+                         isinstance(list_vm_response, list),
+                         True,
+                         "Check list response returns a valid list"
+                        )
+        vm_response = list_vm_response[0]
+
+        self.assertEqual(
+                         vm_response.state,
+                         "Running",
+                         "VM state should be running after deployment"
+                        )
+
+        vm_2 = VirtualMachine.create(
+                                     self.apiclient,
+                                     self.services["virtual_machine"],
+                                     accountid=self.account.name,
+                                     domainid=self.account.domainid,
+                                     serviceofferingid=self.service_offering.id,
+                                     networkids=[ str(net2.id), ]
+                                    )
+        self.debug("Deployed VM in network: %s" % net2.id)
+        list_vm_response = VirtualMachine.list(
+                                               self.apiclient,
+                                               id=vm_2.id
+                                              )
+
+        self.debug(
+                   "Verify listVirtualMachines response for virtual machine: %s" \
+                   % vm_2.id
+                  )
+
+        self.assertEqual(
+                         isinstance(list_vm_response, list),
+                         True,
+                         "Check list response returns a valid list"
+                        )
+        vm_response = list_vm_response[0]
+
+        self.assertEqual(
+                            vm_response.state,
+                            "Running",
+                            "VM state should be running after deployment"
+                        )
+
+        vm_3 = VirtualMachine.create(
+                                     self.apiclient,
+                                     self.services["virtual_machine"],
+                                     accountid=self.account.name,
+                                     domainid=self.account.domainid,
+                                     serviceofferingid=self.service_offering.id,
+                                     networkids=[ str(net3.id), ]
+                                    )
+        self.debug("Deployed VM in network: %s" % net3.id)
+        list_vm_response = VirtualMachine.list(
+                                               self.apiclient,
+                                               id=vm_3.id
+                                              )
+        self.debug(
+                   "Verify listVirtualMachines response for virtual machine: %s" \
+                   % vm_3.id
+                  )
+        self.assertEqual(
+                         isinstance(list_vm_response, list),
+                         True,
+                         "Check list response returns a valid list"
+                        )
+        vm_response = list_vm_response[0]
+
+        self.assertEqual(
+                         vm_response.state,
+                         "Running",
+                         "VM state should be running after deployment"
+                        )
+
+        self.debug("STEP 3: Add FW rule to allow source nat ping")
+        src_nat_list = PublicIPAddress.list(
+                                        self.apiclient,
+                                        account=self.account.name,
+                                        domainid=self.account.domainid,
+                                        listall=True,
+                                        issourcenat=True,
+                                        vpcid=vpc.id
+                                        )
+        self.assertEqual(
+                         isinstance(src_nat_list, list),
+                         True,
+                         "List Public IP should return a valid source NAT"
+                         )
+        self.assertNotEqual(
+                    len(src_nat_list),
+                    0,
+                    "Length of response from listPublicIp should not be 0"
+                    )
+
+        src_nat = src_nat_list[0]
+
+        #Create Firewall rules on source NAT
+        fw_rule_icmp = FireWallRule.create(
+                            self.apiclient,
+                            ipaddressid=src_nat.id,
+                            protocol='ICMP',
+                            cidrlist=["0.0.0.0/0",]
+                            )
+        self.debug("Created firewall rule: %s" % fw_rule_icmp.id)
+
+        self.debug("STEP 4: Trying to ping source NAT %s" % src_nat.ipaddress)
+        # User should be able to ping router via source nat ip
+        try:
+            self.debug("Trying to ping source NAT %s" % src_nat.ipaddress)
+            result = subprocess.call(
+                ['ping', '-c 1', src_nat.ipaddress])
+
+            self.debug("Ping result: %s" % result)
+            # if ping successful, then result should be 0
+            self.assertEqual(
+                             result,
+                             0,
+                             "Check if ping is successful or not"
+                            )
+        except Exception as e:
+            self.fail("Ping failed for source NAT %s (%s)"
+                      % (src_nat.ipaddress, e))
+
+        self.debug("STEP 5: Add static NAT to vm_1 with FW rule to allow SSH")
+        floating_ip_1 = PublicIPAddress.create(
+                                               self.apiclient,
+                                               accountid=self.account.name,
+                                               zoneid=self.zone.id,
+                                               domainid=self.account.domainid,
+                                               networkid=net1.id,
+                                               vpcid=vpc.id
+                                              )
+        self.debug("Associated %s with network %s" % (
+                                                      floating_ip_1.ipaddress,
+                                                      net1.id
+                                                     )
+                  )
+        NATRule.create(
+                                  self.apiclient,
+                                  vm_1,
+                                  self.services["natrule"],
+                                  ipaddressid=floating_ip_1.ipaddress.id,
+                                  openfirewall=False,
+                                  networkid=net1.id,
+                                  vpcid=vpc.id
+                                  )
+
+        # Should be able to SSH vm_1 via static nat, then ping vm_2 & Internet
+        try:
+            self.debug("STEP 6: SSH into vm_1: %s" % floating_ip_1)
+
+            ssh = vm_1.get_ssh_client(
+                                  ipaddress=floating_ip_1.ipaddress.ipaddress
+                                  )
+#            self.debug("Ping vm_2 at %s" % vm_2.ipaddress)
+            # Ping to outsite world
+#            res_1 = ssh.execute("ping -c 1 %s" % vm_2.ipaddress)
+
+#            self.debug("Ping to google.com from VM")
+            # Ping to outsite world
+#            res_2 = ssh.execute("ping -c 1 www.google.com")
+
+            # res = 64 bytes from maa03s17-in-f20.1e100.net (74.125.236.212):
+            # icmp_req=1 ttl=57 time=25.9 ms
+            # --- www.l.google.com ping statistics ---
+            # 1 packets transmitted, 1 received, 0% packet loss, time 0ms
+            # rtt min/avg/max/mdev = 25.970/25.970/25.970/0.000 ms
+        except Exception as e:
+            self.fail("SSH Access failed: %s" % e)
+
+#        self.debug("ping result1: %s" % res_1);
+#        self.debug("ping result2: %s" % res_2);
+
+#        result1 = str(res_1)
+#        self.assertEqual(
+#                         result1.count("1 received"),
+#                         1,
+#                         "Ping vm_2 from vm_1 should be successful"
+#                         )
+
+#        result2 = str(res_2)
+#        self.assertEqual(
+#                         result2.count("1 received"),
+#                         1,
+#                         "Ping Internet from vm_1 should be successful"
+#                         )
+
+        # Deleting two test VMs
+        VirtualMachine.delete(vm_1, self.apiclient, expunge=True)
+        VirtualMachine.delete(vm_2, self.apiclient, expunge=True)
+
+        # Delete Network
+        Network.delete(self.network, self.apiclient)
+
+        return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01864ef7/tools/apidoc/gen_toc.py
----------------------------------------------------------------------
diff --git a/tools/apidoc/gen_toc.py b/tools/apidoc/gen_toc.py
index 3d48bc5..e53d69d 100644
--- a/tools/apidoc/gen_toc.py
+++ b/tools/apidoc/gen_toc.py
@@ -138,7 +138,7 @@ known_categories = {
     'Tags': 'Resource tags',
     'NiciraNvpDevice': 'Nicira NVP',
     'BrocadeVcsDevice': 'Brocade VCS',
-    'BigSwitchVnsDevice': 'BigSwitch VNS',
+    'BigSwitchBcfDevice': 'BigSwitch BCF',
 	'NuageVsp': 'Nuage VSP',
     'AutoScale': 'AutoScale',
     'Counter': 'AutoScale',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01864ef7/tools/eclipse/eclipse.epf
----------------------------------------------------------------------
diff --git a/tools/eclipse/eclipse.epf b/tools/eclipse/eclipse.epf
index d7795aa..e97f783 100644
--- a/tools/eclipse/eclipse.epf
+++ b/tools/eclipse/eclipse.epf
@@ -425,13 +425,13 @@
 /instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
 /instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
 /instance/org.eclipse.jdt.ui/cleanup.use_this_for_non_static_field_access=true
-/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-/instance/org.eclipse.wst.sse.core/task-tag-projects-already-scanned=cloud-agent,cloud-api,cloud-apidoc,cloud-awsapi,cloud-cli,cloud-client-ui,cloud-console-proxy,cloud-core,cloud-devcloud,cloud-devcloud-kvm,cloud-developer,cloud-engine,cloud-engine-api,cloud-engine-components-api,cloud-engine-compute,cloud-engine-network,cloud-engine-orchestration,cloud-engine-schema,cloud-engine-service,cloud-engine-storage,cloud-engine-storage-backup,cloud-engine-storage-image,cloud-engine-storage-imagemotion,cloud-engine-storage-integration-test,cloud-engine-storage-snapshot,cloud-engine-storage-volume,cloud-framework-events,cloud-framework-ipc,cloud-framework-rest,cloud-marvin,cloud-mom-rabbitmq,cloud-patches,cloud-plugin-acl-static-role-based,cloud-plugin-api-discovery,cloud-plugin-api-limit-account-based,cloud-plugin-console-proxy,cloud-plugin-example-dns-notifier,cloud-plugin-host-allocator-random,cloud-plugin-hypervisor-baremetal,cloud-plugin-hypervisor-kvm,cloud-plugin-hypervisor-ovm,cloud
 -plugin-hypervisor-simulator,cloud-plugin-hypervisor-ucs,cloud-plugin-hypervisor-vmware,cloud-plugin-hypervisor-xen,cloud-plugin-netapp,cloud-plugin-network-elb,cloud-plugin-network-f5,cloud-plugin-network-netscaler,cloud-plugin-network-nvp,cloud-plugin-network-ovs,cloud-plugin-network-srx,cloud-plugin-network-vns,cloud-plugin-planner-user-concentrated-pod,cloud-plugin-planner-user-dispersing,cloud-plugin-snmp-alerts,cloud-plugin-storage-allocator-random,cloud-plugin-storage-image-s3,cloud-plugin-storage-volume-default,cloud-plugin-storage-volume-solidfire,cloud-plugin-syslog-alerts,cloud-plugin-user-authenticator-ldap,cloud-plugin-user-authenticator-md5,cloud-plugin-user-authenticator-plaintext,cloud-plugin-user-authenticator-saml2,cloud-plugin-user-authenticator-sha256salted,cloud-server,cloud-testclient,cloud-tools,cloud-usage,cloud-utils,cloud-vmware-base,cloudstack,cloudstack-framework,cloudstack-plugins,xapi,cloud-framework-jobs,cloud-plugin-host-anti-affinity,cloud-plugin-net
 work-cisco-vnmc,cloud-plugin-network-midonet,cloud-secondary-storage,cloudstack-services,cloud-plugin-network-internallb,cloud-plugin-planner-implicit-dedication,cloudstack-service-console-proxy
-/instance/org.eclipse.jdt.debug.ui/org.eclipse.debug.ui.ExpressionView.org.eclipse.jdt.debug.ui.show_null_entries=true
-/instance/org.eclipse.jdt.ui/sp_cleanup.correct_indentation=false
-/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter.comment.format_source_code=true
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+/instance/org.eclipse.wst.sse.core/task-tag-projects-already-scanned=cloud-agent,cloud-api,cloud-apidoc,cloud-awsapi,cloud-cli,cloud-client-ui,cloud-console-proxy,cloud-core,cloud-devcloud,cloud-devcloud-kvm,cloud-developer,cloud-engine,cloud-engine-api,cloud-engine-components-api,cloud-engine-compute,cloud-engine-network,cloud-engine-orchestration,cloud-engine-schema,cloud-engine-service,cloud-engine-storage,cloud-engine-storage-backup,cloud-engine-storage-image,cloud-engine-storage-imagemotion,cloud-engine-storage-integration-test,cloud-engine-storage-snapshot,cloud-engine-storage-volume,cloud-framework-events,cloud-framework-ipc,cloud-framework-rest,cloud-marvin,cloud-mom-rabbitmq,cloud-patches,cloud-plugin-acl-static-role-based,cloud-plugin-api-discovery,cloud-plugin-api-limit-account-based,cloud-plugin-console-proxy,cloud-plugin-example-dns-notifier,cloud-plugin-host-allocator-random,cloud-plugin-hypervisor-baremetal,cloud-plugin-hypervisor-kvm,cloud-plugin-hypervisor-ovm,cloud
 -plugin-hypervisor-simulator,cloud-plugin-hypervisor-ucs,cloud-plugin-hypervisor-vmware,cloud-plugin-hypervisor-xen,cloud-plugin-netapp,cloud-plugin-network-elb,cloud-plugin-network-f5,cloud-plugin-network-netscaler,cloud-plugin-network-nvp,cloud-plugin-network-ovs,cloud-plugin-network-srx,cloud-plugin-network-bigswitch,cloud-plugin-planner-user-concentrated-pod,cloud-plugin-planner-user-dispersing,cloud-plugin-snmp-alerts,cloud-plugin-storage-allocator-random,cloud-plugin-storage-image-s3,cloud-plugin-storage-volume-default,cloud-plugin-storage-volume-solidfire,cloud-plugin-syslog-alerts,cloud-plugin-user-authenticator-ldap,cloud-plugin-user-authenticator-md5,cloud-plugin-user-authenticator-plaintext,cloud-plugin-user-authenticator-saml2,cloud-plugin-user-authenticator-sha256salted,cloud-server,cloud-testclient,cloud-tools,cloud-usage,cloud-utils,cloud-vmware-base,cloudstack,cloudstack-framework,cloudstack-plugins,xapi,cloud-framework-jobs,cloud-plugin-host-anti-affinity,cloud-plug
 in-network-cisco-vnmc,cloud-plugin-network-midonet,cloud-secondary-storage,cloudstack-services,cloud-plugin-network-internallb,cloud-plugin-planner-implicit-dedication,cloudstack-service-console-proxy
+/instance/org.eclipse.jdt.debug.ui/org.eclipse.debug.ui.ExpressionView.org.eclipse.jdt.debug.ui.show_null_entries=true
+/instance/org.eclipse.jdt.ui/sp_cleanup.correct_indentation=false
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter.comment.format_source_code=true
 /instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
 /instance/org.eclipse.jdt.ui/cleanup.never_use_parentheses_in_expressions=true
 @org.eclipse.debug.core=3.7.100.v20120521-2012

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01864ef7/ui/dictionary.jsp
----------------------------------------------------------------------
diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp
index 3f5d73b..a967c90 100644
--- a/ui/dictionary.jsp
+++ b/ui/dictionary.jsp
@@ -328,7 +328,7 @@ dictionary = {
 'label.add.account.to.project': '<fmt:message key="label.add.account.to.project" />',
 'label.add.ACL': '<fmt:message key="label.add.ACL" />',
 'label.add.affinity.group': '<fmt:message key="label.add.affinity.group" />',
-'label.add.BigSwitchVns.device': '<fmt:message key="label.add.BigSwitchVns.device" />',
+'label.add.BigSwitchBcf.device': '<fmt:message key="label.add.BigSwitchBcf.device" />',
 'label.add.by.cidr': '<fmt:message key="label.add.by.cidr" />',
 'label.add.by': '<fmt:message key="label.add.by" />',
 'label.add.by.group': '<fmt:message key="label.add.by.group" />',
@@ -521,7 +521,7 @@ dictionary = {
 'label.default.use': '<fmt:message key="label.default.use" />',
 'label.default.view': '<fmt:message key="label.default.view" />',
 'label.delete.affinity.group': '<fmt:message key="label.delete.affinity.group" />',
-'label.delete.BigSwitchVns': '<fmt:message key="label.delete.BigSwitchVns" />',
+'label.delete.BigSwitchBcf': '<fmt:message key="label.delete.BigSwitchBcf" />',
 'label.delete.F5': '<fmt:message key="label.delete.F5" />',
 'label.delete': '<fmt:message key="label.delete" />',
 'label.delete.gateway': '<fmt:message key="label.delete.gateway" />',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01864ef7/ui/dictionary2.jsp
----------------------------------------------------------------------
diff --git a/ui/dictionary2.jsp b/ui/dictionary2.jsp
index 3ecffac..7353a9d 100644
--- a/ui/dictionary2.jsp
+++ b/ui/dictionary2.jsp
@@ -452,6 +452,7 @@ under the License.
 'message.configuring.public.traffic': '<fmt:message key="message.configuring.public.traffic" />',
 'message.configuring.storage.traffic': '<fmt:message key="message.configuring.storage.traffic" />',
 'message.confirm.action.force.reconnect': '<fmt:message key="message.confirm.action.force.reconnect" />',
+'message.confirm.delete.BigSwitchBcf': '<fmt:message key="message.confirm.delete.BigSwitchBcf" />',
 'message.confirm.delete.F5': '<fmt:message key="message.confirm.delete.F5" />',
 'message.confirm.delete.BrocadeVcs': '<fmt:message key="message.confirm.delete.BrocadeVcs" />',
 'message.confirm.delete.NetScaler': '<fmt:message key="message.confirm.delete.NetScaler" />',
@@ -758,8 +759,9 @@ under the License.
 'label.nicira.nvp.details': '<fmt:message key="label.nicira.nvp.details" />',
 'label.added.brocade.vcs.switch': '<fmt:message key="label.added.brocade.vcs.switch" />',
 'label.brocade.vcs.details': '<fmt:message key="label.brocade.vcs.details" />',
-'label.added.new.bigswitch.vns.controller': '<fmt:message key="label.added.new.bigswitch.vns.controller" />',
-'label.bigswitch.vns.details': '<fmt:message key="label.bigswitch.vns.details" />',
+'label.added.new.bigswitch.bcf.controller': '<fmt:message key="label.added.new.bigswitch.bcf.controller" />',
+'label.bigswitch.bcf.details': '<fmt:message key="label.bigswitch.bcf.details" />',
+'label.bigswitch.bcf.nat': '<fmt:message key="label.bigswitch.bcf.nat" />',
 'label.dedicate': '<fmt:message key="label.dedicate" />',
 'label.dedicate.pod': '<fmt:message key="label.dedicate.pod" />',
 'label.pod.dedicated': '<fmt:message key="label.pod.dedicated" />',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01864ef7/ui/scripts/configuration.js
----------------------------------------------------------------------
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index 14c50f4..ceb0485 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -2286,7 +2286,7 @@
                                         //p.s. Netscaler is supported in both vpc and non-vpc
                                         if ($useVpc.is(':visible') && $useVpcCb.is(':checked')) { //*** vpc ***
                                             $optionsOfProviders.each(function(index) {
-                                                if ($(this).val() == 'InternalLbVm' || $(this).val() == 'VpcVirtualRouter' || $(this).val() == 'Netscaler'  || $(this).val() == 'NuageVsp' || $(this).val() == 'NuageVspVpc') {
+                                                if ($(this).val() == 'InternalLbVm' || $(this).val() == 'VpcVirtualRouter' || $(this).val() == 'Netscaler'  || $(this).val() == 'NuageVsp' || $(this).val() == 'NuageVspVpc' || $(this).val() == 'BigSwitchBcf') {
                                                     $(this).attr('disabled', false);
                                                 } else {
                                                     $(this).attr('disabled', true);
@@ -3578,25 +3578,29 @@
                                             });
                                             networkServiceObjs.push({
                                                 name: 'Gateway',
-                                                provider: [{name: 'VpcVirtualRouter'}]
+                                                provider: [{name: 'VpcVirtualRouter'},
+                                                           {name: 'BigSwitchBcf'}]
                                             });
                                             networkServiceObjs.push({
                                                 name: 'StaticNat',
                                                 provider: [
                                                        {name: 'VpcVirtualRouter'},
-                                                       {name: 'NuageVsp'}]
+                                                       {name: 'NuageVsp'},
+                                                       {name: 'BigSwitchBcf'}]
                                             });
                                             networkServiceObjs.push({
                                                 name: 'SourceNat',
                                                 provider: [
                                                        {name: 'VpcVirtualRouter'},
-                                                       {name: 'NuageVsp'}]
+                                                       {name: 'NuageVsp'},
+                                                       {name: 'BigSwitchBcf'}]
                                             });
                                             networkServiceObjs.push({
                                                 name: 'NetworkACL',
                                                 provider: [
                                                        {name: 'VpcVirtualRouter'},
-                                                       {name: 'NuageVsp'}]
+                                                       {name: 'NuageVsp'},
+                                                       {name: 'BigSwitchBcf'}]
                                             });
                                             networkServiceObjs.push({
                                                 name: 'PortForwarding',
@@ -3608,12 +3612,14 @@
                                             });
                                             networkServiceObjs.push({
                                                 name: 'Vpn',
-                                                provider: [{name: 'VpcVirtualRouter'}]
+                                                provider: [{name: 'VpcVirtualRouter'},
+                                                           {name: 'BigSwitchBcf'}]
                                             });
 
                                             networkServiceObjs.push({
                                                 name: 'Connectivity',
                                                 provider: [
+                                                    {name: 'BigSwitchBcf'},
                                                     {name: 'NiciraNvp'},
                                                     {name: 'Ovs'},
                                                     {name: 'JuniperContrailVpcRouter'},

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01864ef7/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 126b1fc..b1aafaa 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -6024,14 +6024,14 @@
                             }
                         }
                     },
-                    // BigSwitch Vns provider detail view
-                    bigswitchVns: {
+                    // BigSwitch BCF provider detail view
+                    bigswitchBcf: {
                         type: 'detailView',
-                        id: 'bigswitchVnsProvider',
-                        label: 'label.bigswitchVns',
+                        id: 'bigswitchBcfProvider',
+                        label: 'label.bigswitchBcf',
                         viewAll: {
                             label: 'label.devices',
-                            path: '_zone.bigswitchVnsDevices'
+                            path: '_zone.bigswitchBcfDevices'
                         },
                         tabs: {
                             details: {
@@ -6047,31 +6047,43 @@
                                     }
                                 }],
                                 dataProvider: function (args) {
-                                    refreshNspData("BigSwitchVns");
+                                    refreshNspData("BigSwitchBcf");
                                     var providerObj;
                                     $(nspHardcodingArray).each(function () {
-                                        if (this.id == "bigswitchVns") {
+                                        if (this.id == "bigswitchBcf") {
                                             providerObj = this;
                                             return false;
                                         }
                                     });
                                     args.response.success({
                                         data: providerObj,
-                                        actionFilter: networkProviderActionFilter('bigswitchVns')
+                                        actionFilter: networkProviderActionFilter('bigswitchBcf')
                                     });
                                 }
                             }
                         },
                         actions: {
                             add: {
-                                label: 'label.add.BigSwitchVns.device',
+                                label: 'label.add.BigSwitchBcf.device',
                                 createForm: {
-                                    title: 'label.add.BigSwitchVns.device',
+                                    title: 'label.add.BigSwitchBcf.device',
                                     preFilter: function (args) {
                                     },
                                     fields: {
                                         host: {
-                                            label: 'label.ip.address'
+                                            label: 'label.host.name'
+                                        },
+                                        username: {
+                                            label: 'label.username'
+                                        },
+                                        password: {
+                                            label: 'label.password',
+                                            isPassword: true
+                                        },
+                                        nat: {
+                                                label: 'label.bigswitch.bcf.nat',
+                                                isBoolean: true,
+                                                isChecked: false
                                         },
                                         numretries: {
                                             label: 'label.numretries',
@@ -6080,14 +6092,14 @@
                                     }
                                 },
                                 action: function (args) {
-                                    if (nspMap[ "bigswitchVns"] == null) {
+                                    if (nspMap[ "bigswitchBcf"] == null) {
                                         $.ajax({
-                                            url: createURL("addNetworkServiceProvider&name=BigSwitchVns&physicalnetworkid=" + selectedPhysicalNetworkObj.id),
+                                            url: createURL("addNetworkServiceProvider&name=BigSwitchBcf&physicalnetworkid=" + selectedPhysicalNetworkObj.id),
                                             dataType: "json",
                                             async: true,
                                             success: function (json) {
                                                 var jobId = json.addnetworkserviceproviderresponse.jobid;
-                                                var addBigSwitchVnsProviderIntervalID = setInterval(function () {
+                                                var addBigSwitchBcfProviderIntervalID = setInterval(function () {
                                                     $.ajax({
                                                         url: createURL("queryAsyncJobResult&jobId=" + jobId),
                                                         dataType: "json",
@@ -6096,18 +6108,18 @@
                                                             if (result.jobstatus == 0) {
                                                                 return; //Job has not completed
                                                             } else {
-                                                                clearInterval(addBigSwitchVnsProviderIntervalID);
+                                                                clearInterval(addBigSwitchBcfProviderIntervalID);
                                                                 if (result.jobstatus == 1) {
-                                                                    nspMap[ "bigswitchVns"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider;
-                                                                    addBigSwitchVnsDevice(args, selectedPhysicalNetworkObj, "addBigSwitchVnsDevice", "addbigswitchvnsdeviceresponse", "bigswitchvnsdevice")
+                                                                    nspMap[ "bigswitchBcf"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider;
+                                                                    addBigSwitchBcfDevice(args, selectedPhysicalNetworkObj, "addBigSwitchBcfDevice", "addbigswitchbcfdeviceresponse", "bigswitchbcfdevice")
                                                                 } else if (result.jobstatus == 2) {
-                                                                    alert("addNetworkServiceProvider&name=BigSwitchVns failed. Error: " + _s(result.jobresult.errortext));
+                                                                    alert("addNetworkServiceProvider&name=BigSwitchBcf failed. Error: " + _s(result.jobresult.errortext));
                                                                 }
                                                             }
                                                         },
                                                         error: function (XMLHttpResponse) {
                                                             var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
-                                                            alert("addNetworkServiceProvider&name=BigSwitchVns failed. Error: " + errorMsg);
+                                                            alert("addNetworkServiceProvider&name=BigSwitchBcf failed. Error: " + errorMsg);
                                                         }
                                                     });
                                                 },
@@ -6115,12 +6127,12 @@
                                             }
                                         });
                                     } else {
-                                        addBigSwitchVnsDevice(args, selectedPhysicalNetworkObj, "addBigSwitchVnsDevice", "addbigswitchvnsdeviceresponse", "bigswitchvnsdevice")
+                                        addBigSwitchBcfDevice(args, selectedPhysicalNetworkObj, "addBigSwitchBcfDevice", "addbigswitchbcfdeviceresponse", "bigswitchbcfdevice")
                                     }
                                 },
                                 messages: {
                                     notification: function (args) {
-                                        return 'label.add.BigSwitchVns.device';
+                                        return 'label.add.BigSwitchBcf.device';
                                     }
                                 },
                                 notification: {
@@ -6131,7 +6143,7 @@
                                 label: 'label.enable.provider',
                                 action: function (args) {
                                     $.ajax({
-                                        url: createURL("updateNetworkServiceProvider&id=" + nspMap[ "bigswitchVns"].id + "&state=Enabled"),
+                                        url: createURL("updateNetworkServiceProvider&id=" + nspMap[ "bigswitchBcf"].id + "&state=Enabled"),
                                         dataType: "json",
                                         success: function (json) {
                                             var jid = json.updatenetworkserviceproviderresponse.jobid;
@@ -6162,7 +6174,7 @@
                                 label: 'label.disable.provider',
                                 action: function (args) {
                                     $.ajax({
-                                        url: createURL("updateNetworkServiceProvider&id=" + nspMap[ "bigswitchVns"].id + "&state=Disabled"),
+                                        url: createURL("updateNetworkServiceProvider&id=" + nspMap[ "bigswitchBcf"].id + "&state=Disabled"),
                                         dataType: "json",
                                         success: function (json) {
                                             var jid = json.updatenetworkserviceproviderresponse.jobid;
@@ -6193,7 +6205,7 @@
                                 label: 'label.shutdown.provider',
                                 action: function (args) {
                                     $.ajax({
-                                        url: createURL("deleteNetworkServiceProvider&id=" + nspMap[ "bigswitchVns"].id),
+                                        url: createURL("deleteNetworkServiceProvider&id=" + nspMap[ "bigswitchBcf"].id),
                                         dataType: "json",
                                         success: function (json) {
                                             var jid = json.deletenetworkserviceproviderresponse.jobid;
@@ -12709,11 +12721,11 @@
                     }
                 }
             },
-            bigswitchVnsDevices: {
-                id: 'bigswitchVnsDevices',
+            bigswitchBcfDevices: {
+                id: 'bigswitchBcfDevices',
                 title: 'label.devices',
                 listView: {
-                    id: 'bigswitchVnsDevices',
+                    id: 'bigswitchBcfDevices',
                     fields: {
                         hostname: {
                             label: 'label.bigswitch.controller.address'
@@ -12721,14 +12733,35 @@
                     },
                     actions: {
                         add: {
-                            label: 'label.add.BigSwitchVns.device',
+                            label: 'label.add.BigSwitchBcf.device',
                             createForm: {
-                                title: 'label.add.BigSwitchVns.device',
+                                title: 'label.add.BigSwitchBcf.device',
                                 preFilter: function (args) {
                                 },
                                 fields: {
                                     host: {
-                                        label: 'label.ip.address'
+                                        label: 'label.ip.address',
+                                        validation: {
+                                                     required: true
+                                                 }
+                                    },
+                                    username: {
+                                        label: 'label.username',
+                                        validation: {
+                                                     required: true
+                                                 }
+                                    },
+                                    password: {
+                                        label: 'label.password',
+                                        isPassword: true,
+                                        validation: {
+                                                     required: true
+                                                 }
+                                    },
+                                    nat: {
+                                                label: 'label.bigswitch.bcf.nat',
+                                                isBoolean: true,
+                                                isChecked: false
                                     },
                                     numretries: {
                                         label: 'label.numretries',
@@ -12737,14 +12770,14 @@
                                 }
                             },
                             action: function (args) {
-                                if (nspMap[ "bigswitchVns"] == null) {
+                                if (nspMap[ "bigswitchBcf"] == null) {
                                     $.ajax({
-                                        url: createURL("addNetworkServiceProvider&name=BigSwitchVns&physicalnetworkid=" + selectedPhysicalNetworkObj.id),
+                                        url: createURL("addNetworkServiceProvider&name=BigSwitchBcf&physicalnetworkid=" + selectedPhysicalNetworkObj.id),
                                         dataType: "json",
                                         async: true,
                                         success: function (json) {
                                             var jobId = json.addnetworkserviceproviderresponse.jobid;
-                                            var addBigSwitchVnsProviderIntervalID = setInterval(function () {
+                                            var addBigSwitchBcfProviderIntervalID = setInterval(function () {
                                                 $.ajax({
                                                     url: createURL("queryAsyncJobResult&jobId=" + jobId),
                                                     dataType: "json",
@@ -12753,18 +12786,18 @@
                                                         if (result.jobstatus == 0) {
                                                             return;
                                                         } else {
-                                                            clearInterval(addBigSwitchVnsProviderIntervalID);
+                                                            clearInterval(addBigSwitchBcfProviderIntervalID);
                                                             if (result.jobstatus == 1) {
-                                                                nspMap[ "bigswitchVns"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider;
-                                                                addBigSwitchVnsDevice(args, selectedPhysicalNetworkObj, "addBigSwitchVnsDevice", "addbigswitchvnsdeviceresponse", "bigswitchvnsdevice")
+                                                                nspMap[ "bigswitchBcf"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider;
+                                                                addBigSwitchBcfDevice(args, selectedPhysicalNetworkObj, "addBigSwitchBcfDevice", "addbigswitchbcfdeviceresponse", "bigswitchbcfdevice")
                                                             } else if (result.jobstatus == 2) {
-                                                                alert("addNetworkServiceProvider&name=BigSwitchVns failed. Error: " + _s(result.jobresult.errortext));
+                                                                alert("addNetworkServiceProvider&name=BigSwitchBcf failed. Error: " + _s(result.jobresult.errortext));
                                                             }
                                                         }
                                                     },
                                                     error: function (XMLHttpResponse) {
                                                         var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
-                                                        alert("addNetworkServiceProvider&name=BigSwitchVns failed. Error: " + errorMsg);
+                                                        alert("addNetworkServiceProvider&name=BigSwitchBcf failed. Error: " + errorMsg);
                                                     }
                                                 });
                                             },
@@ -12772,13 +12805,13 @@
                                         }
                                     });
                                 } else {
-                                    addBigSwitchVnsDevice(args, selectedPhysicalNetworkObj, "addBigSwitchVnsDevice", "addbigswitchvnsdeviceresponse", "bigswitchvnsdevice")
+                                    addBigSwitchBcfDevice(args, selectedPhysicalNetworkObj, "addBigSwitchBcfDevice", "addbigswitchbcfdeviceresponse", "bigswitchbcfdevice")
                                 }
                             },
                             
                             messages: {
                                 notification: function (args) {
-                                    return 'label.added.new.bigswitch.vns.controller';
+                                    return 'label.added.new.bigswitch.bcf.controller';
                                 }
                             },
                             notification: {
@@ -12788,7 +12821,7 @@
                     },
                     dataProvider: function (args) {
                         $.ajax({
-                            url: createURL("listBigSwitchVnsDevices&physicalnetworkid=" + selectedPhysicalNetworkObj.id),
+                            url: createURL("listBigSwitchBcfDevices&physicalnetworkid=" + selectedPhysicalNetworkObj.id),
                             data: {
                                 page: args.page,
                                 pageSize: pageSize
@@ -12796,7 +12829,7 @@
                             dataType: "json",
                             async: false,
                             success: function (json) {
-                                var items = json.listbigswitchvnsdeviceresponse.bigswitchvnsdevice;
+                                var items = json.listbigswitchbcfdeviceresponse.bigswitchbcfdevice;
                                 args.response.success({
                                     data: items
                                 });
@@ -12804,25 +12837,25 @@
                         });
                     },
                     detailView: {
-                        name: 'label.bigswitch.vns.details',
+                        name: 'label.bigswitch.bcf.details',
                         actions: {
                             'remove': {
-                                label: 'label.delete.BigSwitchVns',
+                                label: 'label.delete.BigSwitchBcf',
                                 messages: {
                                     confirm: function (args) {
-                                        return 'message.confirm.delete.BigSwitchVns';
+                                        return 'message.confirm.delete.BigSwitchBcf';
                                     },
                                     notification: function (args) {
-                                        return 'label.delete.BigSwitchVns';
+                                        return 'label.delete.BigSwitchBcf';
                                     }
                                 },
                                 action: function (args) {
                                     $.ajax({
-                                        url: createURL("deleteBigSwitchVnsDevice&vnsdeviceid=" + args.context.bigswitchvnsDevices[0].vnsdeviceid),
+                                        url: createURL("deleteBigSwitchBcfDevice&bcfdeviceid=" + args.context.bigswitchBcfDevices[0].bcfdeviceid),
                                         dataType: "json",
                                         async: true,
                                         success: function (json) {
-                                            var jid = json.deletebigswitchvnsdeviceresponse.jobid;
+                                            var jid = json.deletebigswitchbcfdeviceresponse.jobid;
                                             args.response.success({
                                                 _custom: {
                                                     jobId: jid
@@ -12840,20 +12873,20 @@
                             details: {
                                 title: 'label.details',
                                 fields:[ {
-                                    vnsdeviceid: {
+                                    bcfdeviceid: {
                                         label: 'label.id'
                                     },
                                     hostname: {
-                                        label: 'label.ip.address'
+                                        label: 'label.host.name'
                                     }
                                 }],
                                 dataProvider: function (args) {
                                     $.ajax({
-                                        url: createURL("listBigSwitchVnsDevices&vnsdeviceid=" + args.context.bigswitchVnsDevices[0].vnsdeviceid),
+                                        url: createURL("listBigSwitchBcfDevices&bcfdeviceid=" + args.context.bigswitchBcfDevices[0].bcfdeviceid),
                                         dataType: "json",
                                         async: true,
                                         success: function (json) {
-                                            var item = json.listbigswitchvnsdeviceresponse.bigswitchvnsdevice[0];
+                                            var item = json.listbigswitchbcfdeviceresponse.bigswitchbcfdevice[0];
                                             args.response.success({
                                                 data: item
                                             });
@@ -20159,11 +20192,14 @@
         });
     }
     
-    function addBigSwitchVnsDevice(args, physicalNetworkObj, apiCmd, apiCmdRes, apiCmdObj) {
+    function addBigSwitchBcfDevice(args, physicalNetworkObj, apiCmd, apiCmdRes, apiCmdObj) {
         var array1 =[];
         array1.push("&physicalnetworkid=" + physicalNetworkObj.id);
         array1.push("&hostname=" + todb(args.data.host));
-        
+        array1.push("&username=" + args.data.username);
+        array1.push("&password=" + args.data.password);
+        array1.push("&nat=" + (args.data.nat == 'on' ? "true": "false"));
+
         $.ajax({
             url: createURL(apiCmd + array1.join("")),
             dataType: "json",
@@ -20905,8 +20941,8 @@
 							case "BrocadeVcs":
                             nspMap[ "brocadeVcs"] = items[i];
                             break;
-                            case "BigSwitchVns":
-                            nspMap[ "bigswitchVns"] = items[i];
+                            case "BigSwitchBcf":
+                            nspMap[ "bigswitchBcf"] = items[i];
                             break;
                             case "Ovs":
                             nspMap[ "Ovs"] = items[i];
@@ -20947,9 +20983,9 @@
             state: nspMap.brocadeVcs ? nspMap.brocadeVcs.state: 'Disabled'
         },
         {
-            id: 'bigswitchVns',
-            name: 'BigSwitch Vns',
-            state: nspMap.bigswitchVns ? nspMap.bigswitchVns.state: 'Disabled'
+            id: 'bigswitchBcf',
+            name: 'BigSwitch BCF',
+            state: nspMap.bigswitchBcf ? nspMap.bigswitchBcf.state: 'Disabled'
         },
         {
             id: 'BaremetalDhcpProvider',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01864ef7/ui/scripts/ui-custom/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/zoneWizard.js b/ui/scripts/ui-custom/zoneWizard.js
index 02552f9..8344d95 100644
--- a/ui/scripts/ui-custom/zoneWizard.js
+++ b/ui/scripts/ui-custom/zoneWizard.js
@@ -713,8 +713,8 @@
                                 value: 'STT'
                             }).html('STT'),
                             $('<option>').attr({
-                                value: 'VNS'
-                            }).html('VNS'),
+                                value: 'BCF_SEGMENT'
+                            }).html('BCF_SEGMENT'),
                             $('<option>').attr({
                                 value: 'SSP'
                             }).html('SSP'),


Mime
View raw message