Documente Academic
Documente Profesional
Documente Cultură
New in vSphere 5
VIXhasalwaysbeenparticularlystrongintheAPIsitprovidesforguestoperations.ThevSphereAPIdidnot offeranyequivalentfunctionalityuntilthe5.0release,whichaddsthefollowingguestoperations:
Thefollowingfivesections(untilWebServicesReplacetheVIXClientonpage 4)describetheVIXclient.
GuestoperationscanbedisabledperuserbyremovingtheusersAcquireguestcontrolticketprivilege.
1 2 3 4
1 2
3 4
VMware, Inc.
VMXrelaystheguestoperationcommandtoVMwareToolsintheguest. VMwareToolshastheGuestOSexecutetheguestoperation.
3
1 2
3 4
VMXrelaysthecommandtoVMwareToolsintheguest. VMwareToolshastheGuestOSexecutetheguestoperation.
WSDL files
client application client proxy interface (Java, C#, or other) vSphere Server SOAP-encoded WSDL network connection method execution
method invocation
VMware, Inc.
1 2 3 4 5
VMware, Inc.
VMware, Inc.
InthevSphereAPI,theVirtualMachineandGuestInfomanagedobjectscontaininformationaboutwhatguest operationsmightberunningandrelevantvirtualmachinestate:
vim.VirtualMachine.guest() vim.vm.GuestInfo.guestOperationsReady vim.vm.GuestInfo.interactiveGuestOperationsReady
VMware, Inc.
VirtualMachine.Interact.GuestControlsameasAcquireguestcontrolticketintheUI.
Licensing
ApaidESXiorvSpherelicense(notfreevSphereHypervisor)isrequiredtousetheVIXAPIorvSphereAPI. NoadditionallicenseisrequiredtousetheseAPIs.
CreateTemporaryFile.java
Thissamplecreatesatemporaryfileinsideavirtualmachine,bycallingthefollowingmethod:
vimPort.createTemporaryFileInGuest(fileManagerRef, vmMOR, auth, prefix, suffix, directoryPath);
DownloadGuestFile.java
Thissampledownloadsafilefromtheguesttoaspecifiedpathonthehostwheretheclientisrunning.
vimPort.initiateFileTransferFromGuest(fileManagerRef, vmMOR, auth, guestFilePath);
Thedestination,alocalfileontheclienthost,isspecifiedonthecommandlineas--localfilepath.
RunProgram.java
Thissamplerunsaspecifiedprograminsideaguestoperatingsystem,withoutputredirectedtoatemporary file,anddownloadstheresultingoutputtoafileonthelocalclient.
vimPort.startProgramInGuest(processManagerRef, vmMOR, auth, spec);
Theprogrammustalreadyexistontheguest,andisspecifiedonthecommandlineas--guestprogrampath. Theoutputfiletostoreontheclienthostisspecifiedonthecommandlineas--localoutputfilepath.
VMware, Inc.
UploadGuestFile.java
Thissampleuploadsafilefromtheclientmachinetoaspecifiedlocationinsidetheguest.
vimPort.initiateFileTransferToGuest(fileManagerRef, vmMOR, auth, guestFilePath, guestFileAttributes, fileSize, optionsmap.containsKey("overwrite"));
Thesource,alocalfileontheclienthost,isspecifiedonthecommandlineas--localfilepath.
If you have comments about this documentation, submit your feedback to: docfeedback@vmware.com VMware, Inc. 3401 Hillview Ave., Palo Alto, CA 94304 www.vmware.com Copyright 2011 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents. VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies. Item: EN-000703-00 9/7/11