Hello again
Qur project group had a meeting and we discovered that the virtualisation
project is not usefull because we can't read the VMGuestMetrics.
The next is that we can't use any of the set functions and any of the do
something (reeboot, shutdown, ...) because they are bad copied from the get
something functions (its in all classes the same problem). The return in the
if (succsess) statemant is missing so the functions always throw a
BadServerResponse.
Class VM:
public void setNameLabel(String label) throws Types.BadServerResponse,
ConnectionHelper.NoConnectionOnThisThreadException , XmlRpcException {
String method_call = "VM.set_name_label";
String session = ConnectionHelper.instance().getSession();
Object[] method_params = {Marshalling.toXMLRPC(session),
Marshalling.toXMLRPC (this.ref), Marshalling.toXMLRPC(label)};
Map response = ConnectionHelper.instance().dispatch(
method_call, method_params);
if(response.get("Status").equals("Success")) {
Object result = response.get("Value");
// here should be something like an "return;" :)
} else if(response.get("Status").equals("Failure")) {
Object[] error = (Object[]) response.get("ErrorDescription");
}
throw new Types.BadServerResponse(response);
}
The last thing we found is that the getAllRecords (in all classes) always
throws a nullpointerException because the Xen server gives for some
properties null back. In the Types class there are some casts but they don't
check the object reference. If the reference is null the cast throws a
Exception. There sould be something like if (object == null) {return null;}
or anything else
Class Types
public static Map<VMMetrics, VMMetrics.Record>
toMapOfVMMetricsVMMetricsRecord(Object object) {
Map map = (Map) object; // this is the problem when the object null is
Map<VMMetrics, VMMetrics.Record> result = new HashMap<VMMetrics,
VMMetrics.Record>();
Set<Map.Entry> entries = map.entrySet();
for(Map.Entry entry: entries) {
VMMetrics key = toVMMetrics(entry.getKey ());
VMMetrics.Record value = toVMMetricsRecord(entry.getValue());
result.put(key, value);
}
return result;
}
Are there any plans to fix this bugs and implement VMMetrics in the near
future?
Do you know how many time is needed for this changes and how long it takes
for implementation in xen server and xen api?
Best regards
Frank
Qur project group had a meeting and we discovered that the virtualisation
project is not usefull because we can't read the VMGuestMetrics.
The next is that we can't use any of the set functions and any of the do
something (reeboot, shutdown, ...) because they are bad copied from the get
something functions (its in all classes the same problem). The return in the
if (succsess) statemant is missing so the functions always throw a
BadServerResponse.
Class VM:
public void setNameLabel(String label) throws Types.BadServerResponse,
ConnectionHelper.NoConnectionOnThisThreadException , XmlRpcException {
String method_call = "VM.set_name_label";
String session = ConnectionHelper.instance().getSession();
Object[] method_params = {Marshalling.toXMLRPC(session),
Marshalling.toXMLRPC (this.ref), Marshalling.toXMLRPC(label)};
Map response = ConnectionHelper.instance().dispatch(
method_call, method_params);
if(response.get("Status").equals("Success")) {
Object result = response.get("Value");
// here should be something like an "return;" :)
} else if(response.get("Status").equals("Failure")) {
Object[] error = (Object[]) response.get("ErrorDescription");
}
throw new Types.BadServerResponse(response);
}
The last thing we found is that the getAllRecords (in all classes) always
throws a nullpointerException because the Xen server gives for some
properties null back. In the Types class there are some casts but they don't
check the object reference. If the reference is null the cast throws a
Exception. There sould be something like if (object == null) {return null;}
or anything else
Class Types
public static Map<VMMetrics, VMMetrics.Record>
toMapOfVMMetricsVMMetricsRecord(Object object) {
Map map = (Map) object; // this is the problem when the object null is
Map<VMMetrics, VMMetrics.Record> result = new HashMap<VMMetrics,
VMMetrics.Record>();
Set<Map.Entry> entries = map.entrySet();
for(Map.Entry entry: entries) {
VMMetrics key = toVMMetrics(entry.getKey ());
VMMetrics.Record value = toVMMetricsRecord(entry.getValue());
result.put(key, value);
}
return result;
}
Are there any plans to fix this bugs and implement VMMetrics in the near
future?
Do you know how many time is needed for this changes and how long it takes
for implementation in xen server and xen api?
Best regards
Frank