Skip to content

Instantly share code, notes, and snippets.

@miguelaferreira
Created August 5, 2015 11:59
Show Gist options
  • Save miguelaferreira/74a1e21e17c76d7d21ed to your computer and use it in GitHub Desktop.
Save miguelaferreira/74a1e21e17c76d7d21ed to your computer and use it in GitHub Desktop.
Have deployDataCenter.py create Nicira devices and enable plugin
commit 5c67de19bf9e6544585cb2015cb40130b3f32b0d
Author: Miguel Ferreira <miguelferreira@me.com>
Date: Tue Aug 4 16:45:35 2015 +0200
Configure a NiciraNvp device while deploying a datacenter
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index 4fcd696..73f0e31 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -592,6 +592,18 @@ class DeployDataCenters(object):
debug("==== AddF5 "
"Successful=====")
self.__addToCleanUp("F5LoadBalancer", ret.id)
+ elif provider.name == "NiciraNvp":
+ for device in provider.devices:
+ cmd = addNiciraNvpDevice.addNiciraNvpDeviceCmd()
+ cmd.hostname = device.hostname
+ cmd.username = device.username
+ cmd.password = device.password
+ cmd.transportzoneuuid = device.transportzoneuuid
+ cmd.physicalnetworkid = phynetwrk.id
+ ret = self.__apiClient.addNiciraNvpDevice(cmd)
+ self.__tcRunLogger.\
+ debug("==== AddNiciraNvp Successful =====")
+ self.__addToCleanUp("NiciraNvp", ret.id)
else:
raise InvalidParameterException(
"Device %s doesn't match "
@@ -1133,7 +1145,7 @@ if __name__ == "__main__":
print "\n===Deploy Failed==="
tc_run_logger.debug("\n===Deploy Failed===");
exit(1)
-
+
if options.remove and os.path.isfile(options.remove) and options.input:
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment