Common Tasks :Importing a Legacy Virtual Machine

来源:互联网 发布:手机淘宝取消退款流程 编辑:程序博客网 时间:2024/06/04 19:31

Importing a Legacy Virtual Machine

The VIX API allows you to run some legacy virtual machines, with some loss of functionality that depends on the virtual hardware version. A legacy virtual machine is one created by an earlier version of VMware software.

The properties of a virtual machine include a virtual hardware version that determine the capabilities of the virtual machine. VMware products generally support the current virtual hardware version and the previous virtual hardware version. Virtual machines older than the previous virtual hardware version are best upgraded, as they are not supported and they might fail to run.

Virtual machines created with ESX Server may also be used with the VIX API if they are first exported to the file formats used by Workstation and GSX Server. Consult your ESX Server documentation for more information on exporting virtual machines.

Upgrading Virtual Hardware

When using legacy virtual machines, you can upgrade the virtual hardware by calling the VixVM_UpgradeVirtualHardware()function. This function upgrades the virtual hardware to the same level as virtual machines created with the current release.

To upgrade the virtual hardware version of your virtual machine

  1. Connect to the host on which the virtual machine is located. See Connecting to a Host.
  2. Get a handle to the virtual machine. See Getting a Handle to a Virtual Machine.
  3. Power off the virtual machine. See Powering Off a Virtual Machine.
  4. Use the virtual machine handle in a call to VixVM_UpgradeVirtualHardware().
    Example 3-14.
    C code below. Click here for Perl. Click here for COM.
VixError err = VIX_OK;VixHandle jobHandle = VIX_INVALID_HANDLE; // Upgrade the virtual hardware.jobHandle = VixVM_UpgradeVirtualHardware(vmHandle,                                         0, // options                                         NULL, // callbackProc                                         NULL); // clientDataerr = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);if (VIX_OK != err) {   // Handle the error...   goto abort;} Vix_ReleaseHandle(jobHandle);jobHandle = VIX_INVALID_HANDLE;

Once you have upgraded the virtual hardware of a legacy virtual machine, you can no longer use that virtual machine with older VMware products – those that use a previous virtual hardware version. If you have any doubts about upgrading, make a copy of the legacy virtual machine before you upgrade the virtual hardware.