Enable Outgoing SSH connections
This is for example necessary, to use SCP between two ESXi Servers.
- 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.
Image Removed
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. - 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".
Image Modified - Login to the ESXi host using SSH.
cd into the datastore For example:
Translations Ignore |
---|
Code Block |
---|
cd /vmfs/volumes/datastore |
|
|
Create a new directory for the clone:
Translations Ignore |
---|
Code Block |
---|
mkdir vm-name-clone |
|
|
cd into the clone directory Translations Ignore |
---|
Code Block |
---|
cd vm-name-clone |
|
|
- DO THESE STEPS FOR EACH DISK THE VM CONTAINS
- 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
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. - Copy the other VM files into the directory.
Edit the VM file if necessary, and change the name of the mounted disk to the newly cloned disk. For example change this line: Translations Ignore |
---|
Code Block |
---|
scsi0:0.fileName = "disk-name-000001.vmdk" |
|
To this: Translations Ignore |
---|
Code Block |
---|
scsi0:0.fileName = "disk-name.vmdk" |
|
|
...
That's it. The new VM is ready to use or to be copied somewhere else.
|
Sv translation |
---|
|
Status |
---|
colour | Red |
---|
title | This page is only available in English |
---|
|
|
Sv translation |
---|
|
Sur ESXi Free, il n'est pas possible de cloner une machine virtuelle à partir de l'interface graphique. Ce document explique en détail comment cloner une machine virtuelle à partir de la ligne de commande. - Activez SSH sur l'hôte ESXi en utilisant l'interface graphique.
Démarrez le client VMWare. Sélectionnez l'hôte ESXi. Sélectionnez l'onglet Configuration, puis Profil de sécurité Dans Services, sélectionnez "Properties".
Image Added - Connectez-vous à l'hôte ESXi en utilisant SSH.
cd dans datastore Par exemple:
Translations Ignore |
---|
Code Block |
---|
cd /vmfs/volumes/datastore |
|
Créer un nouveau répertoire pour le clone :
Translations Ignore |
---|
Code Block |
---|
mkdir vm-name-clone |
|
cd dans le répertoire des clones Translations Ignore |
---|
Code Block |
---|
cd vm-name-clone |
|
- EFFECTUEZ CES ÉTAPES POUR CHAQUE DISQUE QUE LE VM CONTIENT
- Localisez le fichier vmdk de la version actuelle du disque à cloner dans le répertoire VM d'origine.
Par exemple, pour le premier instantané du disque, le nom du disque sera disk-name-000001.vmdk
Clonez le disque en utilisant la commande suivante
Translations Ignore |
---|
Code Block |
---|
vmkfstools -i /vmfs/volumes/datastore/vm-name/disk-name-000001.vmdk ./disk-name.vmdk -d thin |
|
Cela permettra de créer un clone du disque, finement provisionné. - Copiez les autres fichiers VM dans le répertoire.
Modifiez le fichier VM si nécessaire, et changez le nom du disque monté en celui du disque nouvellement cloné. Par exemple, changer cette ligne: Translations Ignore |
---|
Code Block |
---|
scsi0:0.fileName = "disk-name-000001.vmdk" |
|
À ceci : Translations Ignore |
---|
Code Block |
---|
scsi0:0.fileName = "disk-name.vmdk" |
|
C'est tout. La nouvelle VM est prête à être utilisée ou copiée ailleurs.
|