VMware Cloud Community
klancy43
Contributor
Contributor
Jump to solution

how to identify two similar VMs?

my environment is vSphere 7.0u2,

recently I discovered a weird situation that two VMs' files (residing in a vsanDatastore) are almost the same but categorized in different directories, I did try to delete the one that seem not running but failed.

As shown in figure below.

klancy43_1-1640074087884.png

in the datacenter inventory, only one VM, which is "4IN1-2" can be seen running, the other can not be found, and I cannot power them off for troubleshooting.

can anyone provide some tips, how to identify theses two VMs? it's quite strange that they are visually the same.

 

Reply
0 Kudos
1 Solution

Accepted Solutions
fabio1975
Commander
Commander
Jump to solution

Ciao 

in the command,vim-cmd solo/registervm, for registering a VM through its VMX file you can also add the name with which you want it to be inventoried at the end of the syntax. Es:

[root@viESXi0:~] vim-cmd solo/registervm /vmfs/volumes/USB-Storage/Embedded-vCenter-Server-Appliance_1/Embedded-vCenter-Server-Appliance_1.vmx vcenterTest01

This command registers the VM in the single ESXi, if you have a vCenter I advise you to register from the vCenter GUI, during the registration phase  (after selecting the VMX file) the wizard asks you for the name of the VM.

Fabio

Visit vmvirtual.blog
If you're satisfied give me a kudos

View solution in original post

Reply
0 Kudos
5 Replies
fabio1975
Commander
Commander
Jump to solution

Ciao 

To check which is the directory of the VM inventoried in the vCenter I would use this powercli command:

Get-VM -Name <name of the VM> | select Name, @ {E = {$ _. ExtensionData.Config.Files.VmPathName}; L = "VM Path"}


What it returns to you is the vSAN storage directory where the configuration file (the VMX file) resides.

Once the directory of the current VM has been identified .. I would try to add the other VM to the vCenter (obviously with a different name than the one already inventoried).

Then I would evaluate whether to delete it or turn it on (with the network disconnected)

 

Fabio

Visit vmvirtual.blog
If you're satisfied give me a kudos

Reply
0 Kudos
depping
Leadership
Leadership
Jump to solution

Moved your post to the vSAN forum, feels more appropriate or the topic.

Reply
0 Kudos
kastlr
Expert
Expert
Jump to solution

Hi,

 

open a ssh Session to the ESXi Server which did host the running VM and perform the following command.

vim-cmd vmsvc/getallvms |grep -F 4IN1-2

 


Hope this helps a bit.
Greetings from Germany. (CEST)
Reply
0 Kudos
klancy43
Contributor
Contributor
Jump to solution

Hi guys, thanks so much for the prompt

i also found some useful docs like Performing common virtual machine-related tasks with command-line utilities (2012964) (vmware.com) and VMware PowerCLI User's Guide -

but not sure how to name the new VM (that is going to be registered) via command: vim-cmd solo/registervm <path_to_vmx_file>

 

hope this operation won't conflict with the VM that is already in the vCenter inventory...

Reply
0 Kudos
fabio1975
Commander
Commander
Jump to solution

Ciao 

in the command,vim-cmd solo/registervm, for registering a VM through its VMX file you can also add the name with which you want it to be inventoried at the end of the syntax. Es:

[root@viESXi0:~] vim-cmd solo/registervm /vmfs/volumes/USB-Storage/Embedded-vCenter-Server-Appliance_1/Embedded-vCenter-Server-Appliance_1.vmx vcenterTest01

This command registers the VM in the single ESXi, if you have a vCenter I advise you to register from the vCenter GUI, during the registration phase  (after selecting the VMX file) the wizard asks you for the name of the VM.

Fabio

Visit vmvirtual.blog
If you're satisfied give me a kudos

Reply
0 Kudos