Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

Enable Outgoing SSH connections

This is for example necessary, to use SCP between two ESXi Servers.

  1. Check the firewall configuration as follows:
    Start the VMWare Client.
    Select the ESXi Host.
    Select the Configuration Tab, then Security Profile.
    In Services select "Firewall" and enable the SSH Client.

Cloning a VM from the Command Line

On ESXi Free, there is no possibility to clone a virtual machine from the GUI.

This details how to clone a virtual machine from the command line.

  1. Enable SSH on the ESXi host using the GUI.
    Start the VMWare Client.
    Select the ESXi Host.
    Select the Configuration Tab, then Security Profile.
    In Services select "Properties".
  2. Login to the ESXi host using SSH.

  3. cd into the datastore 

    For example:

    Translations Ignore


    Code Block
    cd /vmfs/volumes/datastore
     



  4. Create a new directory for the clone:

    Translations Ignore


    Code Block
    mkdir vm-name-clone
     



  5. cd into the clone directory

    Translations Ignore


    Code Block
    cd vm-name-clone
     



  6. DO THESE STEPS FOR EACH DISK THE VM CONTAINS

    1. Locate the vmdk file for the current version of the disk to clone in the original VM directory. 
      For example, for the first snapshot of the disk, the disk name will be disk-name-000001.vmdk 

    2. Clone the disk using the following command

      Translations Ignore


      Code Block
      vmkfstools -i /vmfs/volumes/datastore/vm-name/disk-name-000001.vmdk ./disk-name.vmdk -d thin


      This will create a clone of the disk, thin provisioned.

    3. Copy the other VM files into the directory.

    4. Edit the VM file if necessary, and change the name of the mounted disk to the newly cloned disk. 
      For example change this line:
      scsi0:0.fileName = "disk-name-000001.vmdk"

      To this:
      scsi0:0.fileName = "disk-name.vmdk"
       


  7. That's it. The new VM is ready to use or to be copied somewhere else.

...