New virtual machine for the model with the specific name

Hello

I'm trying to add some model VM to VAPP using recomposeVApp (...). And it works well except that I can not change the name of the virtual machine while recomposing. It takes the name of the model. But how to add VMS to model with the specific name? I use the v1.0 API.

This is my code:

ReferenceType vmTemplateRef = new ReferenceType();
vmTemplateRef.setName ("MyNewVM"); This name is ignored. The name of the model is taken!
vmTemplateRef.setHref (vmRef.getHref ()); reference to the model

CompositionItemParamType vmItem = new CompositionItemParamType();
vmItem.setSource (vmTemplateRef);

create the type params VAPP recompose.
RecomposeVAppParamsType recomposeVAppParamsType = new RecomposeVAppParamsType();
recomposeVAppParamsType.setName (vAppRef.getName ()); The name of vApp. It is ok.

added the element of the virtual machine.
The newItems < CompositionItemParamType > recomposeVAppParamsType = list
. getItem().
newItems.add (vmItem);

Task task = vapp.recomposeVapp (recomposeVAppParamsType);

Thank you

Hello

For after this code fragment:

vmTemplateRef.setName ("MyNewVM"); This name is ignored. The name of the model is taken!

The model name is ignored because vmTemplateRef is the only reference to the object that will be used for the operation of recomposition. If changing the name it will be always ignored.

I think that changing the name of the virtual machine template for recompose cannot be done as follows:

(1) operation recomposeVApp().

(2) get the recomposed VAPP

(3) download the children-> VM you want to change.

(4) change the name of the virtual computer.

I hope this helps!

Tags: VMware

Similar Questions

  • OsCustomizationSpec and OSCustomizationNicMapping they are a good way to set up the new virtual machine for the model

    I build a script to generate auto magicly VM when I have import information from a csv file. I have the latest PowerCli, I am trying to build servers r2 Sever 2012 model.  I tried several OsCustomizationSpec (OCS) of in the hope of getting something to work, but I had no luck so far.  In VCenter, it shows that it applies the OCS, but is not apear to have an impact on the server.  I have disabled UAC since the last time that I tried it so maybe that will make a difference.  I am under ESXi 5.1 update 2, just to try to give all the necessary information.  Ideally, I'd like Sysprep, the value of intellectual property, change the computer name and join the server to the domain.  That's all! lol I have the book "VMware vSphere PowerCLI Reffernece, automating vSphere Administration, I walked through step by step.  The new version of PowerCli seems not have the x 86 limitation as earlier versions of PowerCli.  I tried so many different things, I'm not sure what to put in place as a starting point.

    # Save the object credentials with permission to join the domain.
    $DomainCredentials = get-Credential "domain\testername."
    # Clone our Spec by adding the domain information.
    $Spec = get-OSCustomizationSpec "Windows Server 2012 R2"
    $Spec += get-OSCustomizationNicMapping - Spec $Spec
    #$Spec | Select *.

    # Get our VM
    # Change network settings
    Get - VM BigServername | Get-NetworkAdapter | Together-NetworkAdapter - NetworkName nic - 172.16.25 - VLAN225 - connected: $true '
    -Confirm: $false | out-null
    # Close the comments to make change.
    Stop-VMGuest - VM $VM - confirm: $false | out-null
    # Wait while feedback stops
    While ($vm. ExtensionData.Runtime.PowerState - not "poweredOff")
    {
    Start-Sleep - seconds 1
    $vm. ExtensionData.UpdateViewData ('Runtime.PowerState')
    }
    # Apply Spec customization to apply the new network settings
    Get - VM "BigServername" |
    Set-VM - OSCustomizationSpec "R2 Windows Server 2012" - confirm: $false |
    Start-VM

    I can rebuild the model, or something else, we must do this work.

    OR - is simply not the best way to configure the VM?  If not, what Sysprep?

    Good news, but first, I would really like to know where the log files are on which server to the OsCustomization process.

    I decided to reverse engineer and create a CSOS within vCeneter and once I got to work, I kept creating new CSO via PowerCli until I could get that to work, create a new virtual machine.  Once I got this to work, I have tryied to apply on a cloned vm, with no parameters. I got it works too.  I tried to go back to my original image, but I couldn't get this to work.  Something's wrong with this picture.  He wrath that the problem was related to the permissions on the local client.

    New OSCustomizationSpec - OrgName company OSType - Windows - ChangeSid-Server "vcenter.dom.com" - name PowerCliOnly4 - persistent administrator-Type FullName - AdminPassword! password123 - zone "Eastern (USA and Canada)" AutoLogonCount - 3 - domain dom dadmin - DomainUsername - DomainPassword! password123 NamingScheme - vm-Description "PowerCli Use only" - confirm: $false

    Get-OSCustomizationNicMapping - OSCustomizationSpec PowerCliOnly4 | Game-OSCustomizationNicMapping - Position 1 - IpMode UseStaticIP - IpAddress 10.10.10.98 - 255.255.255.0 - DefaultGateway 10.10.10.1 Dns subnet - mask "10.10.10.10","10.10.10.11" "-confirm: $false

    This seems to be very picky.  Because the area is one of the parameters, you cannot put it in the DomainUsername, no dom\dadmin. The part that I really want to know how to get more, is what happens if your vm has a different local administrator as the administrator account.  It turns out that FullName - is not the account that it to connect locally with tires. When I created the vCenter Medtronic Chondroitin, I put 'me' in the name and information of the Organization and that's what was settled in the FullName property:

    Name: PowerCliOnlyM
    Type: persistent
    ServerId: /VIServer = dom\[email protected]: 443.
    Server: vcenter.dom.com
    LastUpdate: 24/09/2014 13:33:19
    DomainAdminUsername: dadmin NO dom/dadmin here!
    DomainUsername: dadmin
    Description: PowerCli use only, done manually in vCenter.
    AutoLogonCount: 3
    ChangeSid: true
    DeleteAccounts: false
    DnsServer:
    DnsSuffix:
    Domain: vsi
    Full name: me
    GuiRunOnce:
    NamingPrefix:
    NamingScheme: Vm
    OrgName: CompanyTU
    OSType: Windows
    ProductKey:
    Time zone: (USA and Canada)
    Working Group:
    LicenseMode: NotSpecified
    LicenseMaxConnections:
    EncryptionKey: {-126, 3, 48, 108...}
    ExtensionData: VMware.Vim.CustomizationSpecItem
    ID: PowerCliOnlyM
    UID: /VIServer = vsi\[email protected]: 443/OSCustomizationSpec = PowerCliOnlyM /.
    Client: VMware.VimAutomation.ViCore.Impl.V1.VimClient
    AdminPassword: w
    DomainAdminPassword: N
    DomainPassword: N

    DNS: {10.10.10.10, 10.10.10.11}
    Wins                  :
    SpecId: PowerCliOnlyM
    Spec: PowerCliOnlyM
    SpecType: persistent
    NetworkAdapterMac:
    Position: 1
    IPMode: UseStaticIP
    IP address: 10.10.10.98
    Subnet mask: 255.255.255.0
    DefaultGateway: 10.10.10.1
    AlternateGateway:
    VCApplicationArgument:
    ID: /VIServer = dom\[email protected]: 443/OSCustomizationNicMapping = OSCustomizationNicMappingImpl-PowerCliOnlyM-persistent-1.
    UID: /VIServer = dom\[email protected]: 443/OSCustomizationNicMapping = OSCustomizationNicMappingImpl-PowerCliOnlyM-persistent-1.
    ExtensionData: VMware.Vim.CustomizationAdapterMapping
    Client: VMware.VimAutomation.ViCore.Impl.V1.VimClient
    Version: 1

    I think that it is good to know that the virtual machine reboot 4 or 5 times as it goes through this process.  It breaks is you try and do something for the virtual machine that interrupt the process.  I don't know that I'll think more questions in a second.

    In addition, it cost he had some problems with the put between quotation marks, single or double around the password, but I did not check this again, I just know that once I took them, he began to work.  I ran on other issues while testing as I was using a single IP address, so if I do not disable the test VM, the following would not work because of the conflct network, maybe I shouldn't admit that... lol

  • I can't create a new virtual machine, for the error "invalid state" of vmware

    Hi, I have an esx server with some production virtual machines vmware;

    Yestarday I made a new VM, suse linux, froma cdrom; but the file system broke down, it has been altered, I don't know why,

    and I had to cancel the machine using the "remove disc";

    After that I could read "a system general error occurred" and when I click on create a new virtual machine (ctrl + n), I can't because the answer is "invalid state".

    When I click on each virtual machine in 'events', I do not see the logs, I see this error "system general error occurred.

    can someone help me? , should I restart the service mgmt-vmware?  (init.d) on the host server?

    Thanks in advance, best regards

    Toscano Max

    If you use Virtual Center, rebbot VC server and try again. If this does not work, you may have to restart the ESX host.

  • Create new virtual machine of the model that have two hard drives in the different data store

    We do VM deploy automation with PowerCLI.

    There is already a model created with at least two hard drives to one side and each hard drive belong to difference datastore,

    In the model's operating system is Windows server 2008 R2 already installed VMware Tools and other software in the second (other than C: driver) driver

    We can successfully deploy a new virtual machine with this manually with vSphere client model.

    But when we try to make the deployment with PowerCLI, can not find examples of similar scripts in the document of reference,

    and we also google this question, still no similar question was found.

    Is this possible with PowerCLI? If it's possible could you give me some advice or an example of script, thank you!

    Best regards.

    I already found the solution.

    With the vSphere SDK .NET API, we can create the new virtual machine to the model

    Mainly used API listed below, sorry because I can not give the source code here.

    • VMware.Vim.VirtualMachineCloneSpec
    • VMware.Vim.VirtualMachineRelocateSpec
    • VMware.Vim.ManagedObjectReference
    • VMware.Vim.VirtualMachineRelocateSpecDiskLocator
    • VMware.Vim.ManagedObjectReference
    • CloneVM_Task

    For reference, you can take a look at this post and this post

    LucD , thanks for your help!

  • PowerCLI script - new virtual machine of the model

    Hi all

    I am very new to power CLI scripting, and these days, that I read a lot of help to automate the creation of a new virtual machine based on the model of the virtual machine.  Script that is not that hard, even location new virtual machine on a particular data and in a particular resource pool store is not difficult.  For this I came up with this very basic script/command:

    "New-VM - ResourcePool < resource_pool > - < folder_name > location - Datastore < datastore_name > - name < VM_name > - < template_name >"model

    However, I came across some problems that I can't find information in help or in the forums.  Problem with the above command is VM will be created in the pool of appropriate resources and file as long as they are unique, but if there are multiple instances of resource pool or a folder with the same name as the script spits out a mannequin.

    So for example if I want to create a new virtual machine to the location following Data_Centre = > RootFolder1 = > SubFolder1 = > SubFolder2 and SubFolder2 name is unique that no problem, the virtual machine is created at this location.  However, if the SubFolder2 exists in Data_Centre = > RootFolder2 = > SubFolder1 as well as the virtual machine is created in the folder root of the location of the model.  For example, if the model is in "DC = > Folder1 = > Subfolder1 = > Subfolder2 ' the virtual machine will be created in the folder Folder1

    Any suggestions on how to ensure that the virtual machine is created in the desired folder/location as well as a list of resources?  In my view, there are really smart guys here and I suspect that this issue would not be a problem at all.  Any help would be appreciated.

    See you soon

    It is not a matter of following the right path.

    You can use the location setting to get the exact folder you want. For example

    $dc = get-data center-name DC1

    $folder = get-file-name Folder1-location $dc

    $subfolder = get-file-name Folder2-location $Folder1

    or

    $dc = get-data center-name DC1

    $subfolder = get-file-name Folder2-location $dc

    You will need to find a "place" in the path to your destination folder where it will be unique.

  • A safety class is not found in this JAVA virtual machine for the following reason: sun.security.x509.CertAndKeyGen

    I'm trying to start OUD 11.1.2.2.0 after a new installation on Windows 2008 Server (oud - setup.bat) and I see the following error. Any ideas?

    [18/Apr / 2014:13:34:04-0600] category = gravity CORE = INFORMATION msgID = 132 msg = The Directory Server starts the configuration of the boot process

    [18/Apr / 2014:13:34:05-0600] category = gravity CORE VIEW msgID = 458886 msg = directory = unified Oracle 11.1.2.2.0 (build 20131115153045Z, R1311150604) commissioning

    [18/Apr / 2014:13:34:08-0600] category gravity = RUNTIME_INFORMATION = VIEW msgID = 20381717 msg = installation directory: C:\Oracle\Middleware\Oracle_OUD

    [18/Apr / 2014:13:34:08-0600] category gravity = RUNTIME_INFORMATION = VIEW msgID = 20381719 msg = Instance directory: C:\Oracle\Middleware\asinst_1\OUD

    [18/Apr / 2014:13:34:08-0600] category gravity = RUNTIME_INFORMATION = VIEW msgID = 20381713 msg = Information FMV: 1.8.0_05 - b13 by Oracle Corporation, architecture 32 bits, the size of the heap 652476416 bytes

    [18/Apr / 2014:13:34:08-0600] category gravity = RUNTIME_INFORMATION = VIEW msgID = 20381714 msg = JVM Host: slc00dbh.us.oracle.com, running Windows Server 2008 6.0 x 86, size of 8177541120 bytes of physical memory, the number of available processors 2

    [18/Apr / 2014:13:34:08-0600] category gravity = RUNTIME_INFORMATION = VIEW msgID = 20381715 msg = JVM Arguments: ' - Dorg.opends.server.scriptName = start - ds. "

    Exception in thread "main" java.lang.ExceptionInInitializerError: a safety class is not found in this JAVA virtual machine for the following reason: sun.security.x509.CertAndKeyGen

    to org.opends.server.util.Platform$ PlatformIMPL. < clinit > (Platform.java:132)

    to org.opends.server.util.Platform. < clinit > (Platform.java:85)

    at org.opends.server.util.CertificateManager.generateSelfSignedCertificate(CertificateManager.java:283)

    at org.opends.server.admin.AdministrationConnector.createSelfSignedCertifIfNeeded(AdministrationConnector.java:703)

    at org.opends.server.admin.AdministrationConnector.initializeAdministrationConnector(AdministrationConnector.java:182)

    at org.opends.server.core.ConnectionHandlerConfigManager.initializeAdministrationConnectorConfig(ConnectionHandlerConfigManager.java:356)

    at org.opends.server.core.DirectoryServer.initializeAdministrationConnector(DirectoryServer.java:2872)

    at org.opends.server.core.DirectoryServer.startServer(DirectoryServer.java:1539)

    at org.opends.server.core.DirectoryServer.main(DirectoryServer.java:9930)

    C:\Oracle\Middleware\Oracle_OUD > java-version

    Java version "1.8.0_05".

    Java (TM) SE Runtime Environment (build 1.8.0_05 - b13)

    The Client Java VM (build 25, 5 - b02, mixed mode, sharing)

    I used the following jdk based on the matrix and it worked fine:

    C:\Oracle\Middleware\Oracle_OUD>Java-version

    Java version "1.6.0_24".

    Java (TM) SE Runtime Environment (build 1.6.0_24 - b07)

    The Client Java VM (build 19.1 - b02, mixed mode, sharing)

  • Non supported configuration of virtual machines for the fault tolerance. The operation is not supported on the object. When activating FT

    Hello

    I try to activate FT on a virtual machine that AFAIK ticked all the boxes for FT but I get this message when activating it. No clue as to what might happen or where to connect for extended information? This error message is too generic...

    Thanks in advance mates.

    Did you follow KB1019165-fault tolerant to fails to 42% with the error: not supported configuration of virtual machines for the fault tolerance

    André

  • How to configure the virtual machine for the changes to forget

    Hi, I want to ask if it is possible together in the virtual machine for the changes to forget. For example - user run VM... make some changes in the configuration. Then come a new user has it want to have clear (without changes in the configuration) virtual machine. Is possible together closed the machine after changes lost?

    Sorry for my English.

    Thanks for help.

    Hi Polo939

    First, you will need to take a snapshot of the virtual machine.

    • Select your virtual machine

    • Click on "take a snapshot" on the right-hand side of the web interface

    Then you must configure the virtual machine to go back to the snapshot when it is turned off.

    • Click on "configure the VM.

    • Click the "snapshot".

    • Select "back to overview" under when you feed off option

  • 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.

  • How to build a new virtual machine based on cluster with powercli?

    When you create a new virtual machine on cluster in the user interface, you cannot select the host, it is decided by the cluster.

    Now, I want to create a new vm on cluster by powerCli. I have not found any parameter to specify the cluster.

    Only the "$vmhost" to specify the host.

    Why are they so different?

    Can someone help me understand it and how to create a new VM on cluster?

    Thank you in advance!

    Hello, bob1118-

    While, as you said, it has non - Cluster parameter to the cmdlet New - VM, you _can_ effectively specify the cluster at new time of creation of VM via PowerCLI: you specify the list of resources within the desired cluster.  So a partial New - VM call would look like:

    New-VM -Name myNewVM0 -ResourcePool (Get-Cluster myDestinationCluster | Get-ResourcePool -Name "Resources") -Template ...
    

    Who uses the resource pool default "Resources" that exists in a cluster.  And, you could fill in the rest of the parameters relevant to the new virtual machine of your desires.  How do I?

  • deploy a virtual machine for the model stored in EXSI server via the command line

    Hello

    Is it possible to deploy a vm from a template stored in exsi server via the command line?

    The structure is shown in the attached picture. I want to deploy the model under "Templates" folder to a virtual machine "VM" sub-folder by command line of any machine.

    structure.jpg

    Hello

    PowerCLI can help you achieve this goal. Using PowerCLI, you can deploy remote host model.

    Here is an example for the same.

    http://www.harryjohn.org/deploy-multiple-VMs-from-template/

  • Create the new virtual machine for Small Business Server 2008

    Hello

    When creating a new Machine virtual and choose the guest operating system, the "Small Business Server 2008" are not listed. Just choose "Microsoft Windows Server 2008 (64-bit)"?

    Thank you

    John

    Yes, it will work, and it is supported guest OS

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

    Edit: There is a bug in the user interface for the VIC, where probably 2008 will be displayed as Vista under the toolbar of guest operating system.

  • How to make Virtual Machines for the username or profile?

    We have a laboratory of about 25 computers and a Dell 8925 Blade Server in the back running Esxi 5.0. I installed on each workstation client vSphere and have implemented several usernames for students. Everyone can connect to client vSphere very well of their workstations. The question I have is that if a user creates a virtual, any computer user who connects the vSphere client can see, navigate and edit this VM. I'm looking for a way to make the profile of the specific virtual machine, so that users can only see and access the virtual machines that they have created. Is this possible with the vSphere Hypervisor or should I buy a different package?

    My mistake, I was thinking about a licensed copy of vSphere with vCenter. In your case, the permissions must be set on the individual virtual machines.

    Click a virtual machine > permissions tab > add users

    If you want to use Active Directory authentication rather than accounts of the local host, you can go to

    Click Home > Configuration > Authentication Services

    And establish a relationship with your domain. You can then apply ad users/groups to the VM permissions.

    See you soon

  • How to add a new virtual machine to the ESX host using the existing files?

    I need to implement a function clone without the use of cloneVM_task. I copied (a special copy) a set existing VM Directory Active Directory to a new directory and renamed copied all files prefix name of the new direcotry.  What task VM (reconfigVM_task, createVM_task or registerVM_task) command can I use to add that the new copied VM on the ESX host? I need to manually update the .vmx for new UUID file and other parameters?

    Thanks for any help.

    I think that as long as you have updated all the names to reflect the new clone you must be fine and on the first step, you will be prompted with a question.

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

    William Lam

    VMware vExpert 2009

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

    http://Twitter.com/lamw

  • Cannot download the files of the virtual machine for the data store

    Hello

    I get an error message "connection to the server timed out" while I'm trying to download the files from the virtual computer from the data store.

    Although the ESX and my laptop are on the same network, I get this error message.

    Please let me know if I need to take care of something.

    Thank you.

    I think that hard & .vsmp be used & locked is why you are unable to download it. Try to download the file, whereas the VMs system is turned off

    vcbMC - 1.0.6 Beta

    Lite vcbMC - 1.0.7

    http://www.no-x.org

Maybe you are looking for