Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Commit c5a3c73

Browse files
Andrija Panicrafaelweingartner
authored andcommitted
Instructions on API calls and DB changes, to add new Guest Physical Network (#31)
* Adding new physical network * Adding new Guest Network Added doc, about how to create another Physical Network inside already running/existing Zone, which requires DB changes, and API calls, and dedicate this Physical Zone to Guest Traffic (i.e. for Private Gateway functionality)
1 parent 72356e5 commit c5a3c73

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed
11.5 KB
Loading
5.65 KB
Loading
17.1 KB
Loading

source/optional_installation.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,3 +802,74 @@ Example 2. An S3 Boto Example
802802

803803
.. |Use the GUI to set the configuration variable to true| image:: ./_static/images/ec2-s3-configuration.png
804804
.. |Use the GUI to set the name of a compute service offering to an EC2 instance type API name.| image:: ./_static/images/compute-service-offerings.png
805+
806+
807+
Adding new Guest Physical Network to existing Zone
808+
--------------------------------------
809+
810+
In some cases it might be necessary to add additional Guest Physical Network to already existing Advanced Zone. One example might be that we have been running Zone with Guest Physical Network that uses VXLAN as isolation method (i.e. KVM traffic label set to "bond.150), and we also need to start using Private Gateway functionality, which would not work with current Guest Physical Network Traffic Label (for explanation why this would not work, please see ":ref:`adding-priv-gw-vpc`".
811+
812+
So in example below, we would like to create new Guest Physical Network (Traffic Label set to "bond0" in this example) and later use this Guest Physical Network for other purposes (to provision Private Gateways on top of it)
813+
814+
Depending on the CloudStack version, we can probably accomplish this only by API commands (i.e. CloudMonkey) and direct database changes.
815+
816+
First obtain Zone ID, and then create Physical Network command:
817+
818+
.. code:: bash
819+
820+
cloudmonkey> list zones filter=id | grep id | head -n1
821+
cloudmonkey> create physicalnetwork name="bond0 Private Gateways" broadcastdomainrange=zone zoneid=xxxxxx isolationmethod=VLAN
822+
823+
where "xxxxxxx" is the proper zone ID (output from the first command above).
824+
825+
Here we created new Physical Network (not yet of any type...) inside given zone.
826+
827+
Please note that new Physical Network can not be added, while Zone is in Enabled state!
828+
829+
It is safe to disable Zone (for few seconds) which will just prevent users from provisioning new resources in this Zone, then create Physical Network per instructions from above, and then enable the Zone (this can be done via GUI or CloudMonkey).
830+
831+
Since Physical Network is in Disabled state by default, we need to enable it by:
832+
833+
.. code:: bash
834+
835+
cloudmonkey> list physicalnetworks name="bond0 Private Gateways" | grep id | head -n1
836+
cloudmonkey> update physicalnetwork state=Enabled id=xxxxx
837+
838+
where xxxxx is the correct ID of Physical Network (output from the first command above).
839+
840+
After Physical Network is created, although we selected VLAN as isolation method, it may happen (depending on CloudStack version) that there will be no DB record created (which defines VLAN as isolation method for this new network), so we need to check this and fix it:
841+
842+
.. code:: bash
843+
844+
cloudmonkey> list physicalnetworks name="bond0 Private Gateways" | grep isolationmethods
845+
846+
If above commands gives no output, that means that VLAN was not set as Isolation Method inside DB, in cloud.physical_network_isolation_methods table, so we need to set it:
847+
848+
849+
.. code:: bash
850+
851+
mysql> select id from cloud.physical_network where name="bond0 Private Gateways"
852+
mysql> select max(id) from cloud.physical_network_isolation_methods;
853+
854+
Write down the id and max(id) values (i.e. 204, 10)
855+
856+
.. |Add-physical-network-1.png| image:: ./_static/images/Add-physical-network-1.png
857+
858+
.. code:: bash
859+
860+
mysql> INSERT INTO cloud.physical_network_isolation_methods (id, physical_network_id, isolation_method) VALUES ('11', '204', 'VLAN');
861+
862+
where 11 is actually the next number after the max(id) value, and 204 is the ID of the Physical Network (check the image below)
863+
864+
.. |Add-physical-network-2.png| image:: ./_static/images/Add-physical-network-2.png
865+
866+
Now, that we have set correct Isolation Method for the new Physical Network, and enabled it, we also need to do most critical part, to define that this Physical Network caries Guest traffic. This action is also done via database change.
867+
868+
We want to effectively clone the existing Guest network row from cloud.physical_network_traffic_types table, and then change needed values: ID, UUID, PHYSICAL_NETWORK_ID and KVM_NETWORK_LABEL (in our case, we are using KVM, but same goes for other HyperVisor types)
869+
870+
.. |Add-physical-network-3.png| image:: ./_static/images/Add-physical-network-3.png
871+
872+
873+
After this last step, we are ready to tag these 2 Guest Physical Networks and Network Offerings (regular ones for VPC Guest networks, and the special one used for Private Gateways) and then use these two Guest Networks as originally planned.
874+
875+
For more details on Network tagging, please see ":ref:`adding-priv-gw-vpc`".

0 commit comments

Comments
 (0)