Determine the "lineage" of a virtual machine. Hence the model was a given VM is the author?

Wonder how I could resolve the question of which model our VM was created from. In some circles, there are only a handful of models, and each of them is of a particular type of XP, 2K, 2003, etc. is no biggie. With largest deployments with more models and many of a similar (2003 Standard, Windows 2003 Ent) type, it can get more complicated. Or for otherwise this said, reports on which virtual machines were manufactured in what models;

I don't know where to start here Sorry for not posting any code or attempts.

Thank you,

As I know there is no property that shows what model a virtual machine has been deployed.

But, based on the script that I wrote for Monitoring DRS VMotion via Powershell , you can review the task and the event log and extract the information from there.

This script does just that


$days = 10
$tasknumber = 999
$eventnumber = 100
$serviceInstance = get-view ServiceInstance
$taskMgr = Get-View TaskManager
$eventMgr = Get-View eventManager
$report = @()
$filter = New-Object VMware.Vim.TaskFilterSpec
$filter.Time = New-Object VMware.Vim.TaskFilterSpecByTime
$filter.Time.beginTime = (Get-Date).AddDays(-$days)
$filter.Time.timeType = "startedTime"
$collectionImpl = Get-View ($taskMgr.CreateCollectorForTasks($filter))
$dummy = $collectionImpl.RewindCollector
$collection = $collectionImpl.ReadNextTasks($tasknumber)
while($collection -ne $null){
        $collection | Where-Object {$_.DescriptionId -eq "VirtualMachine.Clone"} | Sort-Object StartTime | % {
                $efilter = New-Object VMware.Vim.EventFilterSpec
                $efilter.eventChainId = $_.EventChainId
                $TemplateDeploy = $false
                $ecollectionImpl = Get-View ($eventMgr.CreateCollectorForEvents($efilter))
                $ecollection = $ecollectionImpl.ReadNextEvents($eventnumber)
                while($ecollection -ne $null){
                        foreach($event in $ecollection){
                                switch($event.GetType()){
                                        "VMware.Vim.TaskEvent"{
                                                $startTime = $event.CreatedTime
                                        }
                                        "VMware.Vim.VmDeployedEvent" {
                                                $status = $event.FullFormattedMessage
                                                $endTime = $event.CreatedTime
                                                $templateDeploy = $true
                                        }
                                        "VMware.Vim.VmDeployFailedEvent"{
                                            $status = $event.FullFormattedMessage
                                                $endTime = $event.CreatedTime
                                                $templateDeploy = $true
                                        }
                                        "VMware.Vim.VmBeingDeployedEvent"{
                                            $template = (Get-View $event.SrcTemplate.Vm).Name
                                                $target = $event.SrcTemplate.Name
                                                $user = $event.UserName
                                        }
                                        Default {}
                                }
                        }
                        $ecollection = $ecollectionImpl.ReadNextEvents($eventnumber)
                }
                if($TemplateDeploy){
                        $row = "" | Select StartTime, EndTime, VMname, Template, User, Status
                        $row.StartTime = $startTime
                        $row.EndTime = $endTime
                        $row.VMname = $target
                        $row.Template = $template
                        $row.user = $user
                        $row.Status = $status
                        $report += $row
                }
                $ecollectionImpl.DestroyCollector()
        }
        $collection = $collectionImpl.ReadNextTasks($tasknumber)
}
$report | Export-Csv "C:\Clone-Template-Report.csv" -noTypeInformation 

With the variable $days at the beginning of the script, you can set how many days you want to go back.

Note that it depends of course how long you keep your tasks and events in your database of VC!

Update : the script will report now also on deployments models failed.

Tags: VMware

Similar Questions

  • vCO workflow: create a virtual machine from a model and then ask the user about the CPU, memory size...

    Hi guys,.

    I am trying to create a workflow with vCO that can do the job for me:

    -Create a virtual machine (or maybe a several virtual machines) from a model (the model is in vCenter, of course)

    -L' user who is running the workflow has the thr right to say what he wants for the CPU, the memorysize, the disksize

    Any help?

    I found some workflows in the library can seem to do something similar to what I want, but since I'm a beginner I'd rather have your advice

    Hello there and welcome to vCenter Orchestrator

    Take a look at this series of tutorials to get an idea of how start:

    Create a vCO simple self-service VM Provisioning Portal - part 1

    Create a vCO simple self-service VM Provisioning Portal - part 2

    Create a Simple Self Service VM Provisioning Portal vCO - part 3

    The general approach to take would be to determine which of the clone (or clone and customize) workflows adapts to your nearest need (see your customer vCO: workflows\Library\vCenter\Virtual Machine management\Clone\)

    Then, create a NEW WORKFLOW that calls this one... after that your clone operation is complete, keep the computer turned off virtual and add feeds of extra work from the library to your new workflow that do things like change the amount of Ram, adds disks, change CPU, etc...

    Be sure to watch the videos on http://www.vmwarelearning.com/orchestrator to get a basic understanding of the use of vCO.

  • Convert a virtual machine to a model

    Dear team,

    Need to know the conversion from a virtual computer to a model substantially fater than to create a clone of the VM.what will be the reason.

    Concerning

    Mr. VMware

    Convert a virtual machine to a model basically only renames the .vmx in .vmtx configuration file. A clone of the other side copy the VM that requires certainly a lot more time to complete.

    André

  • Customization of the comments for the virtual machines deployed from model has stopped working

    Hi all

    (Environment: vCenter and ESXi 10 5.1 hosts running Build #3070626)

    We have a model 2012R2 and a file specification of customization that allows us to deploy the VMs 2012R2 server. It worked well for a while. After the Christmas break, it seems more work correctly and we havn't knowingly changed anything to cause this. We have fixed our ESXi hosts Build #3070626 October 6, but have deployed VMs of model since, without problem.

    We have all staged for the VM in advance (IE AD entry of objects and DNS). And then powered the deployed virtual computer, sysprep runs, but does not seem to apply settings in the customization file (IE rename the virtual computer, set the Admin password, join the domain etc.). If feed us the cycle of the VM, sysprep is running again, but even once, does nothing.

    I have attached the contents of my file guestcust.log of a computer deployed virtual (see below), but I do not see the clues about the problem. I thought initially the error on the first line was important, until I've found it is also present on the virtual machines that have been successfully deployed from this template in the past, so it's maybe a Kipper.

    Does anyone have advice for troubleshooting this?

    TIA

    Mark

    ==========

    guestcust.log

    ==========

    Could not query value reported in the registry (the system cannot find the file specified.)

    Sysprep from Windows Respecialize operating detected.

    Copy the files from C:\Windows\TEMP\vmw7DEB.tmp to C:\Windows\TEMP\vmw8A3E.tmp.

    Rescheduling of customization of the guest operating system.

    "Executing command C:\Windows\system32\schtasks.exe / create /sc ONSTART $ more HIGH/np/z v1 /ru SYSTEM /tr" C:\Windows\TEMP\vmw8A3E.tmp\guestcustutil.exe customize - sealparam \"/quiet/generalize/oobe /reboot\ ' NIC - 4000 - schedulenativeunobfusc ' /tn"VMware Guest OS task of customization.

    At the request of guest OS customization task invoked.

    Remove scheduled task of customization of the guest operating system.

    Execution of command C:\Windows\system32\schtasks.exe, /f/delete /tn "VMware Guest OS task of customization"

    Personalization current 2016 to 1 - Feb - 11 18:32:42

    RPCI: Send request = 'deployPkg.update.state 4 C:\Windows\TEMP\vmware-imc\guestcust.log 0'

    RPCI: Envoy = 'deployPkg.update.state 4 C:\Windows\TEMP\vmware-imc\guestcust.log 0' request, response = ", len = 0, status = 1

    Key successfully open SYSTEM\CurrentControlSet\Control\Session Manager\

    Size of 27 reg_multi_sz.

    Read the multi_sz registry autocheck autochk/q/v value *, size 27.

    value chain of registry autocheck autochk/q/v *.

    1 items back

    Obtained the session mgr BootExecute.

    Native App sysprepDecrypter.exe, arguments "

    Copied file sysprepDecrypter.exe to C:\Windows\system32\sysprepDecrypter.exe

    Update boot run value.

    Created / opened key \Guest Customization\ SOFTWARE\VMware, Inc. successfully.

    New shoe, run:

    autocheck autochk/q/v *.

    sysprepDecrypter.exe

    System drive: C:

    Move the folder "sysprep" to "C:".

    Select * from win32_networkadapter where manufacturer! "Microsoft" and ServiceName =! = "VMnetAdapter" and the manufacturer is not null and MACAddress is not null

    1 objects found. Pointer f049a8. return code 0(0x0)

    "" "0 items found." " Pointer to 0. return code 1(0x1)

    00:50:56:B0:70:46 the value for the property return system

    Setting dhcp for nic # 0

    Return value \\VMT-W2K12R2\ROOT\CIMV2:Win32_NetworkAdapter.DeviceID="10' for the system property

    ASSOCIATORS OF {\\VMT-W2K12R2\ROOT\CIMV2:Win32_NetworkAdapter.DeviceID="10"} where ResultClass = Win32_NetworkAdapterConfiguration

    1 objects found. Pointer eee290. return code 0(0x0)

    "" "0 items found." " Pointer to 0. return code 1(0x1)

    Clear the gateway ip addresses.

    Enabling DHCP on the computer

    Returns the value for the system property \\VMT-W2K12R2\ROOT\CIMV2:Win32_NetworkAdapterConfiguration.Index=10

    DNS server IP configuration

    Execution of command C:\windows\system32\sysprep\sysprep.exe/quiet/generalize/oobe/reboot /unattend:C:\sysprep\sysprep.xml

    Successfully executed the command C:\windows\system32\sysprep\sysprep.exe/quiet/generalize/oobe/reboot /unattend:C:\sysprep\sysprep.xml

    Try to connect network interfaces, try 1

    RPCI: Send request = 'deployPkg.update.state 4 103 C:\Windows\TEMP\vmware-imc\guestcust.log@4000'

    RPCI: Envoy = 'deployPkg.update.state 4 103 C:\Windows\TEMP\vmware-imc\guestcust.log@4000' request, response is "queryNicsSupported", len = 18, State = 1

    Got answer VMX 'queryNicsSupported '.

    RPCI: Send request = 'deployPkg.update.state 4 104 C:\Windows\TEMP\vmware-imc\guestcust.log@4000'

    RPCI: Envoy = 'deployPkg.update.state 4 104 C:\Windows\TEMP\vmware-imc\guestcust.log@4000' request, response = 'connected', len = 9, State = 1

    Got VMX response "connected."

    Network interfaces are connected to 0 seconds

    =============================================

    OK, I myself fixed the end.

    I created a new customization file with exactly the same settings as the old file, and it worked. I can only assume that the old customization file has been altered somehow.

  • Deploy multiple virtual machines from one model to the help of customization of the OS and a text file for hostname and IP

    Hi all

    Not sure if this has already been answered, I did a search on the forums, but couldn't find an answer to what I'm looking for.

    I want to fully automate the deployment of multiple VMs of a model using a customization file, but also to retrieve the host names and IP addresses from a text file / spreadsheet.

    for example:

    I need to deploy a test environment of 30 virtual machines using the template file and customizing TestVM. I have a spreadsheet with the VM host names and IP addresses. The process now is to manually enter the host name and IP when the customization file invites to do while deploying them in each virtual machine. The customization file takes care of the rest (license key, admin password, add to the domain etc.) can I automate entry of the name of host and IP addresses in reading from a text file?

    Thanks in advance!

    Take a look on the deployment, customization and modification of virtual machines to a csv file

    There are many more examples of this community on the same subject,

  • Need a solution to customize virtual machines deployed from models

    Here's the problem:

    When I deploy virtual machines from a template, the guest of the new virtual machine operating system takes the same size of hard drive than the model between what was created.  It is very fast to increase the size of the virtual hard disk after deployment.  But the size of the partition in the guest operating system is unchangeable.  This means that, for each virtual machine, I have to start the virtual machine and either extend the guest operating system by using an operating system disk management tool or a third-party for the partition management application.

    It takes a lot of time to do during the deployment of a large number of virtual machines.  Another option is to create a template for each size of hard drive - but the problem with this is that all of these models for each operating system must be maintained, that takes a lot of time.

    Does anyone have ideas for another or better solutions?  For example, is there such a thing as a tool that integrates with VMware to enable not only the size of the virtual hard disk, but also the size of the partition of the guest operating system to customize when you create a virtual model of computer?

    Any contribution is appreciated-

    Thank you

    It resizes the disk partition inside the virtual machine to the guest OS uses the complete virtual disk capacity.

  • Hang a new virtual machine to the Internet

    All virtual machines that I downloaded connect to internet automatically when I their fire upwards. I downloaded a new machine virtual de VulnHub, specifically BrainPan2. It does not connect to the internet automatically even if it is supposed to. It's a vulnerable VM installation for security penetration testing. Now, I start my VM Kali, do a scan of the network and see all my computers. I'll start a VM unrelated, rerun the scan and check the other appears. Now I launch BrainPan, run the scan and nothing. I don't see on the scan.

    I read several guides associated with the virtual BrainPan2 of the internet machine, and everyone seems to be able to plug in and go. On the site of the BrainPan: 'import brainpan2.ova into your privileged hypervisor and configure the settings of the network to your needs. It will get an IP via DHCP, but it is recommended that run you to the breast of a NAT or visible by the host only operating system because it is vulnerable to attack."

    So, I put the virtual machine to run on NAT, connected by a bridge and also host. I can't detect the virtual machine by any means, it just is not auto-connect. And I can not connect and plug it as he did to hack.

    Does anyone have any suggestions?

    Hi John,.

    I'm using the regular VMware Fusion, not Fusion Pro. Fusion Pro is a virtual network editor that could help; I do not know. Just for fun, I downloaded BrainPan2 VM, and it worked only. Here are the steps I took:

    • Go to Brainpan: 2 ~ VulnHub
    • Click Download, which exposes the download link.
    • Download the file brainpan2.zip and unzip it.
    • Check the integrity of the downloaded file brainpan2.ova. In terminal, type 'openssl sha1', and then drag the file brainpan2.ova to the Terminal to fill in the full path of the brainpan2.ova file. Press return. Compare the sha1 hash in the terminal with one on the web page of the BrainPan. If they do not match, try again download.
    • Open VMware Fusion 8 and choose file-> import. Drag the file brainpan2.ova to the window. Click on the button continue and save the converted virtual machine. VMware Fusion will display a progress bar as it converts the file .ova. It took a few minutes on my Mac. Once the conversion is completed, you will see a window Finished.
    • Click Customize settings.
    • As part of the network card, select private to my Mac.
    • Start the virtual machine of BrainPan2. I don't bother to upgrade the hardware. You will see a login prompt, which I ignored. The BrainPan2 virtual machine will get an IP address from the DHCP server on VMware virtual network.

    Optional:

    • Open the BrainPan2.vmwarevm file in the Finder. Right-click to display the contents of the package. Open the vmware.log with a text editor like BBEdit or TextWrangler or even TextEdit. Search for "192.168" and you will find two entries to the VMware virtual networks. On my system, the private sector in my Mac network was vmnet1 to 192.168.166. * (I guess that the other network is the "share with my Mac" NAT.) He was appointed vmnet8.)
    • Close the log file.

    Instead of Kali Linux, I used one of my virtual machines in OS X, because it was very convenient. (My Kali Linux virtual machine are saved on an external drive). The virtual machine of OS X I used runs El Capitan, but any version of Mac OS X.

    • Take a snapshot of the OS X machine for two reasons: (1) to maintain its normal parameters and (2) because I don't trust the BrainPan2 virtual machine to not attack the OS X machine on the VLAN.
    • After the snapshot set network configuration of the virtual machine of the OS X private to my Mac, so that it is on the same virtual network as the virtual machine of BrainPan2.
    • Start Mac virtual machine. In the terminal, type "ifconfig en0" to see its IP address on the local network deprived of VMware. There are other ways to find the IP address, of course. My virtual machine to OS X has been awarded 192.168.166.129, so I figured though the virtual machine of BrainPan2 has been assigned to 192.168.166.128, which proved to be just.
    • If it is not already installed, download nmap or Zenmap or tools of everything that you need. A Kali Linux preinstalled.
    • Run a scan of the LAN ping. Example: ' nmap - sn 192.168.166. * "you should see the virtual switch to 192.168.x.1, your virtual Kali Linux or OS X machine and the virtual machine of BrainPan2 (mine was 192.168.166.128 as I suspected). The virtual machine BrainPan2 responds to the pings.
    • At this point, I ran a scan of port of the virtual machine of BrainPan2. Not wishing to spoil your fun, I will only say that I found the open ports on the BrainPan2 virtual machine.

    Don't forget to restore your virtual machine OS X (or Kali Linux) to the previous snapshot once you are done with BrainPan2, if nothing else, but to restore access to the Internet by moving out of virtual private LAN.

    I hope this helps. Please let us know if you are able to make it work. I hate to write solutions and then never discover what happens then.

  • Can't export virtual machines: unable to connect to the remote server

    Hello

    I'm working on vSphere client 5.1 (vCenter Server 5.1). Trying to export a virtual machine for distribution model. When I go to file-> export the template OVF..., I get the following error message:

    Can't export virtual machines: unable to connect to the remote server

    Remote not sure what/who he is not able to connect to. If I connect vSphere Web Client and navigate to the same model (or all other models), under 'All the Actions of vCenter' I don't have an option to export to the model of the FVO. But if I use a VM machine instead of a virtual machine template, I have the ability to export to the OVF, but it is grayed out.

    Am I missing any customer authorization or plugin for vShpere?

    Discovered that vSphere server had some modifications made by HIM to resolve the violation POODLE. HE had to set the ip address of the machine where export OVF will be performed. Which allowed the connection to establish vsphere client and perform an export of the FVO.

  • Management update for the Virtual Machine update

    Dear people,

    I have an obligation to use the Update Manager to update java and adobe software windows VM insde. But I can find no basis for Virtual Machine updates or software updates. Reference predefined VM have only VMtools updates and VMHardware.

    Could someone help me please?

    Update: we have using maager update 5.

    --

    Thank you

    Hari.

    Manager Update are no longer updated software inside the virtual machine to be

    Maish

    VMTN moderator | vExpert

    Author of VMware vSphere Design

    @maishsk | My Blog

  • The Virtual Machine encryption

    All,

    I have a client that requires encryption at the virtual machine level. I was wondering what products are available and what users experience is.  The requirement is to have an end to end data encryption. We are looking at the possibility of offering it at the virtual machine level to meet their requirement.

    Ephillipsme

    Hello

    If you are using VMware ESX/ESXi encryption within the virtual machine (at the level of the guest OS) is the only option. As the use of BitLocker for windows or TrueCrypt for other operating systems. Just be aware that these two options to store the keys in memory and any system administrator can also access the memory at any time. So if you trust your admins it's an operation relatively safe.

    If you put data in the cloud then watch in secure Cloud.

    As now, there is no third party encryption tool, nor is it a tool built into ESX/ESXi.

    There is NO tool to encrypt the ESX/ESXi to level "VM" which is just below the guest operating system. VMware workstation has this ability, but requires you to enter a startup key and if you have lots of virtual machines that become extremely painful.

    Best regards

    Edward L. Haletky

    Host communities, VMware vExpert,

    Author: VMware vSphere and Virtual Infrastructure Security,VMware ESX and ESXi in the 2nd business edition

    Podcast: the Podcast for security virtualization of resources: the virtual virtualization library

  • Retrieve the ttylinux virtual machine model

    What is the best way to recover or reinstall the model ttylinux-4-ESX3 in Lab Manager 3.0.1?

    Thank you!

    The first time I installed Lab Manager, I deleted it in the virtual machine templates, but it was always deployed when I deployed closed networks or models of network with a connection to a physical network to bridged. You should be able to see in Virtual Center as a virtual machine as part of the configuration of your closed ground even if it isn't in your inventory of Lab Manager VM model.

  • Virtual machine from Windows XP to Windows 7 Professional

    Two years ago the virtual machine from Windows XP was installed on my laptop which has Windows 7 Professional.  I use version XP for playing games is not compatible on Windows 7.  Everything worked well until a few weeks ago.  I was unable to open the games.  An error message window is displayed when I click to start the game.  "C:\WINDOWS\SYSTEM32\CONFIG. NT.  The file system not suitable for running MS-DOS and Microsoft Windows applications.  Choose 'Close' to terminate the application. "The top border of the window says error message"16 bit Windows subsystem.   Any ideas.

    After temporarily off any protection, I tried restore and recovery without success.  Error message says that both failed.

    Please keep in mind that I'm completely computer illiterate.  Thank you.

    Hello Willias,

    Thanks for posting your question on the Microsoft community.

    The question will be better suited to the audience of professionals on the TechNet forums.

    I would recommend posting your query in the TechNet forums.

    TechNet Forum
    https://social.technet.Microsoft.com/forums/Windows/en-us/home?category=w7itpro

    Thank you

  • API to create a Virtual Machine without using a model

    I see the GUI documentation how to create a virtual machine without a model, but I can't find the actions of the API how to build the virtual machine based on custom settings (CPU, memory, OS, etc.), there are a only of the shares how instantiate OVF or vAppTemplate. Could you please tell is possible to generate/create the VM without model or OVF by API?

    I see. Thanks for the background.

    Based on my notes there is no such API. Other applications were similar to this one and the solution suggested in this case is to programmatically create an OVF (describing the configuration of the VM to instantiate) and import it into the vDC. The end result is the same (i.e. an empty VM configured by entries) the difference is how it gets instantiate (created from zero Vs described in the OVF and imported).

  • How do you exit name of Virtual Machine of ' Get - VM | Get-AdvancedSetting' command?

    Hello, I have a question which is hopefully enough simple to answer.

    I'm having this problem explained in KB 2078352 and you want a list of VMs affected before hotfixing them, to see if it helped with our problem or not.


    Sample line:

    Get - vm | Get-AdvancedSetting - name tools.deployPkg.fileName

    Name value Type Description

    ----                 -----                ----                 -----------

    tools.deployPkg.f... imc1D01.tmp VM

    tools.deployPkg.f... imc937E.tmp VM

    tools.deployPkg.f... imc32EE.tmp VM

    tools.deployPkg.f... imc6030.tmp VM

    This shows only the value of the file names, but not the names of virtual machine. So I was just wondering how I can get an output of name of virtual machine with this information?

    Thanks in advance.

    Try adding a Format-Table may

    Get - VM | Get-AdvancedSetting |
    Select @{N = "VM"; E={$_. @entity.name}}, Name, Value | Format-Table - AutoSize

  • problem with mcafee DLP Device control on virtual machines Windows XP

    Hallo,

    We use view ESX 4.1 and 4.5.
    I have the problem that we use DLP 9.1 with EPO 4.5 and have the problem that when we use DLP USB glue with series nummer they do not work through zeroclient on the virtual machine.

    We've set the rules in the operative part of DLP controll that she is allowed to use usb sticks which are content encrypted and where the serial number is saved in the DLP.


    It works fine on normal physical laptop but if I use the same USB on my zeroclient who got a machine virtual vmware as the stick got allways blocked.
    I also tried to register before the stick no serialnumber and used the VID and PID, but also that have the same result as the stick has blocked.


    If I disable all the rules of control of the aircraft as the stick got mapped from zeroclient to the virtual machine without problem.
    Can help you to use or is there any practice well known for using control of the device with virtual machines?

    I was also in touch with mcafee, but they want to say, this problem is related to vmware and I close go in contact with vmware.

    Best regards
    Heinze MS

    Hallo,

    so, we found the problem.

    The reason why in the virtual machine, it has no SN the stick that we couldn't resolve, but we are in contact with the zeroclient of the teradici seller.

    The reason why the instance id of the stick and PID or VID where does not have a problem in the permission set for the users who have applied the policy of the EPO.

    DLP policy showed he applied rules and also the show later when you loggon, but he was right on the configuration screen that this rule are configuried when you use DLP political configuration of the importation of the EPO server it load the config which is really being used and so we saw that when we have configured the USB via the instance VID PID or device that was never written on the server EPO and never applied to the virtual machine :-)

    best regards, perhaps it's useful for someone

Maybe you are looking for