Cloning a VM on ESX Server 3.0.1

本文详细介绍如何通过SSH登录ESX Server,克隆虚拟机(VM),并为新的克隆VM配置网络设置的过程。包括确定VMFS文件系统位置、复制VM镜像、重命名文件、编辑配置文件以及注册新VM等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. Perform a clean OS shutdown of the guest OS running in the VM. Ideally, this will result in the VM being powered off.
  2. Login to the ESX Server using SSH as the root user.
  3. Use “vdf –h” to determine where the VMFS filesystems are mounted. In our example, this is /vmfs/volumes/AttachedSCSI
  4. Locate the current VM image (at /vmfs/volumes/AttachedSCSI/shelob).
  5. Run “cp –r /vmfs/volumes/AttachedSCSI/shelob /vmfs/volumes/AttachedSCSI/shelob-clone &
  6. Go do something else for a while to let the copy finish (at least 30 mins)
  7. Once the copy is finished, go to the new directory (shelob-clone) and rename all the files to use the new clone name. For example, the string “shelob” will be in the filename for each file. You should rename the file so that “shelob-clone” is in the filename instead of “shelob”.
  8. Once you’ve renamed all the files, run “file *” in this directory (shelob-clone).
  9. Edit all files (back them up first) that are listed as “ASCII text” or “ASCII English text”. In each of those files, you may find references to the old filenames or directory names. Modify the references appropriately to use the new names.
  10. Also edit the shelob-clone.vmx file to remove the following lines:
    ethernet0.generatedAddress = "....."
    ethernet0.generatedAddressOffset = "....."
    uuid.location = "....."
    uuid.bios = "....."
  11. Add the following line to shelob-clone.vmx:
    uuid.action = "keep"
  12. Register the new cloned VM with ESX server by running the following command (this should all be on one line):
    vmware-cmd -s register /vmfs/volumes/AttachedSCSI/shelob-clone/shelob-clone.vmx
  13. Go to the Virtual Infrastructure client and start the new VM. If the guest OS is linux, you should expect kudzu to detect that the old Ethernet controller was removed and a new one has been added. The benefit of this detection is that it will prompt you to add network configuration information. When you’re prompted, you can choose the appropriate IP configuration/address for this new guest VM. Note that you should make sure that your original VM and the new VM have different IP addresses if you intend to have them running at the same time.
阅读(672) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值