vCenter Orchestrator - Clone virtual machine with a name like VM_Date

Hello

I have try the Workflow "Clone virtual machine, no customization. It works very well but I would like to change settings (cloned virtual machine name), but I don't know how I could do this.

I would put the cloned vm name: vm_date like this CHDCVSCT0001_31_08_2011.

Is someone can help me?

Thanks in advance

Good day

Best regards

Christophe Simond

No prob. Scripting Self is always the best way to learn

Tags: VMware

Similar Questions

  • You can install vCenter as a virtual machine with fault tolerance

    The benefits of having vCenter as a virtual machine are features such as HA and snapshots, is there a problem with having a fault tolerance enabled on a virtual machine that is the vCenter server to manage fault tolerance?

    He couldn't see in the documentation for fault tolerance limits

    Well...

    vCenter lists 2 CPUs as required and FT only works with one...

    -Matt

    VCP, vExpert, Unix Geek

  • How to add the AD security group in each virtual machine with a name corresponding in VCenter?

    Hi all

    I would like to know if it is possible with VMware PowerCLI v4.1, I created the universal security group called 'Local administrators on %ComputerName%' for each server I have in UO computers by location OR separate and that he manually add members of the Local, but I want to attribute this security group in each computer virtual with the same name if possible.

    Basically, it's something like this:

    In the ad, here are computer objects:
    DOMAIN.com/Computers/ mailserver1-VM
    DOMAIN.com/Computers/ DBServer1-VM
    DOMAIN.com/Computers/ ApplicationServer1-VM

    In the ad's local security group objects:
    DOMAIN.com/SecureProductionOU/ 'Administrator locally on mailserver1-VM'
    DOMAIN.com/SecureProductionOU/ 'Local on DBServer1-VM administrator.
    DOMAIN.com/SecureProductionOU/ 'Local on ApplicationServer1-VM administrator.

    So I want to affect these security group in each respective name of VMS in VCenter:

    VCenter01.domain.com
    Datacenter1
    HighPerformanceCluster1
    Mailserver1-VM - Local Administrator on mailserver1-VM - role: read-only
    DBServer1-VM - Local Administrator on DBServer1-VM - role: read-only
    ApplicationServer1-VM - Local Administrator on ApplicationServer1-VM - role: read-only

    Any kind of aid and assistance would be appreciated grgeatly.

    Thank you.

    Hi Albert,

    I don't know what you want to check exactly, so I give 2 possible solutions.

    (1) you have a fixed number of names known to virtual machines for which you want to add this permission.

    $targetVM = "MailServer1-VM","DBServer1-VM","ApplicationServer1-VM"
    
    Get-Cluster -Name HighPerformanceCluster1 | Get-VM | `    where {$targetVM -contains $_.Name} | %{    New-VIPermission -Entity $_ -Principal ("DOMAIN\Local Administrator on " + $_.Name) `       -Role (Get-VIRole -Name ReadOnly) -Confirm:$false   }
    

    (2) you want to check for each virtual computer if the security group exist and then add the authorization.

    Get-Cluster -Name HighPerformanceCluster1 | Get-VM | `    Where{Get-QADObject ("DOMAIN\Local Administrator on " + $_.Name) `        -DontUseDefaultIncludedProperties -WarningAction SilentlyContinue `        -ErrorAction SilentlyContinue -SizeLimit 1} | %{    New-VIPermission -Entity $_ -Principal ("DOMAIN\Local Administrator on " + $_.Name) `        -Role (Get-VIRole -Name ReadOnly) -Confirm:$false} 
    

    Note that this requires the Quest AD snap-in must be installed. If you have a version without the Quest AD snap let me know.

  • VCenter as a virtual machine with a switch of vDistributed running

    Someone at-it no contribution, experience or thoughts about vCenter running as a virtual machine on UCS/vSphere 5, where the instance of vCenter is used as the point of integration of UCSM and the VM on vCenter is running is connected to the vDistributed switch (h/l VN-link) who is Manager of UCSM and vCenter?

    It sounds risky, but is it plausible? I have to use a regular for connectivity vSwitch if I want to virtualize vCenter?   Currently, we run vCenter standalone host outside of the virtual environment, that it manages.

    My personal preference is to place the VM vNIC on a standard vSwitch vCenter. The reasoning is while is no matter what going side with the distributed switch (vmware, ucsm or N1KV). vCenter connectivity would not be affected and you would be able to solve the problem more efficiently.

    We usually put SQL on the vCenter VM as well.

    Out the standard configuration is the following, and it worked very well with zero problems.

    2 for management and vCenter VM vNIC UCS - these 2 are sent to standard vSwitch0

    2 UCS vNIC for vMotion - these 2 are transmitted in standard vSwitch1 but configure the NIC teaming/failover so that vMotion traffic remains on 1 interconnection fabric or the other.

    2 for traffic VM vNIC UCS - these 2 are transmitted to a distributed switch VMware or UCSM (VM - FEX) or N1KV.

  • Help to get a list of virtual machines with switch network and name

    I'm trying to get a simple list of virtual machines on a single host and include their name and networkname.

    When I run this Get - vm | where {$_.} $host.name - eq "ESX.local"}, I get the virtual machines with their name.  When I run this Get-networkadapter - vm Get - vm | where {$_.} $host.name - eq "ESX.local"} I download news network with the name of the network, which is what im after. "  I want to combine these 2 commands and get vm name and network name in a csv.  The network name is the Group of ports, the VM is affected change settings for example, it could be vlan10 or what you named your group of ports in the switch DV.  I've attached a screenshot of the orders successfully.

    Hello, brisketx-

    You could do a little more efficiently by getting first the VMHost (s) that are of interest, then get their virtual machines and then using a computed property for the names of network for virtual machines.  As:

    Get-VMHost esx.local | Get-VM |    Select-Object Name, @{n="NetworkName"; e={(Get-NetworkAdapter -VM $_ | %{$_.NetworkName}) -join ","}}
    

    You can then, of course, lead to Export-Csv to write the data to a CSV file.  How does do for you?

  • How do the automatic deletion script clone virtual machines

    Hello

    We use the VM data recovery to clone virtual machines. We would like to clone some VMs on weekly basis but we need a script (or automatically) to remove the existing cloned VM automatically. VDR not clones a virtual computer when there is already a clone of this virtual machine.

    The easiest way is to use the Windows Task Scheduler.

    See runs a scheduled job PowerCLI Alan post.

  • Problem with script to clone virtual machines

    Hello

    I created a script to clone virtual machines on a regular basis around a method posted by LucD and Simon Long here or on their blogs.

    Here is the part that does the actual work:

    $VM = get - VM $Machine.MasterVM
    # Send Email of departure
    .\startmail.ps1
    # Create new snapshot clone
    $CloneSnap = $VM | New-Snapshot - name "Instant Test" - Quiesce
    # Get the managed object display
    $VmView = $VM | Get-View
    # Get the managed folder object reference
    $CloneFolder = $VmView.parent
    # Construction specification clone
    $CloneSpec = new-object Vmware.Vim.VirtualMachineCloneSpec
    $CloneSpec.Snapshot = $VmView.Snapshot.CurrentSnapshot
    # Make the linked disc specification
    $CloneSpec.Location = new-object Vmware.Vim.VirtualMachineRelocateSpec
    $CloneSpec.Location.Datastore = (get-Datastore-name $Machine.BackupDS). Extensiondata.MoRef
    $CloneSpec.Location.Host = (get-vmhost-name $Machine.BackupHost). Extensiondata.MoRef
    $CloneSpec.Location.Transform = [Vmware.Vim.VirtualMachineRelocateTransformation]: sparse
    $CloneName = "$vm - BU - $date"
    # Create clone
    $vmView.CloneVM ($cloneFolder, $cloneName, $cloneSpec)
    # Write newly created VM to stdout as confirmation
    Get - VM $CloneName
    # Remove snapshot created for clone
    $Snap = get-Snapshot - VM (VM-Get-name $Machine.MasterVM)-name $CloneSnap | Remove-Snapshot - confirm: $False
    #Send full email
    .\endmail.ps1

    I want to use in an environment composed of 3 servers ESXi 4.0 with a local data store each. This works well in my test environment, but not in that productive.

    Here, I get this error:

    Exception, calling 'CloneVM' with '3' or the arguments: "it was not correct to specified parameters.
    Spec.Location.pool ".
    C:\script\vm-backup\backup.ps1:98 char: 18
    + $vmView.CloneVM < < < < ($cloneFolder, $cloneName, $cloneSpec)
    + CategoryInfo: NotSpecified: (:)) [], MethodInvocationException)
    + FullyQualifiedErrorId: DotNetMethodException

    In a comment on his blog, made Simon refers to an error in the data store, but it seems very well here.

    By comparing the values of the characteristics to those of my testbed everything looks good, too.

    Does anyone of you can tell me where to look for the problem?

    Thanks in advance

    Christian

    That's correct, 1 by Server default resource pool.

    You can do

    Get-ResourcePool-name resources-site (Get - VMHost - name MyEsx)

    to get the default pool for a specific ESX Server

    CAB, you add a line in your original script

    $CloneSpec.Location.Pool = (get-ResourcePool-name resources-site (Get - VMHost - name MyEsx)). Extensiondata.MoRef

    This should be the correct MoRef

    The message seems to indicate that the target VM already partially exist.

    Remove it before you run your script once again.

  • How to clone a virtual machine with the drive?

    Hello

    Previously, I used VMware Workstation and has a mastery of "clone". Now I use the reader and I would like to clone my current VM and there is no special orders. Simply copy the directory would probably not there a lot of information such as DNS name, etc. that are likely to be changed. Is it possible to clone a virtual machine with player or do I Workstation?

    Many thanks in advance,

    Nicolas

    In my computer a full clone is nothing more then is not a copy that was made unique in the process and the players of VMware capacity but there is nothing stopping you from manually making a copy and then manually by making the changes to make it unique.

  • Clone virtual machine configuration

    Hello

    I have a requirement to clone a single copy of the configuration of the VM in a datacenter to another data center.

    We essentially use HUR to do a replication of the storage of a domain controller to another. Once replication is complete and has been shared, we climb the target LUN with Signature data warehouses are ' option and the same data store name. With that, most disk mappings is lost in particular on the virtual machines with large number of disks and we eventually remove these drives and do a manual mapping with the same SCSI controller than source VM.

    My requirement is I want to automate this process and for which I need to capture details first source below and then reproduce the same destination VM.

    Source VM

    VMDK path with data store name

    VMDK mapping to each scsi controller.

    The VMDK disk size

    Mappings of RDM

    SCSI controller shares (if any)

    With the above information, I am looking for script map VMDK disks with the same data store name and the same number of SCSI controller to destination.

    If someone could help me, that would be great and I will save a lot of time spent on manual mapping.

    Thanks in advance.

    The following script to retrieve the info you would need for step 1.

    Get - VM | Get-hard drive |

    Select @{N = "VM"; E={$_. Parent.Name}},

    Name,CapacityGB,filename,@{N='Datastore'; E={$_. FileName.Split(']') [0]. TrimStart('[')}},

    @{N = "SCSIid"; E = {"{0} ': {1}" f (& {$script: ctrl = Get-controller SCSI - HDD $_;}) "} $script: ctrl. ExtensionData.BusNumber}), $_. ExtensionData.UnitNumber}},

    @{N = "Shared SCSI"; E = {$script: ctrl.} BusSharingMode}},

    @{N = "RDM"; E = {if($_.) DiskType - match 'Physical') {$_.} ScsiCanonicalName}}}

  • I'm looking for a Script that can list all virtual machines with type of NIC E1000 via the output of the CSV file.

    Hi gurrus and LucD

    I'm looking for a Script that can list all virtual machines with type of NIC E1000 via the output of the CSV file.

    The script should search for information in a multiple Vcenter servers and multiple clusters and list all the VMs name, status (two powers on or off) with type card NETWORK Type E1000 only no other.

    Concerning

    Nauman

    Try like this

    $report = @)

    {foreach ($cluster Get-cluster)

    foreach ($rp in Get-ResourcePool-location $cluster) {}

    foreach ($vm in (Get-VM-location the $rp |)) Where {Get-NetworkAdapter - VM $_______ | where {$_.}} Type - eq "e1000"}})) {}

    $report += $vm. Select @{N = "VM"; E={$_. Name}},

    @{N = 'vCenter'; E={$_. Uid.Split('@') [1]. "Split(':') [0]}},"

    @{N = "Cluster"; E = {$cluster. Name}},

    @{N = "ResourcePool"; E = {$rp. Name}}

    }

    }

    }

    $report | Export Csv C:\temp\report.csv - NoTypeInformation - UseCulture

  • Find vCenter in a virtual machine is

    Hello

    We have 5 vCenters and it can be difficult to find a virtual machine at times. I do a script that connects to each vCenter, so I will try to find a "get - vm" command that will pull the vCenter as the virtual machine is in. But I'm not able to find it. Can someone tell me with PowerCli, how can I get the name of the vCenter a VM is in?

    Thank you

    Scott

    I could find in ExtensionData.Client.ServiceUrl

    Thank you.

  • Cannot create a virtual machine with a vmdk file copied from another location, please find the attached error

    Hi all

    I copied a file from one place vmdk and try to make a new virtual machine with this vmdk file. But when I turn on after the creation of vm error is coming. Error in the text and the image below

    Power on the virtual machine: cannot open scsi0:0 disc: disc not supported or not valid type 7. Ensure that the disk has been imported.

    See the error of the stack for more details on the cause of this problem.

    Time: 31/03/2015-14:40:05

    Target: DBServer

    vCenter Server: vcsa

    Error stack

    An error was received from the ESX host turning on DBServer VM.

    Unable to start the virtual machine.

    Power DevicePowerOn module has failed.

    Unable to create the virtual SCSI device for scsi0:0, ' / vmfs/volumes/543d140b-feb33d52-7640-90b11c9796c3/vmdk/kapuatdb.vmdk'

    Could not open scsi0:0 disc: disc not supported or not valid type 7. Ensure that the disk has been imported.

    This error message generally if the hard files have been copied hosted as VMware Workstation product, which uses a format of sparse file that is not supported on an ESXi host. Instead of the hard copy, you can use VMware Converter, or - if you prefer - you can convert the hard using vmware-vdiskmanager (before transfer) or vmkfstools (after downloading). I deal to use vmkfstools you will need to load the mutliextent module (see for example "Clone or migration operations involving virtual discs non-VMFS on ESXi fail with an error" vSphere 5.1 Release Notes)

    André

  • Create an array of Virtual Machines with an index to allow the selection of the index entry

    I would like to help with the following.

    Using the GET - vm to return all the virtual machines in a table or a table, but with a number of index against each of them. Perhaps even the number of its position in the matrix or $myarray [0]. I am struggling with the best way to go, be it a table to 2 dimensions or an object, but then how do I get the numbers in there.

    The reason for this is to present a list of virtual machines with a number on the side, to which the user then enters the number instead of having to type the name of the virtual machine.

    Ideally resembling:

    vCenter 0

    1 Exchange

    2 FilePrint

    3 SQL

    4 DC

    $vms = $get - vm | Select name

      1. a way to get the number. ##

    $vmsindexed =?

    '' This is the virtual machines to the choice.

    " "

    $vmindexed

    " "

    $selectedNum = read-host "enter the number of the Virtual Machine to power on.

    $selectedVM = $vms [$selectedNum]

    "You have selected Machine virtual $selectedVM.

    " "

    Start-VM - VM $selectedVM

    Thank you in advance, I'm going crazy thinking about it!

    The following script will give you a list of virtual machines with a number on the front, then you can type the number, choose the virtual machine you want to start:

    $VMs = Get-VM
    $VMsArray = @()
    $VMs | ForEach-Object { $VMsArray += $_.Name }
    Write-Output "Here are the virtual machines to choose from"
    Write-Output ""
    For ($i = 0; $i -lt $VMsArray.Length; $i++ ) { Write-Output "$i $($VMsArray[$i])"}
    Write-Output ""
    $SelectedNum = Read-Host "Enter the number of the Virtual Machine to Power On"
    $SelectedVM = $VMsArray[$SelectedNum]
    Write-Output "You have selected Virtual Machine $SelectedVM"
    Write-Output ""
    Start-VM -VM $selectedVM -Confirm
    

    Robert

  • Cloning a virtual machine with 2 hard drives!

    Hi all!

    I ran into a very annoying problem. I'm trying to Migrate/convert virtual machines to a host in the CR. Each virtual machine has 2 hard drives which are located on 2 different data stores. When I try to migrate or to clone virtual machines from the host on my Cluster I get an 'error of operation period.

    After scratching my head for a while, I discovered why. The virtual machine have 2 hard drives on 2 different data stores. Both flat.vmdk files are called eponymous because they are on different data warehouses (TTDC001.vmdk). I created a VM test on the cluster with 2 hard drives and flat.vmdk flies are named TTDC001.vmdk and TTDC001_1.vmdk.

    So my conclusion as to why I get "Opération Timeout Error" is that VC trying Migrate/Clone to the virtual machine but is mistake because his attempts to migrate/Clone 2 hard files with the same name!

    Can someone give me some pointers as to how I can get around this? I am currently copy the file hard 2nd to my deskop from the data store and rename it then copy him on the new cluster data store to see if it works as you cannot rename the file hard in the data store. It just seems long way round to migrate virtual machines with 2 hard drives, and I don't even know if it works!

    Please help!  :|

    Andy Hughes

    Andy of the evening,

    I do it well. Thank you for asking.

    So if I'm reading correctly it seems that you are trying to clone a virtual machine from a stand-alone host to a host that is part of a VMware Cluster. When you do this you get a network midway through the copy error. Is this correct?

    Can you confirm how fast is connected to the Service Console between the two servers? For this kind of work I would recommend making them run at 1000/full, assuming you're not already. Could you also post the entire message that you get when the clone fails.

    Kind regards

    Glen

  • How can I get the version of VMware to virtual machines with powercli officer?

    How can I get the version of VMware View Agent running on a virtual machine with powercli or view Powercli?

    As much as I know there is no cmdlet PowerCLI for this, but you can use the Invoke-VMScript cmdlet and interrogate the Win32_Product class.

    By running the following. You can add a Where clause to return only the Agent of the view

    Get-WmiObject-class Win32_Product | Select the name, Version

Maybe you are looking for