Duplicate name after a virtual machine cloning

We run ESX 3.5. After I cloned a cup of virtual XP Machines, all have the same host name and I get duplicate name message. How to avoid that?

Bob Lee, MS - MVP, MCSE & CNE

Networking, Internet, routing, VPN Troubleshooting

http://www.ChicagoTech.NET

Sysprep and models should take care of this.

http://www.VMware.com/PDF/vc_2_templates_usage_best_practices_wp.PDF

Tags: VMware

Similar Questions

  • PortGroup change after a virtual machine cloning

    Hello there,

    hope someone can help me, find a solution to my problem: I want to change the PortGroup to a virtual computer after cloning a model.

    Thanks http://mighty-virtualization.blogspot.com I am able to get all the information I need. But I have no solution to try to change the PortGroup.

    My actions for the information:

    getPortGroupByNetworkName

    var dvGroups = VcPlugin.getAllDistributedVirtualPortgroups ();

    i in dvGroups
    {
    If (dvGroups [i] .name is NetworkName)
    {
    return dvGroups [i];
    }
    }

    getDistributedVirtualSwitchByPortGroup

    VGA var = VcPlugin.getAllDistributedVirtualPortgroups ();
    var DVS = new Array();

    i in VGA
    {
    DVS.push (dvPG [i].config.distributedVirtualSwitch);
    DVS.sort ();

    for (i = 0; i < DVS.length; i ++)
    {
    If (I! = 0)
    {
    While (DVS [i] is DVS [i-1])
    DVS.splice (i, 1);
    }
    }
    }

    (j in DVS)
    {
    (h in DVS [j] .portgroup)
    {
    If (.portgroup [j] [h] DVS is PortGroup)
    {
    return DVS [j];
    }
    }
    }

    My task scriptable workflow after completing the dvSwitch and the portGroup by networkname:

    var MinLastStatusChange = 2;
    var DateNow = new Date();
    var TempYear = DateNow.getFullYear ();
    var TempMonth = DateNow.getMonth ();
    var TempDay is DateNow.getDate () - MinLastStatusChange.;

    If (TempDay < = 0)
    {
    TempDay = TempDay + MinLastStatusChange;
    TempMonth = TempMonth - 1;
    }
    If (TempMonth < = 0)
    {
    TempMonth = TempMonth + 12;
    TempYear = TempYear - 1;
    }

    var DateTwoDaysAgo = new Date (DateNow.getFullYear (), TempMonth, TempDay, DateNow.getHours (), DateNow.getMinutes (), DateNow.getSeconds ());
    var PortSpecs = new VcDistributedVirtualSwitchPortCriteria();
    PortSpecs.connected = false;
    PortSpecs.portgroupKey = new Array (detectedPortGroup.key);

    System.log("------------------------------------------------------------------------------------------------");
    System.log ("-today:" + DateNow);
    System.log ("-two days ago:" + DateTwoDaysAgo);
    System.log("------------------------------------------------------------------------------------------------");
    System.log ("detected PortGroup Key:" + detectedPortGroup.key);
    System.log ("detected PortGroup Name:" + detectedPortGroup.name);

    System.log ("detected dvSwitch Name:" + detectedDvSwitch.name);
    System.log ("detected dvSwitch ID:" + detectedDvSwitch.id);
    System.log ("detected dvSwitch UUID:" + detectedDvSwitch.uuid);
    System.log("------------------------------------------------------------------------------------------------");

    Ports of the var = detectedDvSwitch.fetchDVPorts (PortSpecs);
    i in Ports
    {
    If (.lastStatusChange [i] Ports < = DateTwoDaysAgo)
    {
    var detectedPort = [i] Ports;
    break;
    }
    }
    System.log (' key Port detected: "+ detectedPort.key +" IS FREE"');
    System.log ("the State of the Port detected:" + detectedPort.state);
    System.log ("last Port State change detected:" + detectedPort.lastStatusChange);
    System.log("------------------------------------------------------------------------------------------------");

    var myVirtualDeviceConfigSpec = new VcVirtualDeviceConfigSpec();
    var myVirtualMachineConfigSpec = new VcVirtualMachineConfigSpec();
    var myVirtualDeviceArray = new Array();

    for (i = 0; i < vm.config.hardware.device.length; i ++)
    {
    If (System.GetModule("de.) (("WW - Informatik.Functions") .wwiIsNetworkCard (VM.config.hardware.Device [i]) == true)
    {
    Map var = vm.config.hardware.device [i];

    System.log ("NIC(Device"+ i +") found:"+ card ");

    System.log ("PRE port:" + networkCard.backing.port);
    System.log ("PRE portgroupKey:" + networkCard.backing.port.portgroupKey);
    System.log ("PRE Key:"+ networkCard.backing.port.portKey ");
    System.log ("PRE dvSwitch UUID:"+ networkCard.backing.port.switchUuid ");
    System.log("------------------------------------------------------------------------------------------------");

    TempBacking = System.getModule("com.vmware.library.vc.vm.spec.config.device").createVirtualEthernetCardDvNetworkConfigSpec (detectedPortGroup);

    myVirtualDeviceConfigSpec = TempBacking;
    myVirtualDeviceConfigSpec.device = map;
    myVirtualDeviceConfigSpec.device.connectable.connected = true;
    myVirtualDeviceConfigSpec.device.connectable.startConnected = true;
    myVirtualDeviceConfigSpec.device.backing.port.portKey = detectedPort.key;
    myVirtualDeviceConfigSpec.device.backing.port.portgroupKey = detectedPortGroup.key;
    myVirtualDeviceConfigSpec.device.backing.port.switchUuid = detectedDvSwitch.uuid;
    myVirtualDeviceConfigSpec.operation = VcVirtualDeviceConfigSpecOperation.edit;
    myVirtualDeviceArray [0] = myVirtualDeviceConfigSpec;

    myVirtualMachineConfigSpec.deviceChange = myVirtualDeviceArray;

    task = vm.reconfigVM_Task (myVirtualMachineConfigSpec);

    System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd (task, false, 0);
    }
    }

    Maybe I did the steps wrong to change the portgroup but I tried a few things and this is my best solution, but it does not work.

    Hope you can help me.

    Best regards

    Chris

    Please try my package here http://communities.vmware.com/message/1731492#1731492 since you are targeting a GROUP of virtual ports distributed

  • What is the difference between a virtual machine cloning and v2v conversion to a virtual machine

    What is the difference between a virtual machine cloning and v2v conversion to a virtual machine

    Cloning process is to duplicate a VM. V2V is deploy vm on vsphere environment to another virtual machine format (example: the workstation, hyper-v).

  • Name of the Virtual Machine in full-screen

    Hello

    Is there a way to display the name of the Virtual Machine when you have it in full screen. The problem is that if you have multiple Virtual Machines open and they are full screen and off you self only a black screen and Don t know you one you have active. I would like to see the name of the VM on the screen as we see a screen capture if you pause the virtual machine.

    nolsson wrote:

    Do you mean that you force different Virtual Machines in different spaces? Like you always have Windows 7 into space 2 and Linux in 3 space.

    Yes, but I wouldn't use the word 'strength', I assign the VM space when running.  I open Fusion and then VMS, I use like XP, Ubuntu and I move the virtual machines to the spaces that I want them and I keep not merge.  I can suspend VMs need to free up RAM, but otherwise merge is left running.

  • How to get the name of my virtual machine to a named resource pool

    Based on the script ghettoVCBg2 on the platform VIMA, I realized a backup solution for my ESXi (free) servers (also an automatic mailing is integrated ). My next goal is to integrate an automatic selection of my computer virtual based on the name of the list of resources. To understand, I have mainly two categories '1_Productive' and '2_Test', from resource pools. In both categories, there is a resource pool 'SRV' and 'CLT '.

    for example: 1_Productive-SRV-VM

    ------CLT-VM

    At the time of the backup, I have to manually enter the name of the virtual machine in a file. My question is how to integrate an automatic selection for example my pool of resources "SRV." My first idea was to shoot the 'vidiscover.pl' tool and run it for each server separately. Subsequently I merge files into a single file for ghettoVCBg2. You should know I want only to mit backup s excluded '1_Productive\SRV' VM '2_TEST\SRV '. But the name in double "SRV" can be replaced. A really great solution could be a direct integration in ghettoVCBg2

    Could someone help because I'am not very firm with perl programming...

    Thank you very much.

    Take a look at this review of the script: listVMsInResourcePool.pl

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

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    repository scripts vGhetto

    VMware Code Central - Scripts/code samples for developers and administrators

    150 VMware developer

    Twitter: @lamw

    If you find this information useful, please give points to "correct" or "useful".

  • After the Virtual Machine is hot migrated lose the reference to the virtual computer object (VMware.Vim.VirtualMachine)

    Hello

    In my VB.Net application, I retrieve the virtual computer object (VMware.Vim.VirtualMachine) through scripting Powershell VI.

    If the Virtual Machine is migrated to another host (hotmigrate) I receive an event (VMware.Vim.VmMigratedEvent), which also holds the moref of the Virtual Machine. I tried to use the updateview method to refresh the virtual computer object but failed with an error message stating that the object could not be found, or never existed.

    I also tried to recover the virtual computer object again, throug the method Client.GetView and the moref returned by the event, but the same error message.

    How can I get my hands on the virtual computer object or update after migration to another host takes place. I have to get it back again? It would be great if I could do it somhow with information from moref I hold the event!

    Any help is appreciated!

    Concerning

    Manfred

    Sorry, but I can only show you how to do this in PowerShell.

    I use the purpose of the task to get to the prompt MoRef.

    Here's how:

    $vmName = 
    $tgtHost = 
    $tgtPool = 
    
    $vm = Get-VM $vmName | Get-View
    $poolMoRef = (Get-ResourcePool $tgtPool | Get-View).MoRef
    $esxMoRef = (Get-VMHost $tgtHost | Get-View).MoRef
    
    $task= Get-View ($vm.MigrateVM_Task($poolMoRef, $esxMoRef, "lowPriority", "poweredOn"))
    
    while($task.Info.State -eq "running" -or $task.Info.State -eq "queuing"){
      $task.UpdateViewData()
    }
    
    $vmImpl = Get-VIObjectByVIView -MORef $task.Info.Entity
    

    I don't know how you get at the VmMigratedEvent event, but the MoRef in there is pointing to the correct prompt.

    In the following script, I extracted all the events related to the task of vMigrate immediately after the vMigrate task finished

    function Print-VmName{
         param($event)
    
         $MoRef = New-Object VMware.Vim.ManagedObjectReference
         $MoRef.Type = $event.vm.vm.type
         $MoRef.Value = $event.vm.vm.Value
         $vm = Get-View $MoRef
         Write-Host $vm.Name
    }
    
    $events = Get-VIEvent -Start (Get-Date).addminutes(-15)
    $events | % {
         $event = $_
         $eventType = $_.GetType().Name
         switch ($eventType){
              "VmMigratedEvent" {
                   $eventType
                   Print-VmName $event
              }
              "VmEmigratingEvent"{
                   $eventType
                   Print-VmName $event
              }
              "VmBeingHotMigratedEvent" {
                   $eventType
                   Print-VmName $event
              }
              "TaskEvent" {
                   $eventType
                   Print-VmName $event
              }
         }
    }
    
  • snapshotmanager.pl to view the instant full name of the virtual machine without hanging.

    Is there an option in snapshotmanager.pl that I can use to display the entire name instant. From now on, the name of the snapshot is divided into LIST action after which my GOTO action does not rightly! All tweak in snapshotmanager that would allow me to list the full name of a snapshot for a virtual machine that I could feed to the GOTO routine (I wouldn't mind if date, State, standby is not displayed).

    Actually, I'm trying to write a script to perform multiple actions of instant goto for a virtual machine.

    Athens: / usr/lib/vmware-viperl/apps/vm # /usr/lib/vmware-viperl/apps/vm/snapshotmanager.pl--serveur 10.99.13.22 - root - password vmware1 - operation list username - vmname "CentOS_52 (1).

    Snapshots of virtual machine CentOS_52 (1) under the esx22.abc.com host

    Name Date status suspended

    Snap 2-n-n-2009-01 - 06 T 03:20 N receptor

    instantane1-n-n-2009-01 - 06 T 03:21 receiving N

    Snapshot created for Machine virtual CentOS_52 2009 - 01-06T 03:21 receiving N

    Athens: / usr/lib/vmware-viperl/apps/vm # /usr/lib/vmware-viperl/apps/vm/snapshotmanager.pl--serveur 10.99.13.22 - root - password vmware1 - operation goto username - vmname "CentOS_52 (1)"-nom_snapshot «Snapshot created for Machine virtual CentOS_52»»»

    Snapshot not found with instant name created for virtual computer CentOS_52 in virtual machine CentOS_52 (1) under the esx22.abc.com host

    The snapshotmanager.pl script uses the following line to display snapshots of a virtual machine.

    > printf "%s%-48.48s%16.16s %s %s\n", $head, of the $ str. $node-> name,

    > $node-> createTime, $node-> status-> val, $quiesced;

    It is a command simple "printf" which can be changed to format the output. You can modify this code to increase the character limit to meet your needs.

  • After Reboot virtual machine - VM not no projection in host, orphaned in vCenter

    Hi all

    I had a server 2 k 8 running as an IIS server.  While using it last night, he hung up on me and I couldn't restart it.  I went in vCenter and restarted from there and the VM looks ok to stop, but he would not return to the top.  I tried to start but got an error.  Then in the host ESX and virtual machine was no longer available at the level of the host and on the vCenter, it showed also orphaned.

    I did a reading online and follow a guide who was told to remove the orphaned VM and add the VMDK as a new virtual machine.  After these steps, my VM boots now beyond the BIOS screen, and starts to load windows then get a quick second BSOD split, then the VM restarts and gives me the possibility of:

    -Start windows normally

    -Windows startup recovery

    If I boot normally, it makes a loop in the same cycle, if I do a start of the recovery, it gives me the normal windows recovery tools.  In the diskpart tool, I see the end as well as the disk partitions.

    Can someone the tsar me in the right direction? My guess is that something in the files of the virtual computer is corrupted, causing windows back his process of starting because of a hardware problem... ?

    I have attached a few newspapers too.  Thanks for the tips!

    If this is the only virtual machine affected, then this is probably the OS corruption. You can deploy a new virtual machine and migrate data on existing records to the new (just to mount the VMDK on the new virtual machine) or go to the effort of the diagnosis and repair of the system.

    If you are going to do the later, then start by identifying the BSOD error - is is a mistake of 7B? (please post a screenshot). You can start in safe mode? If you can, it would be from a local value of core dumps are configured so that you can run the. DMP file via WinDbg to debug the stop error... This will give you information about this driver etc. is causing the crash dump.

    See you soon,.

    Jon

  • Set the host name for a virtual machine

    While the vApps instantiation using a model about the same way as the sample of HellovCloud.java, I need to be able to change the host name (called the name of the computer in vCD) of the only virtual machine contained in the VAPP. I can't find examples on how to do it. Any ideas?

    Hope that this helps, I took it out some code that we use (SDK). NET - this is not an exact copy of the labour code, but must be what it takes to get there.

    String modifierText = "1234";

    With complete API v1.5 may need to change this kind of object to Vm

    VAPP vm = GETTHECHILDFROMTHEAPP (VAPP. GetChildrenVms());

    If (vm. GetGuestCustomizationSection()! = null)
    {
    GuestCustomizationSectionType guestSection is vm. GetGuestCustomizationSection();
    int len = guestSection.ComputerName.Length;
    If (len > 10) len = 10;
    guestSection.ComputerName = guestSection.ComputerName.Substring (0, len) + modifierText;
    Try
    {
    VM. UpdateSection (guestSection);
    }
    catch (VCloudException ex)
    {
    Exception thrown by 1.5 hosts: VCloudException
    (The parameter is not supported in the current context: AdminPassword)
    bug workaround
    If (Message.Contains ("AdminPassword") e.g.)
    {
    AdminPassword value NULL and try again
    guestSection.AdminPassword = null;
    VM. UpdateSection (guestSection);
    } else {}
    throw;
    }
    }
    }
  • excluding the hard drives in a virtual machine cloning

    Hello

    I want to clone a virtual machine that has multiple drives. The c: drive has OS (W2008R2) and is small enough, D:, E:, and F: are large (terabytes), and contain data. I need only the C: drive in the clone. Is it possible to exclude other readers during the cloning process? I clicked through the wizard, but it does not give me an option.

    Thank you

    Matthias

    I would use the VMware Converter Standalone where you have a choice of which drives to clone.  http://VMware.com/go/converter

  • Windows 2 k 3 lack of SCSI controller after running virtual machine converter

    Hello

    After you convert a Windows 2 k 3 server making the VM P2V is now lack a SCSI controller for the virtual machine cannot start.

    What is the best way to solve this problem? I need to copy the drivers from the physical server?

    Thanks in advance,

    PM

    If the disk controller type see you in the settings of the virtual machine is IDE, check out http://kb.vmware.com/kb/1016192.

    Another option is to choose the type of controller in the converter, when it comes to hardware.

    André

  • How to change network name for all virtual machines within the same cluster

    We have recently changed name vswitch to take into account that something significant, in the past vCenter could change the labels of networh for all virtual machines... seems this time help labels are not changed (maybe its got something to do with the update vcenter for 2.5.U3)...

    in any case, someone at - it a powershell script that could find all the virtual machines that are referring to the old label network and then changing again the name... ?

    Enjoy the respponses...

    Thanks in advance

    A few things on this blog could help.

    If you know the names you want to use, you could also just use something like:

    Get-Cluster X | Get-VM | Get-NetworkAdapter | Where { $_.NetworkName -eq "OldNetwork" } | Set-NetworkAdapter -NetworkName "NewNetwork" -confirm:$false
    Get-Cluster X | Get-VM | Get-NetworkAdapter | Where { $_.NetworkName -eq "NewNetwork" } | Set-NetworkAdapter -Connected:$true -confirm:$false
    
  • List of IP address and name of the virtual machine in a virtual

    Hello world

    Nice to be back on this forum. Actually, I'm trying to get all the Vm name and corresponding virtual center using VI SDk2.5 ipadress. Also is it possible to enumerate all ESX under Virtal Center - & gt; and all (Vm + ip) under ESX.

    BTW, you must have installed VMware tool to get the IP address since that information is available of OS and not the VM itself. The property path for the IP address is guest.ipAddress.

    Once you get the reference of the virtual machine, you can get it easily:

    vm.getGuest () .getIpAddress)

    Note: getGuest() may be null, so should be checked before calling getIpAddress().

  • Windows XP does not correctly load after installing Virtual Machine

    Original title: System Restore

    I recently tried to install a Machine Microsoft VM on myWindows XPcomputer. By getting a message "Please reboot", I clicked on "restart now." The computer turned off and running back. When he steps back, the loading screen appears, and then the blueHP Inventscreen appeared (which is normal). But then something odd happened. A small window appears in the left corner of the screen. It read: "loading your personal settings: System Restore, Control Panel, etc...", or something of the sort. The default software supplied with the computer window appeared. The blue HP Invent screen continued to remain in the shadows.

    When I eventually clicked the 'x' in the antivirus window, the taskbar, start button, etc. appeared, but most of my desktop icons were missing. Then I noticed that the blue screen of theHP Ivent became my wallpaper. Puzzled, I navigated to the 'System Restore' window. Then, several windows titled 'Welcome in Windows XP' and "Turn Windows XP" appeared. I have navigated to System Restore window and chose a system restore point (which was the day before) and continued the process of system restore. The system was supposed to be restored. At startup, the same window in the left corner appeared; the antivirus window is appeared. The system restore window is appeared then, confirming that the system restore was successful (which it wasn't). Everything was the same way before I had done the system restore.

    In a panic, I went to Internet Explorer. The browser then showed up and greeted me with messages as if I had never used, and [if not all] most of my favorites had been withdrawn. Then, I assumed that my computer has been restored to factory settings. But of course, in opposition to my thesis, my Antivirus AVG software  that I had installed before all these problems occurred, was still on my computer. My iTunes was also still on my computer, but my entire library has been destroyed, and when I double click the icon, it asked me to install the iTunes software (as if I had just downloaded on my computer).

    I procceeded to try to restore my computer to different restore points, but all attempts were in vain, because no settings have been changed... And that's my story. Also, I would appreciate some answers detailed as soon as possible, because this computer is not me anyway... Thanks for reading guys!

    I recently tried to install a Machine Microsoft VM on myWindows XPcomputer. By getting a message "Please reboot", I clicked on "restart now." .....

    the small window that you mentioned is probably the virtual machine window.  and if you it configured during installation, as attributed too much ram memory and disk space, and then the windows in normal mode went out of these valuable resources.

    In addition, if the system disks and files was not optimal performance via tune ups, then they could have been less than optimal before installing the vpc and the systems simply becoming worse by installing more data.

    regarding the failed system restore points, we don't know why they did not work.  but the system restore function is stable, except somethings interferes with her bad anti anti-virus programs or system files have been corrupted with infections beyond you're a.v design..  the bottom line is that "who knows?"

    You can probably try is to start in safe mode and try to uninstall virtual pc via Add/Remove programs in the control panel.

    then see if the normal mode is normal once again.

    Another method, you can try again in safe mode is the restoration of the system again.

    then see if the normal mode is normal once again.

    Another method, you can try in safe mode, you can try to perform a clean boot to normal mode.

    DB·´¯'·.. ¸ >-))) º > ·´¯'·.. ¸ >-))) º > share nirvana mann

  • Have problems connecting to the Internet after the virtual machine has crashed.

    Original title: problems sudden ethernet

    Hello

    I'm having a problem with connecting my computer custom-made. I was with my virtual machine to run an android phone. It connected via a second wireless connection (I don't know much I just let it work). It crashed my computer and when I rebooted I had no internet.

    It would also be useful to mention that I recently had a BSOD because of the virtual Manager and a driver, but I solved it.

    He said that no connection is available, and there is a red cross.

    So far I have tried:

    A second ethernet cable - nothing. (The two wires green on the end of the PC and the end of the router).

    Updated windows, but he can't because of the lack of connection.

    System Restore, but it says "Windows has detected corruption of system files on Local disk (C .)» You should check the drive for errors before you can restore it.

    sfc/scannow, but which translates "could not Windows Resource Protection start the repair service".

    I have also reinstalled the drivers for my cable ethernet twice and nothing.

    If more information is needed please ask. Thanks in advance.

    Hello

    In Device Manager, expand network adapters, right click on the Ethernet device and update the driver.  Otherwise, identify the manufacturer, go to their website and download the latest driver.

Maybe you are looking for