将虚拟机从一个 vCenter 移动到另一个 vCenter

发布于 2024-11-26 09:20:34 字数 1559 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

盛夏尉蓝 2024-12-03 09:20:34

我已经找到了问题的解决方案:

  • 步骤 1:在 vSphere 客户端中,连接到 vCenter1 时,选择虚拟机,然后从“文件”菜单中选择“导出< /strong>"->"导出 OVF 模板"(注意:确保虚拟机已关闭,否则此功能不可用 - 它将呈灰色)。此操作将允许您将虚拟机保存在您的计算机/笔记本电脑上(作为 .vmdk、.ovf 和 .mf 文件)。
  • 步骤 2:使用 vSphere 客户端连接到 vCenter2,从“文件”菜单中选择“部署 OVF 模板...”,然后选择保存虚拟机的位置在上一步中。

仅此而已!
谢谢!

I've figure it out the solution to my problem:

  • Step 1: from within the vSphere client, while connected to vCenter1, select the VM and then from "File" menu select "Export"->"Export OVF Template" (Note: make sure the VM is Powered Off otherwise this feature is not available - it will be gray). This action will allow you to save on your machine/laptop the VM (as an .vmdk, .ovf and a .mf file).
  • Step 2: Connect to the vCenter2 with your vSphere client and from "File" menu select "Deploy OVF Template..." and then select the location where the VM was saved in the previous step.

That was all!
Thanks!

煮茶煮酒煮时光 2024-12-03 09:20:34

是的,你可以这样做。

  1. 从克隆虚拟机的目录中复制所有文件,并将其放置在目标数据存储上。
  2. 在连接到目标 vCenter 的 VI 客户端中,转至清单 -> 数据存储视图。
  3. 打开放置虚拟机文件的数据存储的数据存储浏览器。
  4. 找到您复制的 .vmx 文件并右键单击它。
  5. 选择“注册虚拟机”,然后按照随后出现的提示进行操作。 (根据您的 vCenter 版本,这可能是“添加到清单”或其他一些变体)

虚拟机注册过程应该完成,克隆的虚拟机可在新的 vCenter 中使用!

祝你好运!

Yes, you can do this.

  1. Copy all of the cloned VM's files from its directory, and place it on its destination datastore.
  2. In the VI client connected to the destination vCenter, go to the Inventory->Datastores view.
  3. Open the datastore browser for the datastore where you placed the VM's files.
  4. Find the .vmx file that you copied over and right-click it.
  5. Choose 'Register Virtual Machine', and follow whatever prompts ensue. (Depending on your version of vCenter, this may be 'Add to Inventory' or some other variant)

The VM registration process should finish with the cloned VM usable in the new vCenter!

Good luck!

一个人的夜不怕黑 2024-12-03 09:20:34

要移动虚拟机,您无需克隆虚拟机,只需将虚拟机文件(关闭虚拟机电源后)复制到外部硬盘并在目标主机上注册相同的文件即可。

For moving a virtual machine you need not clone the VM, just copy the VM files (after powering the VM off) to external HDD and register the same on destination host.

偏爱你一生 2024-12-03 09:20:34

一种更简单的方法是使用 vCenter Converter Standalone Client 并执行 P2V,但在本例中是 V2V。它比将整个虚拟机文件复制到某个存储上并将其复制到新的 vCenter 上要快得多。将其复制或导出到 OVF 模板然后导入需要很长时间。您可以一步将 vCenter Converter Standalone 客户端设置为 V2V 并同步,然后让它在新 Vcenter 上启动虚拟机并在旧 vCenter 上关闭。简单的。

对于我来说,使用这种方法,我能够在大约 30 分钟内将虚拟机从一个 vCenter 移动到另一个 vCenter,而复制或导出则需要 2 个小时以上。您的结果可能会有所不同。


下面这个过程来自另一位响应者,如果您可以将该数据存储提供给 vCenter 上的 ESXi 服务器,然后按照步骤 2 进行操作,效果会更好。无需复制所有虚拟机,然后按照其余过程进行操作。

  1. 从克隆虚拟机的目录中复制所有文件,并将其放置在目标数据存储上。
  2. 在连接到目标 vCenter 的 VI 客户端中,转至清单 -> 数据存储视图。
  3. 打开放置虚拟机文件的数据存储的数据存储浏览器。
  4. 找到您复制的 .vmx 文件并右键单击它。
  5. 选择“注册虚拟机”,然后按照随后出现的提示进行操作。 (根据您的 vCenter 版本,这可能是“添加到清单”或其他一些变体)

A much simpler way to do this is to use vCenter Converter Standalone Client and do a P2V but in this case a V2V. It is much faster than copying the entire VM files onto some storage somewhere and copy it onto your new vCenter. It takes a long time to copy or exporting it to an OVF template and then import it. You can set your vCenter Converter Standalone Client to V2V in one step and synchronize and then have it power up the VM on the new Vcenter and shut off on the old vCenter. Simple.

For me using this method I was able to move a VM from one vCenter to another vCenter in about 30 minutes as compared to copying or exporting which took over 2hrs. Your results may vary.


This process below, from another responder, would work even better if you can present that datastore to ESXi servers on the vCenter and then follow step 2. Eliminating having to copy all the VMs then follow rest of the process.

  1. Copy all of the cloned VM's files from its directory, and place it on its destination datastore.
  2. In the VI client connected to the destination vCenter, go to the Inventory->Datastores view.
  3. Open the datastore browser for the datastore where you placed the VM's files.
  4. Find the .vmx file that you copied over and right-click it.
  5. Choose 'Register Virtual Machine', and follow whatever prompts ensue. (Depending on your version of vCenter, this may be 'Add to Inventory' or some other variant)
送你一个梦 2024-12-03 09:20:34

将虚拟机文件复制到外部硬盘上,然后将其带入目标位置将花费更长的时间,并且需要多个步骤。使用 vCenter Converter Standalone Client 将为您完成所有操作,而且速度更快。无需外部硬盘。不确定你从哪里得到克隆部分。 vCenter Converter Standalone Client 只是通过从源导入和导出到目标来复制虚拟机文件,关闭源虚拟机,然后在目标处注册虚拟机并打开电源。一步到位。设置 vCenter Converter Standalone Client 大约需要 1 分钟。

Copying the VM files onto an external HDD and then bringing it in to the destination will take a lot longer and requires multiple steps. Using vCenter Converter Standalone Client will do everything for you and is much faster. No external HDD required. Not sure where you got the cloning part from. vCenter Converter Standalone Client is simply copying the VM files by importing and exporting from source to destination, shutdown the source VM, then register the VM at destination and power on. All in one step. Takes about 1 min to set that up vCenter Converter Standalone Client.

人间☆小暴躁 2024-12-03 09:20:34

您根本不必导出虚拟机。您可以将虚拟机移动并克隆到 vCenter 1 中的 TAXI 主机。然后将该主机添加到 vCenter 2,并将任何虚拟机通过 vMotion 移动到之前由 vCenter 2 管理的其他主机。完成后,您可以将 TAXI 主机添加回 vCenter 1 。

You don't have to export your VMs at all. You can move the VM and clone to a TAXI host in vCenter 1. Then add the host to vCenter 2, and vMotion away whatever VMs to other hosts previously managed by vCenter 2. When done, you can add the TAXI host back to vCenter 1.

南风几经秋 2024-12-03 09:20:34

如果您想使用命令行执行此操作,则可以如果您有 ESXi 6.0(或甚至可能是 ESXi 5.5),通过使用 govc 运行,这是一个非常有用的实用程序,可用于与 vCenter 及其关联资源进行交互。

根据您的设置,您可以

# setup your credentials
export GOVC_USERNAME=YOUR_USERNAME GOVC_PASSWORD=YOUR_PASSWORD
govc export.ovf -u your-vcsa-url.example.com -vm VM_NAME -dc VMS_DATACENTER export-folder

然后将 VM VM_NAME 导出到文件夹 export-folder 中。从那里,您可以将

govc import.ovf -u your-other-vcsa-url.example.com -vm NEW_VM_NAME -dc NEW_DATACENTER export-folder/VM_NAME.ovf

其导入到您的其他 vCenter 中。如果您有多个可用数据存储,您可能还必须指定 -ds NEW_DATASTORE,但如果需要,govc 会告诉您这一点。

上述命令要求安装govc,您应该这样做,因为无论哪种方式它都比 ovftool 好得多。

If you'd like to do this using the command line, you can do this if you have ESXi 6.0 (or possibly even ESXi 5.5) running, by using govc, which is a very helpful utility for interacting with both your vCenter and its associated resources.

Depending on your setup, you can

# setup your credentials
export GOVC_USERNAME=YOUR_USERNAME GOVC_PASSWORD=YOUR_PASSWORD
govc export.ovf -u your-vcsa-url.example.com -vm VM_NAME -dc VMS_DATACENTER export-folder

Then, you'll have your VM VM_NAME exported in the folder export-folder. From there, you can then

govc import.ovf -u your-other-vcsa-url.example.com -vm NEW_VM_NAME -dc NEW_DATACENTER export-folder/VM_NAME.ovf

That'll import it into your other vCenter. You might have to specify -ds NEW_DATASTORE too, if you have more than one datastore available, but govc will tell you so if you need to.

The commands above require that govc is installed, which you should, because it's far better than ovftool either way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文