Mailing List Archive

Problem using VIF.get_all_records
Hi,

Now I'm using Xen-3.1.0 Xen Management API to get VIF record,
but I found that something is wrong in the result.
(Actually I applied "VIF.get_all_records" method to get MTU and MAC.)

[Result]
MTU=00:00:4c:df:37:0e
MAC=1500

Result must be following:
MTU=1500
MAC=00:00:4c:df:37:0e

What's the reason?
(Has anyone seen a similar problem?)

Execution result is below.
--------------------
RESULT(PIF.get_all_record):{Status=Success,
Value={0ee6163f-9f65-45d2-846f-15d4db943ca2={MTU=00:00:4c:df:37:0e,
host=90134f96-7478-1757-8a69-775b7eab4292, VLAN=-1,
metrics=4e8e7927-319e-68ea-cd4b-522adbc9bcd3, device=peth0,
uuid=0ee6163f-9f65-45d2-846f-15d4db943ca2, MAC=1500,
network=1ec4cb65-4dc7-1df0-5134-5fbac8fac49c}}}

--------------------
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

public class PIF{

private static XmlRpcClientConfigImpl config;
private static XmlRpcClient client;

public static void main(String[] args) {
URL url = null;
try {
url = new URL("http://xxxx.xxxxx.xx:9363");
} catch (MalformedURLException e) {
System.out.println("Real URL?");
System.exit(-1);
}
config = new XmlRpcClientConfigImpl();
config.setServerURL(url);
client = new XmlRpcClient();
client.setConfig(config);
String username = "any";
String password = "any";
Object[] params = new Object[]{username, password};
HashMap<String, String> result = null;
try {
result = (HashMap)client.execute("session.login_with_password", params);
} catch (XmlRpcException e) {
System.out.println("Could not open session");
System.exit(-1);
}
String status = result.get("Status");
if (status.compareTo("Success") == 0) {
String uuid = result.get("Value");
params = new Object[]{uuid};
try {
result = (HashMap) client.execute("PIF.get_all_records", params);
System.out.println("RESULT(PIF.get_all_record):"+result);
} catch (XmlRpcException e) {
System.out.println("Could not get PIF record");
System.exit(-1);
}
}
}
}

----
kumiko

_______________________________________________
xen-api mailing list
xen-api@lists.xensource.com
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
Re: Problem using VIF.get_all_records [ In reply to ]
Try stopping xend, deleting /var/lib/xend/state/* and restarting xend.

Let me know if it works

Tom

On 24 May 2007, at 15:05, kumiko-gotou@mail.goo.ne.jp wrote:

> Hi,
>
> Now I'm using Xen-3.1.0 Xen Management API to get VIF record,
> but I found that something is wrong in the result.
> (Actually I applied "VIF.get_all_records" method to get MTU and MAC.)
>
> [Result]
> MTU=00:00:4c:df:37:0e
> MAC=1500
>
> Result must be following:
> MTU=1500
> MAC=00:00:4c:df:37:0e
>
> What's the reason?
> (Has anyone seen a similar problem?)
>
> Execution result is below.
> --------------------
> RESULT(PIF.get_all_record):{Status=Success,
> Value={0ee6163f-9f65-45d2-846f-15d4db943ca2={MTU=00:00:4c:df:37:0e,
> host=90134f96-7478-1757-8a69-775b7eab4292, VLAN=-1,
> metrics=4e8e7927-319e-68ea-cd4b-522adbc9bcd3, device=peth0,
> uuid=0ee6163f-9f65-45d2-846f-15d4db943ca2, MAC=1500,
> network=1ec4cb65-4dc7-1df0-5134-5fbac8fac49c}}}
>
> --------------------
> import java.net.MalformedURLException;
> import java.net.URL;
> import java.util.HashMap;
> import org.apache.xmlrpc.XmlRpcException;
> import org.apache.xmlrpc.client.XmlRpcClient;
> import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
>
> public class PIF{
>
> private static XmlRpcClientConfigImpl config;
> private static XmlRpcClient client;
>
> public static void main(String[] args) {
> URL url = null;
> try {
> url = new URL("http://xxxx.xxxxx.xx:9363");
> } catch (MalformedURLException e) {
> System.out.println("Real URL?");
> System.exit(-1);
> }
> config = new XmlRpcClientConfigImpl();
> config.setServerURL(url);
> client = new XmlRpcClient();
> client.setConfig(config);
> String username = "any";
> String password = "any";
> Object[] params = new Object[]{username, password};
> HashMap<String, String> result = null;
> try {
> result = (HashMap)client.execute
> ("session.login_with_password", params);
> } catch (XmlRpcException e) {
> System.out.println("Could not open session");
> System.exit(-1);
> }
> String status = result.get("Status");
> if (status.compareTo("Success") == 0) {
> String uuid = result.get("Value");
> params = new Object[]{uuid};
> try {
> result = (HashMap) client.execute
> ("PIF.get_all_records", params);
> System.out.println("RESULT
> (PIF.get_all_record):"+result);
> } catch (XmlRpcException e) {
> System.out.println("Could not get PIF record");
> System.exit(-1);
> }
> }
> }
> }
>
> ----
> kumiko
>
> _______________________________________________
> xen-api mailing list
> xen-api@lists.xensource.com
> http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api


_______________________________________________
xen-api mailing list
xen-api@lists.xensource.com
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
Re: Problem using VIF.get_all_records [ In reply to ]
>Hi, Tom,

Thanks for your suggestion.


The following attached patch can result the problems.

http://lists.xensource.com/archives/html/xen-devel/2007-05/msg00526.html

-kumiko


24 May 2007 23:59$B$KAw?.$5$l$?!"(B
(tom.wilkie@gmail.com)$B$5$s$N(IR0Y$B$X$N$*JV;v$G$9!#(B

_______________________________________________
xen-api mailing list
xen-api@lists.xensource.com
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api