2013-03-10 57 views
1

我使用的是XenServer,我正在连接池,获取所有虚拟机的列表。 现在我需要登录到VM。 并在所有VM上执行一个exe文件。 任何人有任何想法?java,xenserver,有没有人知道如何在虚拟机上运行命令?

谢谢!

connection = new Connection(url); 
Session.loginWithPassword(connection, userName, Password, APIVersion.latest().toString()); 


Map<VM, VM.Record> vms = VM.getAllRecords(connection); 
for (VM.Record record : vms.values()){ 
    if (!record.isATemplate){ 
     // now i need somehow to connect with the VM username and password 
     // now i need to run an exe file. 
    } 
} 

回答

0

据我所知,XenServer API没有提供任何可以在VM中执行命令的api。恕我直言,像XenServer或VMware这样的VMM不应该有权在其托管的任何虚拟机中执行命令。那么,为什么不能获得所有虚拟机的ip并使用一些ssh库来执行命令呢?

相关问题