Answer the question
In order to leave comments, you need to log in
How can an XCP virtual machine get information about itself by querying XAPI?
Hello!
If someone has experience with PHP-xenapi , please help me figure it out. I have a server with Xen Cloud Platform 1.6. The XCP system has a virtual machine that makes requests to XAPI.
How can this machine get its name-label and other information about itself by accessing XAPI?
Here is the list of APIs
. The main condition is that the machine does not know its uuid or its name.
Answer the question
In order to leave comments, you need to log in
You will have to write your own answer. The solution is not the best, but it works.
$xapi = new XenApi($uri, $login, $password);
$vifs = $xapi->VIF_get_all();
foreach($vifs as $value){
$vif = $xapi->VIF_get_record($value);
if($vif['MAC'] === $mac){
$selfVM = $vif['VM'];
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question