2017年8月22日 星期二

How to clone vmware image inside vmware Esxi server through ssh terminal.

最近拿到兩台舊版的VMWARE Esxi server 可以用來玩系統,發現要deploy ova tempalte實在有夠麻煩,查了一下似乎

可以直接再vwmare 裡面直接clone image 這樣速度最快,下列是從vmware 官網直接複製天上的說明步驟

 

Cloning a virtual machine disk without delta files or snapshots

To clone a virtual machine disk using the ESXi/ESX host terminal:

  1. Log in to the terminal of the ESXi/ESX host. (需要先開啟ssh 的服務  Configuration-> Security Profile : Enable SSH)

  2. Navigate to the virtual machine's directory using the cd command. It is located at:

    /vmfs/volumes/source_datastore/virtual_machine/    (我的預設是/vmfs/volumes/datastore1)
  3. Confirm the destination directory where the clone will be copied to. Create this directory, if required.

    For example, if this destination directory does not exist:

    /vmfs/volumes/destination_datastore/virtual_machine/

    Create the directory using this command:

    mkdir /vmfs/volumes/destination_datastore/virtual_machine/

  4. Clone the virtual hard disk using the vmkfstools -i command after shutting down the virtual machine:

    # vmkfstools -i /vmfs/volumes/Storage1/examplevm/examplevm.vmdk /vmfs/volumes/Storage2/examplevm_clone.vmdk

    You see output similar to:

    Destination disk format: VMFS thick
    Cloning disk '/vmfs/volumes/Storage1 (3)/examplevm/examplevm.vmdk'...
    Clone: 100% done.


    Notes

    • Encapsulate objects with quotes where appropriate to ensure spaces and other special characters are interpreted correctly. 
    • By default, the vmkfstools -i command will create a destination thick provisioned disk. If you want the destination disk to be thin provisioned, add -d thinto the end of the preceding command.

      For example:

      # vmkfstools -i /vmfs/volumes/Storage1/examplevm/examplevm.vmdk /vmfs/volumes/Storage2/examplevm_clone.vmdk -d thin

Cloning a virtual machine disk with delta files or snapshots

To clone a virtual machine disk using the ESXi/ESX host terminal:

  1. Log in to the ESXi/ESX host's terminal. 

  2. Navigate to the virtual machine's directory using the cd command. It is located at:

    /vmfs/volumes/source_datastore/virtual_machine/

  3. Confirm the destination directory where the clone will be copied to. Create this directory, if required.

    For example, if this destination directory does not exist:

    /vmfs/volumes/destination_datastore/virtual_machine/

    Create the directory using this command:

    mkdir /vmfs/volumes/destination_datastore/virtual_machine/

  4. Clone the virtual hard disk from its current snapshot delta point using the vmkfstools -i command.

    # vmkfstools -i /vmfs/volumes/Storage1/examplevm/examplevm-000003.vmdk /vmfs/volumes/Storage2/examplevm_clone.vmdk

    You see output similar to:

    Destination disk format: VMFS thick
    Cloning disk '/vmfs/volumes/Storage1 (3)/examplevm/examplevm-000003.vmdk'...
    Clone: 100% done.

沒有留言:

Obsidian 插件介紹:Text Generator

Text Generator 是 Obsidian 的一個插件,它可以根據給定的提示自動生成文本。這個插件使用 GPT-3 語言模型,能夠產生類似人類的文本,非常適合編寫故事、文章、電子郵件和其他類型文本。 主要功能: **生成文本:**根據提示生成各種長度的...