First off, networks don't take a "default_netmask" or "default_gateway". They are simply VLANS connected to a PIF (physical interface) on the host.
I use Ruby for my demoing, and I've included a sample below. If you can install Ruby, I've got a solution for finding answers. Else, I'm out. Of course on the following example, I've left out A LOT of possible steps, but you can see the basics. Use the XEN Enterprise API documentation to find the commands. After you install Ruby, run the following from command prompt:
# Run this from the command prompt, it will start the Interactive Ruby shell irb
# Import the XMLRPC/Client library require 'xmlrpc/client'
# For the following, insert the URL for your Connection
# Get your Session ID, use your API username and password
sid = s.call("session.login_with_password", "username", "password")["Value"]
# Get a Network ID network_id = s.call("network.get_all_records", sid)["Value"].keys.first
# Get the Network Information s.call("network.get_record", sid, network_id)
# Create a New Newtork new_network_id = s.call("network.create", sid, {:name_label => "Test Network", :name_description => "Testing - Please Delete Later", :other_config => {}})["Value"]
# Get New Network information s.call("network.get_record", sid, new_network_id)
# Delete New Network s.call("network.destroy", sid, new_network_id)
On Wed, Oct 7, 2009 at 10:35 AM, Leonelli Mauro <m.leonelli@xxxxxxxx> wrote:
Hi Christian,
unfortunately I don’t have any other information on the error because I’m using XenAPI xml-rpc from C#, I imagine.
Anyway here’s the code snippet. Haven’t found any other thread on that, I’m coding quick and dirty to find out how to make it work (think that
green lines could be optional).
System.Collections.Hashtable hash =
new System.Collections.Hashtable();
hash.Add("name_label",
"br69");
hash.Add("name_description",
"br69");
hash.Add("default_netmask", "255.255.255.0");
hash.Add("default_gateway", "10.40.3.1");
hash.Add("other_config", null);
XenAPI.Network.create(_session,
new XenAPI.Network(hash));
ml
What parameters are you passing?
Typically, when you get an error from the server, it will have more information than you've given. For instance, if you pass an unspecified attribute, it will tell you the attribute that is unspecified.
cw
On Wed, Oct 7, 2009 at 10:27 AM, Leonelli Mauro <m.leonelli@xxxxxxxx> wrote:
Hi,
I’m trying to create a new XenAPI.Network but keep on receiving the error CREATE_UNSPECIFIED_ATTRIBUTE
My final goal is to create different Virtual Interfaces each of them on a different bridge and it seems to me that the only way Is to create a different Network for each bridge I want to use, am I right?
Sincerely,
Mauro
--
The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information
by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
--
Christopher Winslett
christopherwinslett@xxxxxxxxx
--
The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information
by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
-- Christopher Winslett christopherwinslett@xxxxxxxxx
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|