How to get the moref vCenter for a virtual machine

I use with the vCloud orchestrator plugin.  I would like to understand how I can access the moref for a virtual machine identifier (as see vcenter) that is contained in a vCloud VAPP.

Thank you

Here is something I wrote to do. It uses the query service.

Note that to be able to do, you need your plugin vCD to be connected to the org of system and use the administrator credentials.

var vcdHost = vm.getHost();
var vApp = vm.parent;

var vms = new Array();
var queryService = vcdHost.getQueryService();

expression = new VclExpression(VclQueryAdminVMField.CONTAINER, vApp.getReference().href, VclExpressionType.EQUALS);
filter = new VclFilter(expression);
params = new VclQueryParams();
params.setFilter(filter);

var resultSet = queryService.queryRecords(VclQueryRecordType.ADMINVM, params);
while (resultSet != null) {
    var records = resultSet.getRecords(new VclQueryResultAdminVMRecord());
    System.log(records.length + " VM records found");
    for each (var record in records) {
        if (record.name == vm.name) {
            return record.moref;
            }

    }
    resultSet = resultSet.getNextPage();
}
return null;

Christophe.

Tags: VMware

Similar Questions

  • How to get the Mac address of a virtual machine?

    Hello world...

    I need help to get the MAC address of a virtual computer, I'm stuck in it.

    Please reply if anyone know solutions.

    Thank you

    Mahesh Thawari

    Here's a vSphere SDK for Perl script that extracts the MAC addresses for all your virtual machines - http://communities.vmware.com/docs/DOC-10490

    You should be able to take it and translate it into any language vSphere SDK you plan to use. Basically you'll be listing through virtual hardware for the virtual machine to search for devices of type VirtualEthernetCard and then retrieve the MAC address of each device.

  • How to get the code produced for my Windows XP disc if I have the drive?

    Acquisition of Product Code Windows XP

    How to get the code produced for my Windows XP disc if I have the drive?  I signed the BONE when I bought it all first, but have no way of knowing if this is the way to receive a copy of the product key.

    Here are some utilities, which will display your product keys:

    Belarc Advisor: http://www.belarc.com/free_download.html
    (He did a good job of providing a wealth of information.
    However may not detect a key to office, then try one of the other two below)

    Also: http://www.nirsoft.net/utils/product_cd_key_viewer.html
    and: http://www.magicaljellybean.com/keyfinder.shtml

    Paid (free demo is available): Recover Keys: http://recover-keys.com/
    "quickly scans your system for more than 3000 + software '.
    and produces a list of software activation keys.

    13 keyfinder programs:
    http://pcsupport.about.com/od/productkeysactivation/TP/topkeyfinder.htm

    J W Stuart: http://www.pagestart.com

  • How to get the device model, for example app works on PlayBoook or BlackBerry 10?

    How to get the device model, for example app works on PlayBoook or BlackBerry 10?

    You can use this class: http://goo.gl/GtMLP for information on devices

    something like this:

    String myDeviceModel = android.os.Build.MODEL;
    String myDeviceBrand = android.os.Build.BRAND;
    String myDeviceDevice = android.os.Build.DEVICE;
    
  • How to set the vlan native on a virtual machine in vSphere when you use the 1000V?

    Using the General switch original vSphere, we put VLAN native by VM by setting the VLAN 0 d.

    How do we set VLAN native for a virtual machine, if the virtual computer is connected to a 1000V? I heard that is over, we can use VLAN ID 0?

    Same way as you would on any Cisco switch.

    Add this command to your profile of uplink port:

    switchport trunk vlan native X

    Keep in mind there is no VLAN 0.  VLAN '0' is just how vmware means the VLAN untagged.  There are valid in accordance with the standard 1-4095.

    Kind regards

    Robert

  • Satellite L500-154 - how to get the software packaged for Win7

    How can I get the software "Bundled" for Win 7, I will install Win 7 full (no updates), in the moment is runing Vista on the laptop

    As far as I know, you can't have Win7 recovery media. Laptops ship with Vista can update only.

  • How to get the new update for the help and support

    OT:how to get the new update of the abd support help

    How to get help and support update

    Hello rickstemberger,

    Please click the number of the KB article for more information on how to add Windows Vista Help files.
    KB Article ID: 917607 -I can not open Help files that require the Windows Help program (WinHlp32.exe)

    Microsoft stopped including the 32-bit help files viewer in versions of Windows starting with Windows Vista and Windows Server 2008.
    However, with article 917607, you can download the appropriate version of the Windows Help program (WinHlp32.exe) and add them
    the operating system.

    Sincerely,

    Marilyn
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • How to get the latest fix for CPU

    Hi gurus,

    Hello.


    How to get the latest information from CPU fix for our system EBS 11i, how to get alerts whenever they have released patches of CPU.

    Hi DBA.

    Please check this, hope this helps.

    See the metaink notes:

    Releases of Oracle E-Business Suite 11i and 12 Critical Patch Update knowledge Document (October 2010) [ID 987438.1]

    Information OCT - 2010 CPU patches:

    http://www.Oracle.com/technetwork/topics/security/cpuoct2010-175626.html

    on the paths of the CPU:

    http://www.Oracle.com/technetwork/topics/security/alerts-086861.html

    For the email subscription:

    http://www.Oracle.com/technetwork/topics/security/securityemail-090378.html

    Published by: Amigo on December 22, 2010 07:26

    Published by: Amigo on December 22, 2010 07:29

  • How to get the free license for VMware vSphere Hypervisor 5?

    Please show me the link where I can get the free license for VMware vSphere key 5?

    Connect the link with the register username and password below.

    https://www.VMware.com/tryvmware/index.php?p=free-esxi5&LP=default

    Click on licenses and download tab... you will see the license key.

  • How to activate the Clipboard sharing for shared virtual computers?

    Hi guys.

    Important note: this is VMWare Workstation.

    When I share a virtual machine in order to other guys in the network can control it, I lose the following capabilities:

    * the Clipboard sharing via VMWare tools

    * file drag and drop via VMWare tools

    * possibility of mounting isos of MY system from LOCAL FILES on the virtual computer DVD drives

    Someone knows how to re - activate these features?

    Many thanks in advance.

    You obviously not bothered to read the documentation! Here are some excerpts, referring to shared virtual machines...

    NOTE You cannot change to a shared virtual machine or remote model mode.

    Configure updates of specific for a Virtual Machine VMware tools...

    Use the VMware Tools default update behavior. The default behavior is defined in the preferences of the workstation.

    NOTE You cannot configure this option for a shared virtual machine or remotely.

    NOTE You can enable or disable drag - move to a shared virtual machine or remotely.

    NOTE You cannot enable or disable copy and paste functionality to a shared virtual machine or remotely.

    NOTE You cannot enable a shared folder to a shared virtual machine or remotely.

    NOTE You cannot map a virtual hard disk to a shared virtual machine or remote.

    NOTE You cannot add a printer to a shared virtual machine or remotely.

    NOTE You cannot configure a virtual machine shared or remote to display all USB input devices.

    Take or return to a snapshot at Power Off

    Take a new snapshot

    NOTE You cannot configure this option for a shared virtual machine or remotely.

    Configure power and control power settings Options

    3. Select a power option.

    NOTE You cannot configure these options for a shared virtual computer or remotely.

    6. Select the setting for the start control.

    NOTE You cannot configure startup for a shared virtual machine or remote control settings.

    NOTE You cannot configure a shared or remote virtual machine as a VNC server.

    NOTE use Workstation 10, you can change the hardware compatibility of a shared virtual computer or remotely. However, you cannot in low grade a virtual machine created previously.

    NOTE This command is not available for shared virtual computers, or remotely.

    Clean a VHD on Windows hosts

    Unlike the command to defragment and the shrink command provided by VMware Tools, clean it from the order of discs requires no any additional disk space on the host computer. Clean the disks command works directly on the files of virtual disk (hard).

    NOTE This command is not available for shared virtual computers, or remotely.

    Add a USB controller to a virtual machine

    NOTE shared and remote virtual machines are created without a default USB controller. You can add a USB controller manually when you have finished creating a shared virtual machine or remotely.

    4. set the USB connection settings.

    NOTE You can not usually set up USB connection to a shared virtual machine or remote settings.

    NOTE You cannot add a physical drive to a shared virtual machine or remotely.

    NOTE You cannot add a generic SCSI device to a shared virtual machine or remotely.

    NOTE You cannot configure the virtual keyboard improved to a shared virtual machine or remote setting.

    NOTE You cannot configure advanced settings of the virtual adapter to a shared or remote virtual machine.

  • How to list the security settings for distributed virtual switches and distributed virtual exchanges

    Is there a .pl can I use to list the security settings for distributed virtual switches and distributed virtual exchanges?

    parameters such as

    Mode promiscuity (license /reject)

    Mac address changes (license /reject)

    Allows the transmission of forged (permitted /reject)

    Thank you

    Fred

    Take a look at this article from blog for the script and details - http://www.virtuallyghetto.com/2011/12/retrieving-information-from-distributed.html

  • Disable the clichés for individual virtual machines?

    Hi all

    Is it possible to disable support for snapshot for individual virtual machines, perhaps via a parameter for it?  Or is the closest answer you to put all its virtual disks in independent mode?  Try to see how to better meet the requirements that certain suppliers impose that the VM/device does not catch instant and thought that the best solution is to disable the feature for the specific VM (s) only.  Thank you!

    You can watch the snapshot.maxSnapshots configuration setting. See KB 1031280 for more information.

  • 'Disable the alarm action' for a virtual machine

    Hello

    I want to disable all actions for a virtual machine alarm, while I have to disable FT to clone a virtual machine. My script are ready for cloning but I have a solution to disable the actions of alarm for a virtual machine via PowerCLI to can´t. Someone knows a solution for PowerCLI 5.1R1?

    Thank you

    Michael

    -Entity parameter requires an inventory of PowerCLI as value object and does not have the names. You can try it like this:

    Get-AlarmActionState-entity (Get-VM-name VMTEST1) - Recurse: $false

  • How to connect the physical monitor in a virtual machine?

    I connected a monitor of my laptop, I want to use this screen for my virtual machine running Windows 7, so the virtual machine runs in fullscreen display them on the monitor and not on my laptop. Is this possible? I'm using Vmware workstation.

    WS = Vmware Workstation

    Your laptop must be supported using the second monitor as an extension on the desktop, only not in mirror as it does now. This is done from your video settings, has nothing to do with VMWare.

    Go into your video settings and see if the monitor shows up as Monitor #2, then look for a setting to put it right (or left) of your laptop monitor. My Thinkpad supports this mode.

    Check with the manufacturer of your laptop if necessary. Lou

  • How to get the right drivers for ati mobility radeon graphics card 9200 after updating to windows 7

    I bought a laptop computer, an HP Compaq nx7010.  This has been upgraded to windows 7, but the graphics are bad.  There is a sticker on the unit: Graphics by ATI Mobility Radeon 9200

    How can I get the correct driver to get corrected the desktop resolution? Everything is tense or too big.

    Driver update tools keep telling me this is an adapter to graphics standard VGA etc and if I try to update the adapter it device manager says that they are up to date.

    It's frustrating

    Hello:

    I think that Erico post driver will work, but it cannot simply install by running.

    Download it and run it.  If IT errors out or is not installed, then this:

    Go to Device Manager and click on the VGA Standard controller.

    Then click on the driver tab, click on set to update driver.  Select the 'Browse my computer for software' and navigate to the installation folder that was created when you ran the driver.

    This file will be located in C:\SWSetup\sp30204.  Make sure that the include subfolders is selected and I hope that the driver will be installed.  If this isn't the case, you are unfortunately out of luck.

    The video card in your laptop (Mobility Radeon 9200) is not Direct X 9 capable it is why it does not work.  In other words, it is not windows vista or windows 7 capable.

    If you are able to get the driver to install to be able to change your resolution, which is the best you can do.

    You don't have Aero with this adapter - never.

    Whenever someone plans to upgrade a PC older than one made in 2006, it is essential for them to run the free Windows 7 Upgrade Advisor to avoid disappointment.

    http://Windows.Microsoft.com/en-us/Windows/downloads/Upgrade-Advisor

    Paul

Maybe you are looking for