Project

General

Profile

Actions

Bug #25870

open

Foreman can't differentiate VMware VMs if they were manually copied (not cloned)!

Added by Michael Schiessl over 5 years ago. Updated over 5 years ago.

Status:
New
Priority:
High
Assignee:
-
Category:
Compute resources - VMware
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

At home I use a single ESXi server (v6.5) without vCenter. To clone VMs there, I have to manually copy and rename the VM at file level. It will then be added to the inventory list. On first power-on, VMware asks if the VM has been moved or copied, giving the answer "copied".

Although most relevant IDs are changed, this does not apply to the vc.uuid setting, but it is exactly this setting that Foreman uses to enumerate the VMs on a computing resource.

Steps to reproduce:
(Suppose VM1 is copied to VM2)
  • Create VM1 (Installation of OS is not required)
  • Connect to the server via console or SSH
  • Copy the directory of the VM
    cp -a /vmfs/volumes/<name>/VM1 /vmfs/volumes/<name>/VM2
  • Step into directory of new VM
    cd /vmfs/volumes/<name>/VM2
  • Rename the virtual drive(s)
    vmkfstools -E VM1.vmdk VM2.vmdk
  • Rename the remaining files (each separate)
    mv VM1<*.*> VM2<*.*>
  • Open the vmx file
    vi VM2.vmx
  • Replace the names there
    :%s/VM1/VM2/g
  • Save and close the file
    :wq
  • Register the new VM
  • Power-on the newly registered VM
  • Answer question with "Copied"
  • Register the new VM in Forman.

Although this is a VMware bug, Foreman should at least detect and respond to it. Instead, one of the two VMs can be added to the host list, the other not. In best case this results to undefined state for both VMs. (On which VM are commands executed?)

Actions

Also available in: Atom PDF