⁠Importing and Exporting Virtual Machines

来源:互联网 发布:如何用淘宝联盟赚钱 编辑:程序博客网 时间:2024/06/15 19:26

Exporting and Importing Virtual Machines and Templates

Virtual machines and templates can be exported from and imported to data centers in the same oVirt environment, or a different oVirt environment. oVirt allows you to import and export virtual machines (and templates) stored in Open Virtual Machine Format (OVF).

There are three stages to exporting and importing virtual machines and templates:

  1. Export the virtual machine or template to an export domain.
  2. Detach the export domain from one data center, and attach it to another. You can attach it to a different data center in the same oVirt environment, or attach it to a data center in a separate oVirt environment that is managed by another installation of oVirt.
  3. Import the virtual machine or template into the data center to which the export domain is attached.

A virtual machine must be stopped before it can be moved across data centers. If the virtual machine was created using a template, the template must exist in the destination data center for the virtual machine to work, or the virtual machine must be exported with the Collapse Snapshots option selected.

Note: When you export or import a virtual machine or template, the properties of that virtual machine or template are preserved, including basic details such as the name and description, resource allocation, and high availability settings.

Overview of the Export and Import Process

The export domain allows you to move virtual machines and templates between oVirt environments.

To export or import virtual machines and templates, an active export domain must be attached to the data center containing the virtual machine or template to be exported or imported. An export domain acts as a temporary storage area containing two directories for each exported virtual machine or template. One directory contains the OVF (Open Virtualization Format) files for the virtual machine or template. The other directory holds the disk image or images for the virtual machine or template.

You can also import virtual machines from other virtualization providers such as Xen, VMware or Windows virtual machines using the V2V feature. V2V converts virtual machines and places them in the export domain.

For more information on V2V, see the Red Hat Enterprise Linux V2V Guide.

Note: An export domain can only be active in one data center at a given time. This means that the export domain must be attached to either the source data center or the destination data center.

Exporting virtual machines and templates from one data center to another requires some preparation. Ensure that:

  • An export domain exists, and is attached to the source data center.
  • The virtual machine is shut down.
  • If the virtual machine was created based on a template, that template must reside on the destination data center or be exported with the virtual machine.

When the virtual machine or template has been exported to the export domain, you can import that virtual machine or template into the destination data center. If the destination data center is in the same oVirt environment as the source data center, delete the original virtual machine or template from the source data center after the export has completed.

Graphical Overview for Exporting and Importing Virtual Machines and Templates

Summary

This procedure provides a graphical overview of the steps required to export a virtual machine or template from one data center and import that virtual machine or template into another data center.

Procedure 8.40. Exporting and Importing Virtual Machines and Templates

  1. Attach the export domain to the source data center.

    Attach Export Domain

    Figure 8.13. Attach Export Domain

  2. Export the virtual machine or template to the export domain.

    Export the Virtual Resource

    Figure 8.14. Export the Virtual Resource

  3. Detach the export domain from the source data center.

    Detach Export Domain

    Figure 8.15. Detach Export Domain

  4. Attach the export domain to the destination data center.

    Attach the Export Domain

    Figure 8.16. Attach the Export Domain

  5. Import the virtual machine or template into the destination data center.

    Import the virtual resource

    Figure 8.17. Import the virtual resource

Result

The virtual machine or template is imported to the destination data center.

Exporting a Virtual Machine to the Export Domain

Summary

Export a virtual machine to the export domain so that it can be imported into a different data center. Before you begin, the export domain must be attached to the data center that contains the virtual machine to be exported.

Procedure 8.41. Exporting a Virtual Machine to the Export Domain

  1. Click the Virtual Machines tab and select a virtual machine.
  2. Click Export to open the Export Virtual Machine window.
  3. Select the Force Override check box to override existing images of the virtual machine on the export domain. Select the Collapse Snapshots check box to create a single export volume per disk. Selecting this option will remove snapshot restore points and include the template in a template-based virtual machine. This removes any dependencies a virtual machine has on a template.
  4. Click OK to export the virtual machine and close the window.

Result

The export of the virtual machine begins. The virtual machine displays in the Virtual Machines list with an Image Locked status as it is exported. Depending on the size of your virtual machine hard disk images, and your storage hardware, this can take up to an hour. Use the Events tab to view the progress.

When complete, the virtual machine has been exported to the export domain and displays on the VM Import tab of the export domain's details pane.

Importing a Virtual Machine into the Destination Data Center

Summary

You have a virtual machine on an export domain. Before the virtual machine can be imported to a new data center, the export domain must be attached to the destination data center.

Procedure 8.42. Importing a Virtual Machine into the Destination Data Center

  1. Use the Storage resource tab, tree mode, or the search function to find and select the export domain in the results list. The export domain must have a status of Active
  2. Select the VM Import tab in the details pane to list the available virtual machines to import.
  3. Select one or more virtual machines to import and click Import to open the Import Virtual Machine(s) window.
  4. Use the drop-down menus to select the Default Storage Domain and Cluster.
  5. Select the Collapse Snapshots check box to remove snapshot restore points and include templates in template-based virtual machines.
  6. Click the virtual machine to be imported and click on the Disks sub-tab. From this tab, you can use the Allocation Policy and Storage Domain drop-down lists to select whether the disk used by the virtual machine will be thinly provisioned or preallocated, and can also select the storage domain on which the disk will be stored. An icon is also displayed to indicate which of the disks to be imported acts as the boot disk for that virtual machine.
  7. Click OK to import the virtual machines The Import Conflict window opens if the virtual machine exists in the virtualized environment.
  8. Choose one of the following radio buttons:
    • Don't import
    • Clone and enter a unique name for the virtual machine in the New Name field.
    Or select the Apply to all check box to import all duplicated virtual machines with the same suffix.
  9. Click OK to import the virtual machines and close the window.
Important: During a single import operation, you can only import virtual machines that share the same architecture. If any of the virtual machines to be imported have a different architecture to that of the other virtual machines to be imported, a warning will display and you will be prompted to change your selection so that only virtual machines with the same architecture will be imported.

Result

You have imported the virtual machine to the destination data center. This may take some time to complete.

0 0
原创粉丝点击