Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

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

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

© 2024 Red Hat, Inc.