我通过 vmware 软件包在 ESX(在 vSphere Client 上)上创建了虚拟机:看这里 http://www.doublecloud.org/2010/04/how-to-import-and-export-ovf-packages/。
但我无法从代码中设置IP地址。
I tried:
ServiceInstance si = new ServiceInstance(new URL(Url), user, password, true);
VirtualMachine vm = (VirtualMachine) new InventoryNavigator(si.getRootFolder()).searchManagedEntity("VirtualMachine", "NewVmName");
System.out.println( vm.getGuest().toolsRunningStatus);
vm.getGuest().setIpAddress(ipAddress);
但它没有改变。有谁知道可以做什么来更新IP地址?
虚拟机的 IP 地址由虚拟机本身控制。如果您确实想要设置虚拟机的 IP 地址,请将网络适配器更改为“桥接”并在虚拟机本身中设置 IP 地址。参考:在 Windows 上设置 IP 地址 https://superuser.com/a/186445/767073, Linux https://superuser.com/a/1216519/767073, and Mac http://osxdaily.com/2010/09/01/set-ip-address-from-the-mac-command-line/.
来源:超级用户、OSXDaily
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)