简体   繁体   English

将VM Drive映射到相应的VMDK文件

[英]Mapping VM Drive to Corresponding VMDK file

  • Problem: 问题:

    Lets say i have a VM with three storage LUNS attached to it through SCSI VMFS stores each drive as a individual VMDK files. 假设我有一个通过SCSI连接三个存储LUN的VM VMFS将每个驱动器存储为单独的VMDK文件。

    1. C:(one_c.vmdk) C:(one_c.vmdk)
    2. D:(two_d.vmdk) d:(two_d.vmdk)
    3. F:(three_f.vmdk) F:(three_f.vmdk)

In ESX host these there vmdk files are stored in /container_name/vm_name/ 在ESX主机中,这些vmdk文件存储在/ container_name / vm_name /中

Is there any way of mapping,given (disk serial number or disk id) and vmdk files location can we figure out to which vmdk file this Drive maps to?

Note: i have gone through this link VMWare VMDK mapping to Windows Drive Letters . 注意:我已经通过此链接VMWare VMDK映射到Windows Drive Letters But not that keen to do using scripts 但不是那么热衷于使用脚本

You can use ReconfigVM_Task for the virtual machine that has those disks attached. 您可以将ReconfigVM_Task用于连接了这些磁盘的虚拟机。 You need to pass virtualMachineConfigSpec which, as the name implies, specifies the virtual machine's configuration. 您需要传递virtualMachineConfigSpec,顾名思义,它指定虚拟机的配置。 Under it you will find virtualDeviceConfigSpec 在它下面你会找到virtualDeviceConfigSpec

What you want to do is: 你想要做的是:

  • Fetch the existing virtualMachineConfigSpec of your VM 获取VM的现有virtualMachineConfigSpec
  • Locate the relevant virtualDeviceConfigSpec for your disk 找到磁盘的相关virtualDeviceConfigSpec
  • Edit the backing info of that disk 编辑该磁盘的备份信息
    • Change the file name to the correct path (starting from the datastore) 将文件名更改为正确的路径(从数据存储区开始)
    • Unset the fileOperation (to avoid creating a new disk there) 取消设置fileOperation(以避免在那里创建新磁盘)
  • Execute ReconfigVM_Task on the VM with the updated spec 使用更新的规范在VM上执行ReconfigVM_Task

Please consult the doc for more specific instructions 有关更具体的说明,请参阅文档

https://www.vmware.com/support/developer/converter-sdk/conv50_apireference/vim.VirtualMachine.html#reconfigure https://www.vmware.com/support/developer/converter-sdk/conv50_apireference/vim.VirtualMachine.html#reconfigure

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM