bottkars / vmxtoolkit

vmxtoolkit is the Powershell extension to VMware Workstation
Apache License 2.0
117 stars 32 forks source link

usage of VMXName #17

Closed thorstenkampe closed 6 years ago

thorstenkampe commented 6 years ago

vmxtoolkit uses in multiple places VMXName - which is the name of the config file without the ending - although that name is neither unique nor meaningful. Consider the following configuration where a virtual machine was cloned twice:

> Get-VMX | Where-Object -Property VMXName -EQ -Value 'Ubuntu 12.04 LTS'

VMXName          UUID                              State     Template Path
-------          ----                              -----     -------- ----
Ubuntu 12.04 LTS 564d99968fd17771-9563d545f8101422 suspended          C:\data\vm\Ubuntu Database
Ubuntu 12.04 LTS 564dd7fc727c1841-dee6d86061869d96 suspended          C:\data\vm\Ubuntu Oracle Database
Ubuntu 12.04 LTS 564d9273260cbbc4-64c959a2fee24012 suspended          C:\data\vm\Ubuntu Server

> Get-VMX | Where-Object -Property VMXName -EQ -Value 'Ubuntu 12.04 LTS' | Get-VMXDisplayName

Displayname     Config
-----------     ------
Ubuntu Database C:\data\vm\Ubuntu Database\Ubuntu 12.04 LTS.vmx
Oracle Database C:\data\vm\Ubuntu Oracle Database\Ubuntu 12.04 LTS.vmx
Ubuntu Server   C:\data\vm\Ubuntu Server\Ubuntu 12.04 LTS.vmx

> Start-VMX -config 'C:\data\vm\Ubuntu Server\Ubuntu 12.04 LTS.vmx'
 ==>starting Virtual Machine Ubuntu 12.04 LTS[success]

VMXname          Status  Starttime
-------          ------  ---------
Ubuntu 12.04 LTS Started 03.04.2018 05:32:48

Suggestion: vmxtoolkit should use the VMs DisplayName instead of the file name of the configuration file for input and output. The display name is still not unique but at least meaningful to the user. If there is a need to specify one particular VM the user can use the -config or -UUID parameters.

bottkars commented 6 years ago

rejected as no issue. the vmxname is derived from the state of runnig vm´s from vmrun list if you want to have detailed Information, you can Always use pipe ( eg get-vmx | get-vmxinfo ]

there is no way to search avm by it´s displayname, other to open ALL vmx files.

thorstenkampe commented 6 years ago

If VMXName is derived from vmrun list then you can derive the display name from vmrun readVariable runtimeConfig displayName...

bottkars commented 6 years ago

this is a runtime config variable. run time means, machine must run. not very helpful for powered of vm´s. if you issue is the cloning, chsnge the file(Name) during cloning. the only uniqueness, as you stated correctly, is the uuid. as there is no Registration of vm´s in Workstation. use cloning correctly, and then you do not have that issue


clone                    Path to vmx file     Create a copy of the VM
                         Path to destination vmx file
                         full|linked
                         [-snapshot=Snapshot Name]
                         [-cloneName=Name] ```