Este contenido no está disponible en el idioma seleccionado.

4.3.4. Scripting the v2v process


The entire v2v process can be scripted, enabling the automated batch processing of a large number of virtual machines. The process is broken up into two steps, which must be run on separate hosts.

Procedure 4.8. Scripting the v2v process

  1. Use virt-v2v to convert the virtual machines and copy them to the export storage domain. This step must be run on a Linux host. The process is detailed in Section 4.3.2, “Converting a virtual machine”.
  2. Once the conversion is complete, use the Red Hat Enterprise Virtualization Administration Portal to import the virtual machines from the export storage domain. This step must be run on the Red Hat Enterprise Virtualization Manager server.
    For more information on importing a virtual machine with the Red Hat Enterprise Virtualization Administration Portal, see the Red Hat Enterprise Virtualization Administration Guide.
    The Import Virtual Machine(s) wizard.

    Figure 4.4. Importing a virtual machine with the Red Hat Enterprise Virtualization Administration Portal

    Alternatively, the Python SDK or the command line can also be used to import the virtual machines from the export storage domain:
    To import the virtual machines using the SDK, use the following:

    Example 4.3. Importing virtual machines from the export storage domain using the SDK

    api = API(url="http(s)://...:.../api",
              username="...",
              password="...",
              filter=False,
              debug=True)
    
    
    sd = api.storagedomains.get(id="from-sd-id")
    import_candidate = sd.vms.get(id="vm-to-import")
    import_candidate.import_vm(action=params.Action(
    cluster=api.clusters.get(id="to-cluster-id"),
    storage_domain=api.storagedomains.get(id="to-sd-id")))

    Note

    When using the SDK method, entities can also be fetched and passed using name=.
    To import the virtual machines using the command line, connect to the Red Hat Enterprise Virtualization Manager shell and use the following command:

    Example 4.4. Importing virtual machines from the export storage domain using the command line

    action vm "vm-to-import" import_vm --storagedomain-identifier "from-sd-id" --cluster-id "to-cluster-id" --storage_domain-id "to-sd-id"

    Note

    When using the command line method, entities can also be fetched and passed using -name.
Red Hat logoGithubRedditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

© 2024 Red Hat, Inc.