Create the new virtual machine using Java API vCloud

Hi guys,.

I am trying to create the new virtual machine in TIME, but I've stuck here. The API I'm using is vcloud-java-sdk - 1.0.jar.

Could you please show me a code snippet how to do this?

For now I do it like this:

RecomposeVAppParamsType recomposeVAppParamsType = new RecomposeVAppParamsType();

List the items < CompositionItemParamType > = recomposeVAppParamsType.getItem ();
ReferenceType vappTemplateVMRef = new ReferenceType();

// ??? seems that new reference to the new virtual machine should be here. But how to create this VM
CompositionItemParamType compositionItemParamType = new CompositionItemParamType();
compositionItemParamType.setSource (vappTemplateVMRef);

Items.Add (compositionItemParamType);
ReferenceType vAppRef is Vdc.getVdcByReference (vcloudClient, vdcRef) .getVappRefByName ("vApp_Websrv");.

Vapp.getVappByReference (vcloudClient, vAppRef) .recomposeVapp (recomposeVAppParamsType);

One day before I played with Web Services SDK, which is much easier to understand. I was able to create the vApp and VMs in vSphere. Is it possible to import machines virtual vSphere to vCloud? Should what API I use for this?

Thank you

Hello

You cannot add a new empty virtual machine in a paralytic.

Instead, you can add a virtual machine from an existing vapp, vapptemplate.

To import a vsphere vm to vcloud.

Import vsphere vm as VAPP in vcloud. VMWVimserver-> importVmAsVApp()

The importation of vsphere vm, as vAppTemplate, in vcloud. VMWVimserver-> importVmAsVAppTemplate()

See also the example of ImportVmAsvAppTemplate.java, which is part of the vcloudjavasdk group.

Kind regards

Rajesh Kamal.

Tags: VMware

Similar Questions

  • How to specify the file of virtual hard disk when you create a new virtual machine using virtual hard disk on the data store?

    I'm new to PowerCLI and find quite simple, but in the documentation I read, I don't see how to use a virtual hard drive, existing on a data store when you create a new virtual machine.

    Is this simple registration on the virtual hard disk, or did I miss something?

    My current create VM is the following statement:

    New-VM

    -Name $TargetHostName -host $TargetVMCenterHost -data store $TargetVMCenterDatastore DiskMB - 20000 -MemoryMB $TargetHostMemoryMB -NumCPU $TargetHostCPUs -ID $TargetHostOS -CD -Description $TargetHostName

    Didn't notice this before, but I think that vSphere will use a backslash instead of a slash in the paths.

  • Syntax to create a new virtual machine using vCLI

    I use few of ESX 3.5 servers and a server vCenter 2.5 in my lab. I installed vCLI in vCenter server. I would like to know the command to create a new virtual machine through the vCLI. Use of the below details to provide the syntax / command.

    • Name of VM - windows2003
    • CPU - 2
    • Memory - 2096 MB
    • Name of ESX - esxserver1
    • Storage - disk 30 GB C and 40 GB D drive (these two must be placed in a storage centralized. i.e., data store name is - "filer1.lun123"

    Expecting more details.

    Thank you

    Ganesh

    VCLI orders are mainly used for configurations of the host, although as part of the installation of vCLI, you get also vSphere SDK for utilities Perl - http://www.vmware.com/support/developer/viperltoolkit/viperl41/doc/vsperl_util_index.html that provide additional canned scripts, which allows you to create a single set of virtual machines using the vmcreate.pl script. There is an example on how to use a script

  • HDD USB not recognized as "physical1" when creating the new virtual machine

    Hi all

    I wanted to create a new virtual machine, and I wanted to use my USB as a physical drive.

    But Workstation shows me "physical0" which is of course my drive internal.

    I tried USB pen drives. They are not recognized either.

    This somehow is no longer supported? I would have that it would be possible to use USB external HDD as the physical drive to a new virtual machine.

    you have installed VirtualBox?

    If so, you can try to use the virtuaklbox command line tool to create a descriptor of rawdisk for this disc.

    say diskpart on this drive? -It is "online"?

    _________________________

    VMX-settings- WS FAQ -[MOAcd | http://sanbarrow.com/moa241.html]- VMDK-manual

    You find me also in the PhD Virtual Backup support team

  • create the new virtual machine, access to a physical disk

    I just created a new virtual machine. Then, I deleted the preconfigured disk and added a physical disk. This drive is connected to my computer with an S - ATA to USB docking station. The wizard displays all of the data, were leaving and so on correctly. But when I try to turn on the virtual machine, it tells me that it cannot access the drive.

    What I am doing wrong?

    I use Windows 7 64-bit with VMware Player 3.

    http://communities.VMware.com/docs/doc-10455

    ___________________________________

    VMX-settings- WS FAQ -[MOAcd | http://sanbarrow.com/moa241.html]- VMDK-manual

  • Error during communication with the remote host when you create the new virtual machine

    I'm under 7 ESX servers on IBM Blade H22 there is a mistake to invite while I create a new virtual machine

    on the vcenter Server

    At the end of 30-35 minutes, it gives an error

    "Error during communication with the remote host"

    The existing machines are working well... I tried to create virtual machines to other ESX servers as well

    but the same question. I also tried to make the clone of existing machines, but without success

    Can anyone help?

    You rescan the LUNS once?

    You've restarted the management agent?

    You've restarted the vpxa?

    If this isn't the case, please perform the step above and check out them.

  • 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 create the new virtual machine vm existing in the data store on ESXI

    I have ESXi and couple of virtual machines.

    I have the vsphere client on Windows 7.

    I then deploy the ovf from the vsphere client vm and it began to import my VM 30 GB.

    In the morning, I realized my vm with a vmdk file file has been transferred in the data store

    But I couldn't see any virtual computer.

    Now I don't know how to turn on this vmdk file that is in my data store

    @King_Robert

    It's a very bad habit of yours to just copy and paste content created by someone else, without even mentioning the source (http://www.mustbegeek.com/create-copy-of-existing-virtual-machine-in-esxi-server/)

    André

  • 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 a new virtual machine with the default settings?

    I was wondering if there was a way to create a new virtual machine with the default settings.

    For example, let's say I want all new Lion VM to have 2 CPU cores. Is there a way to set this automatically? There are other parameters I want a new machine to inherit automatically, I was wondering if there is an automatic way to do this, or is it a feature request...

    Thanks in advance

    lerker wrote:

    Just for my clarification, when you say a vm model, basically I would execute a finder copy then drag back to the VM library, right?

    Yes.

    On the orders of spcirpting, it would be unix commands or are there specific vmware controls that make your job easier (in Applications/VMware\ Fusion/content or elsewhere)...

    IIRC, VMware Fusion 3 and later versions has an AppleScript dictionary, but it is not yet officially supported and may not be able to do what you want so, basically, only Unix Shell scripts, that's what I was referring to.  For an example, see my script attached to the following response: Re: vmware - script of the creation of the vm and the operating system installation process

  • 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

  • Upgrade to ESXi 5.0 to 5.1 - No Hardware 9 option available when creating a new virtual machine

    Greetings,

    I improved my esxi U1 5.0 to 5.1 and attempted to create a new virtual machine in hopes of using the new version of material 9.

    Using the standard and Custom options I been unable to create a Version 9 hardware VM by default.

    The only option I had was manually upgrade to version 9 once the virtual machine was created.

    Any thought or is - this as planned? I need to reinstall from scratch, my host?

    dhayashi

    To create virtual machines with HW version 9, you can use the Web Client, rather than the windows based Client vSphere.

    André

  • Suggestion on Vcenter DB migration on the new virtual machine and enhancement vcenter server

    Hello

    I'm looking for any suggestion/plan with Vcenter DB migration steps towards the new virtual machine, and then upgrade the server vcenter

    4.1 for Update1/2

    My plan will be

    (1) creating new virtual machine.

    (2) fresh install 64-bit OS

    (3) migration Vcenter DB of the physical server to the new virtual machine.

    (4) upgrade to Vcenter Server 4.1 update 41 4.1 Update1/2

    Anything else missing then please let me know.

    Thank you

    vmguy

    Hi vmguy

    I agree with this approach

    (3) migration Vcenter DB of the physical server to the new virtual machine.

    As long as you leave the old DB in tact and simply detach and copy the DB to the new Victoria Cross.

    Before you run the upgrade on the new VC and DB.

    This way, you have a restoration plan in case something goes wrong with the upgrade.

    Just to add:

    You must migrate the ADAM database so to maintain the specified permissions vCenter

    See: Migrateing vCenter new host

    Please allow points if you find this useful/correct

  • You can create a new virtual machine snapshot from another machine?

    Hi all!  I was wondering - is it possible to create a new virtual machine with an existing snapshot of a running virtual machine?  Or should I essentially clone the machine to a new virtual machine and then go back to the snapshot I want?

    I use ESX Server 3.5 with a Lefthand SAN - and was curious to know if there may be either a separate utility, I can run or if the VI Client contains all the tools I would need?

    Thank you all for your time!

    Good question, I know you can do this with VMware Workstation:

    1 VM > overview > Snapshot Manager

    2. Select the snapshot > Clone

    However, for VMware ESX, I think you should use vmkfstools to the service console.

    Basically, you have already created a snapshot and just need to copy the vmdk files, create a new virtual machine and attach an existing drive. I think that's what you're looking for: cloning a Virtual Machine running using the Console Service

  • VMware workstation, crashes when I try to create a new virtual machine

    Hello

    I never had this problem before, but I didn't create a new virtual machine in a very long time. Last time I created one was making Workstation 9 I think. Some time after the upgrade to Workstation 10 or 8.1 of Windows Update 1 it has started.

    In 10 Workstation running on Windows 8.1, I select the file > new Virtual Machine dialog coming upwards and in a few seconds crashes of VMware workstation and closes.

    So I checked the Windows event logs and find

    Warning "VMware Workstation to function properly, must be reinstalled after the upgrade to Windows."

    So, I upgraded from 10.0.2 to 10.0.3 and it uninstalled and reinstalled but I still get this warning.

    Followed by an error

    ***

    Journal name:Application
    Source:Application error
    Date:15/08/2014 23:33:53
    Event ID:1000

    Task category: (100)

    Level:Error
    Keywords:Classic
    User:N/A
    Computer:P7Win8MC

    Description:

    Name of the failing application: vmware.exe, version: 10.0.3.48389, time stamp: 0x539a4fb0

    Name of the failed module: MSVCR90.dll, version: 9.0.30729.8387, time stamp: 0x51ea24a5

    Exception code: 0xc0000005

    Offset: 0x0003bece

    ID of the process failed: 0 x 1788

    Start time of application vulnerabilities: 0x01cfb902de541c11

    The failing application path: C:\Program Files (x 86) \VMware\VMware Workstation\vmware.exe

    Path of the failing module: C:\WINDOWS\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_5094ca96bcb6b2bb\MSVCR90.dll

    Report ID: 24d5effb-24f6-11e4-bedd-20cf30780548

    ***

    So I need help to track down what I am not sure what VMware paper to look to maybe see what is happening.

    Thank you

    Rainey

    Well, I found the problem.

    I looked in the UNK file and found a few ISO files wrongs tracks.

    I had mounted some ISO in the past and they have made the entry in this file of preferences such as "isoLocationMRUx".

    I'd change the leter this ISO file player so they could not be found as input, once I corrected the paths I can now create a new virtual machine.

    He is responsible for ion BONE the new virtual machine now.

Maybe you are looking for