<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.christophchamp.com/index.php?action=history&amp;feed=atom&amp;title=Rackspace_API%2FCloud_Networks</id>
		<title>Rackspace API/Cloud Networks - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.christophchamp.com/index.php?action=history&amp;feed=atom&amp;title=Rackspace_API%2FCloud_Networks"/>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=Rackspace_API/Cloud_Networks&amp;action=history"/>
		<updated>2026-04-30T15:20:10Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://wiki.christophchamp.com/index.php?title=Rackspace_API/Cloud_Networks&amp;diff=7662&amp;oldid=prev</id>
		<title>Christoph at 17:29, 19 September 2019</title>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=Rackspace_API/Cloud_Networks&amp;diff=7662&amp;oldid=prev"/>
				<updated>2019-09-19T17:29:50Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:29, 19 September 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;div style=&amp;quot;margin: 10px; padding: 5px; border: 2px solid red; text-align: center&amp;quot;&amp;gt;'''NOTE:''' This article was written in 2014 and is no longer maintained.&amp;lt;/div&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This article will show various examples and techniques for working with Rackspace's [http://www.rackspace.com/cloud/networks Cloud Networks] (NaaS) RESTful API.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This article will show various examples and techniques for working with Rackspace's [http://www.rackspace.com/cloud/networks Cloud Networks] (NaaS) RESTful API.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Christoph</name></author>	</entry>

	<entry>
		<id>http://wiki.christophchamp.com/index.php?title=Rackspace_API/Cloud_Networks&amp;diff=6215&amp;oldid=prev</id>
		<title>Christoph: New page: This article will show various examples and techniques for working with Rackspace's [http://www.rackspace.com/cloud/networks Cloud Networks] (NaaS) RESTful API.  ==HOWTO: create a Cloud Ne...</title>
		<link rel="alternate" type="text/html" href="http://wiki.christophchamp.com/index.php?title=Rackspace_API/Cloud_Networks&amp;diff=6215&amp;oldid=prev"/>
				<updated>2014-12-23T10:47:59Z</updated>
		
		<summary type="html">&lt;p&gt;New page: This article will show various examples and techniques for working with Rackspace&amp;#039;s [http://www.rackspace.com/cloud/networks Cloud Networks] (NaaS) RESTful API.  ==HOWTO: create a Cloud Ne...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This article will show various examples and techniques for working with Rackspace's [http://www.rackspace.com/cloud/networks Cloud Networks] (NaaS) RESTful API.&lt;br /&gt;
&lt;br /&gt;
==HOWTO: create a Cloud Network and attach it to a Cloud Server==&lt;br /&gt;
&lt;br /&gt;
''NOTE: This section will only cover the OpenStack Nova-Network API, not the new OpenStack Neutron API (see: &amp;quot;[http://docs.rackspace.com/networks/api/v2/cn-devguide/content/section_nova_v_neutron.html Networking: Neutron versus Nova-Network]&amp;quot; for details on the difference).''&lt;br /&gt;
&lt;br /&gt;
*Step #0: Setup your environment variables (and authenticate to receive your 24-hour valid token):&lt;br /&gt;
	&lt;br /&gt;
 $ ACCOUNT=&amp;lt;RAX_ACCOUNT&amp;gt;&lt;br /&gt;
 $ USERNAME=&amp;lt;RAX_USERNAME&amp;gt;&lt;br /&gt;
 $ APIKEY=&amp;lt;RAX_API_KEY&amp;gt;&lt;br /&gt;
 $ TOKEN=`curl -sXPOST &amp;lt;nowiki&amp;gt;https://identity.api.rackspacecloud.com/v2.0/tokens&amp;lt;/nowiki&amp;gt; \&lt;br /&gt;
          -d'{&amp;quot;auth&amp;quot;:{&amp;quot;RAX-KSKEY:apiKeyCredentials&amp;quot;: &amp;quot;username&amp;quot;:&amp;quot;'$USERNAME'&amp;quot;,&amp;quot;apiKey&amp;quot;:&amp;quot;'$APIKEY'&amp;quot;}}}' \&lt;br /&gt;
          -H&amp;quot;Content-type:application/json&amp;quot; | \&lt;br /&gt;
          python -c 'import sys,json;data=json.loads(sys.stdin.read());print data[&amp;quot;access&amp;quot;][&amp;quot;token&amp;quot;][&amp;quot;id&amp;quot;]'`&lt;br /&gt;
&lt;br /&gt;
*Step #1: Gather the Cloud Server details:&lt;br /&gt;
&lt;br /&gt;
You first need the &amp;quot;&amp;lt;code&amp;gt;server_id&amp;lt;/code&amp;gt;&amp;quot; (aka the UUID of the Cloud Server you wish to attach a Cloud Network). You can either obtain the UUID of the server in question, or you can query the API like so:&lt;br /&gt;
&lt;br /&gt;
 $ REGION=dfw&lt;br /&gt;
 $ ENDPOINT=&amp;lt;nowiki&amp;gt;https://${REGION}.servers.api.rackspacecloud.com/v2/${ACCOUNT}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 $ # Get a list of all of your Cloud Servers:&lt;br /&gt;
 $ curl -sH &amp;quot;X-Auth-Token: $TOKEN&amp;quot; \&lt;br /&gt;
        -H &amp;quot;Accept: application/json&amp;quot; \&lt;br /&gt;
        &amp;quot;$ENDPOINT/servers&amp;quot; |\&lt;br /&gt;
        python -mjson.tool&lt;br /&gt;
 $ # Or, get only UUID of the Cloud Server in question by using the server's name:&lt;br /&gt;
 $ SERVER_NAME=&amp;quot;my-server-name&amp;quot;&lt;br /&gt;
 $ SERVER_ID=`curl -sH &amp;quot;X-Auth-Token: $TOKEN&amp;quot; -H &amp;quot;Content-Type: application/json&amp;quot;\&lt;br /&gt;
              -H &amp;quot;Accept: application/json&amp;quot; &amp;quot;${ENDPOINT}/servers&amp;quot;|\&lt;br /&gt;
              python -c 'import sys,json;data=json.loads(sys.stdin.read());\&lt;br /&gt;
                         print [i[&amp;quot;id&amp;quot;] for i in data[&amp;quot;servers&amp;quot;]\&lt;br /&gt;
                                if i[&amp;quot;name&amp;quot;]==&amp;quot;'$SERVER_NAME'&amp;quot;][0]'`&lt;br /&gt;
&lt;br /&gt;
* Step #2: Create a Cloud Network:&lt;br /&gt;
&lt;br /&gt;
 $ NETWORK_NAME=&amp;quot;my-network-name&amp;quot;&lt;br /&gt;
 $ CIDR=&amp;quot;192.168.0.0/24&amp;quot;&lt;br /&gt;
 $ curl -XPOST \&lt;br /&gt;
        -H &amp;quot;X-Auth-Token: $TOKEN&amp;quot; \&lt;br /&gt;
        -H &amp;quot;Content-Type: application/json&amp;quot; \&lt;br /&gt;
        -H &amp;quot;Accept: application/json&amp;quot; \&lt;br /&gt;
        &amp;quot;${ENDPOINT}/os-networksv2&amp;quot; \&lt;br /&gt;
        -d '{\&amp;quot;network\&amp;quot;: {\&amp;quot;cidr\&amp;quot;: \&amp;quot;$CIDR\&amp;quot;, &amp;quot;label&amp;quot;: &amp;quot;\$NETWORK_NAME\&amp;quot;}}' |\&lt;br /&gt;
        python -m json.tool&lt;br /&gt;
&lt;br /&gt;
Grab your new Cloud Network's UUID (&amp;quot;id&amp;quot;) from the above output, or capture it with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ NETWORK_ID=`curl -sH &amp;quot;X-Auth-Token: $TOKEN&amp;quot; -H &amp;quot;Content-Type: application/json&amp;quot;\&lt;br /&gt;
              -H &amp;quot;Accept: application/json&amp;quot; &amp;quot;${ENDPOINT}/os-networksv2&amp;quot;|\&lt;br /&gt;
              python -c 'import sys,json;data=json.loads(sys.stdin.read());\&lt;br /&gt;
                         print [i[&amp;quot;id&amp;quot;] for i in data[&amp;quot;networks&amp;quot;]\&lt;br /&gt;
                                if i[&amp;quot;label&amp;quot;]==&amp;quot;'$NETWORK_NAME'&amp;quot;][0]'`&lt;br /&gt;
&lt;br /&gt;
* Step #3: Attach your Cloud Network to your Cloud Server:&lt;br /&gt;
&lt;br /&gt;
 $ # List attached networks (before):&lt;br /&gt;
 $ curl -H &amp;quot;Content-Type:application/json&amp;quot; \&lt;br /&gt;
        -H &amp;quot;X-Auth-Token: $TOKEN&amp;quot; \&lt;br /&gt;
        &amp;quot;$ENDPOINT/servers/${SERVER_ID}/os-virtual-interfacesv2&amp;quot; |\&lt;br /&gt;
        python -mjson.tool&lt;br /&gt;
 &lt;br /&gt;
 $ # Attach a Cloud Network:&lt;br /&gt;
 $ curl -XPOST \&lt;br /&gt;
        -H &amp;quot;Content-Type:application/json&amp;quot; \&lt;br /&gt;
        -H &amp;quot;X-Auth-Token: $TOKEN&amp;quot; \&lt;br /&gt;
        &amp;quot;$ENDPOINT/servers/${SERVER_ID}/os-virtual-interfacesv2&amp;quot; \&lt;br /&gt;
        -d &amp;quot;{\&amp;quot;virtual_interface\&amp;quot;:{\&amp;quot;network_id\&amp;quot;: \&amp;quot;$NETWORK_ID\&amp;quot;}}&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 $ # List attached networks (after):&lt;br /&gt;
 $ curl -H &amp;quot;Content-Type:application/json&amp;quot; \&lt;br /&gt;
        -H &amp;quot;X-Auth-Token: $TOKEN&amp;quot; \&lt;br /&gt;
        &amp;quot;$ENDPOINT/servers/${SERVER_ID}/os-virtual-interfacesv2&amp;quot; |\&lt;br /&gt;
        python -mjson.tool&lt;br /&gt;
&lt;br /&gt;
Note: If you are logged into your Cloud Server (via SSH; as root), you can watch the Cloud Network being attached by leaving the following command running from within the Cloud Server while you are attaching the Cloud Network:&lt;br /&gt;
 $ xenstore-watch vm-data&lt;br /&gt;
&lt;br /&gt;
The output of the above command before, during, and after attaching the Cloud Network will look something like the following:&lt;br /&gt;
 vm-data&lt;br /&gt;
 vm-data/meta&lt;br /&gt;
 vm-data/networking/BC764EFFFFFF  # &amp;lt;- Cloud Network attached&lt;br /&gt;
 vm-data/networking/BC764EFFFFFF&lt;br /&gt;
 vm-data/networking/BC764EFFFFFF&lt;br /&gt;
&lt;br /&gt;
As a side note, you might have noticed that all NextGen virtual interfaces (PublicNet, PrivateNet, and Cloud Networks) on Cloud Servers have the same first three octets in their MAC addresses: &amp;quot;BC:76:4E&amp;quot;. This is Rackspace's [http://en.wikipedia.org/wiki/Organizationally_unique_identifier Organizationally Unique Identifier] (OUI), so all of your virtual interfaces should match that (and something might have gone wrong if they do not). If you have [https://www.wireshark.org/ Wireshark] installed on your Cloud Server, you can get Rackspace's OUI with:&lt;br /&gt;
&lt;br /&gt;
 $ grep Rackspace /usr/share/wireshark/manuf&lt;br /&gt;
 BC:76:4E        Rackspac               # Rackspace US, Inc.&lt;br /&gt;
&lt;br /&gt;
* Step #4: Test your new Cloud Network:&lt;br /&gt;
&lt;br /&gt;
The new Cloud Network's configuration settings will be stored in the following file (it might not be &amp;quot;eth2&amp;quot; on your server):&lt;br /&gt;
 /etc/sysconfig/network-scripts/ifcfg-eth2  # Red Hat-based systems&lt;br /&gt;
&lt;br /&gt;
Checking your server network&lt;br /&gt;
 $ ifconfig&lt;br /&gt;
 $ #~OR~&lt;br /&gt;
 $ ip a show&lt;br /&gt;
&lt;br /&gt;
should report the new virtual interface for your new Cloud Network.&lt;br /&gt;
&lt;br /&gt;
You can also check your local XenStore data by running either of the following commands from within your Cloud Server (run as root):&lt;br /&gt;
 $ xenstore-ls vm-data/networking&lt;br /&gt;
 $ xenstore-read vm-data/networking/BC764EFFFFFF&lt;br /&gt;
&lt;br /&gt;
Finally, you can attach this same Cloud Network to another Cloud Server (in the same region/data centre) and make sure these two servers can communicate with each other on this private Cloud Network.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Rackspace API]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Rackspace]]&lt;/div&gt;</summary>
		<author><name>Christoph</name></author>	</entry>

	</feed>