Failed to retrieve more than 100 virtual machines by using the method PropertyCollector and WaitForUpdatesEx

With vSphere SDK for .NET. Sorry, could not find a forum .NET for vSphere SDK, but the Java forum should be close enough.

I have problems of retrieval of a list of virtual machines from a Pool of resources. More precisely, if there are more than 100 mV (104 in my case) in the folder or the Pool of resources returned UpdateSet can have 100 items in there.

The offending code is the following:

UpdateSet uSet = pc. WaitForUpdatesEx (string. Empty, new WaitOptions() {MaxWaitSeconds = 0});
Console.Writeline (uSet.FilterSet [0].) ObjectSet.Count); will always contain no more than 100 items

It seems to be a difficult cut off the coast of 100 items.
WaitOptions of WaitForUpdatesEx contains a property of MaxObjectUpdates of literature

"The maximum number of entries in ObjectUpdate which must be returned in a single result of WaitForUpdatesEx. See truncated

An undefined value indicates that there is no maximum. In this case political PropertyCollector can still limit the number of objects that appear in a UpdateSet. »

But what is the policy of 'PropertyCollector' that it is? I've been trawling the web and will find absolutely no mention of this in all others in the documentation.

I also tried to put right in a a MaxObjectUpdates = 150 just to see what would happen. Yet once only 100 items returned.

For reference, here's a more complete article of the code:

EntityViewBase folderMngObj = GetVsphereVmFolderManagedObjectRefId (vClient, vSpherefolderName);

If (folderMngObj! = null)
     {
ManagedObjectReference svcRef = new ManagedObjectReference() {Type = 'ServiceInstance', Value = 'ServiceInstance'};
SrvInst ServiceInstance = new ServiceInstance (vClient, svcRef);

ServiceContent sContent = srvInst.RetrieveServiceContent ();
ViewManager viewManager = new ViewManager (vClient, sContent.ViewManager);
PropertyCollector pc = new PropertyCollector (vClient, sContent.PropertyCollector);

ManagedObjectReference cvMngObjRef = viewManager.CreateContainerView (folderMngObj.MoRef, new String() {"VirtualMachine"}, false);
ContainerView cv = new ContainerView (vClient, cvMngObjRef);
PropertySpecList list < PropertySpec > = gcnew List < PropertySpec > ();

foreach (string propertyPath in vmPropertyPaths)
          {
PropertySpec propSpec = new PropertySpec();
propSpec.PathSet = new String() {propertyPath ;} }
propSpec.Type = 'VirtualMachine';
propertySpecList.Add (propSpec);
          }

PropertySpec [] propertySpecs = propertySpecList.ToArray ();
PropertyFilterSpec pfs = new PropertyFilterSpec();
          pfs. ObjectSet = new ObjectSpec [] {CreateObjSpec (cv)};
          pfs. PropSet = propertySpecs;

/ / Create a property with partialUpdate is true
PropertyFilter pf = new PropertyFilter (vClient, pc. CreateFilter (pfs, true));

/ / Wait that initial udpate with the version string empty
UpdateSet uSet = pc. WaitForUpdatesEx (string. Vacuum, new WaitOptions() {MaxWaitSeconds = 0})

/ / Here uSet.FilterSet [0]. ObjectSet will always contain not more than 100 items

viewTable = OutputDataset (uSet);
          pf. DestroyPropertyFilter();
}

Any help would be appreciated.

What is the value of the indicator "truncated" in the returned UpdateSet?

http://www.VMware.com/support/developer/VC-SDK/visdk41pubs/ApiReference/vmodl.query.PropertyCollector.UpdateSet.html#truncated

If set to true, you must call waitForUpdatesEx (with the version of the UpdateSet) back to get the rest updates.

Tags: VMware

Similar Questions

  • Create the virtual machine by using the file PowerCLI and csv

    I know there is a lot of info out there on this and I think I have a working script prety good.  Much was borrowed from this thread, http://communities.vmware.com/thread/315193 many thanks to LucD.

    My code is as follows:

    # Deploy virtual machines from CSV file
    # Much borrowed from http://communities.VMware.com/thread/315193?start=15 & tstart = 0


    # CSV import file
    Import-Csv "C:\guests.csv" - UseCulture | %{
    # Gets the customization information to configure the static NETWORK card and assign the static IP address
    Get-OSCustomizationSpec $_. Customization | Get-OSCustomizationNicMapping | `
    Game-OSCustomizationNicMapping - UseStaticIP - IpAddress IpMode $_. ""IP address""
    -Subnet mask $_. Subnet - DefaultGateway $_. Gateway - Dns $_. DNS
    $vm = New-VM-Name $_. "" Server name "-model $_. Model-host $_. ' "The ESX host" '
    -Datastore $_. Data store - OSCustomizationSpec $_. Customization"
    -Confirm: $false - RunAsync
    ## .......
    }

    He's going to cross and clone the virtual machine, and looks like he's running of the OSCustomizaitonSpec then it bombards.  It cleans bad VM.  Recent tasks shows "failed virtual machine clone that a specified parapeter was not correct." hostname ".

    The problem is that I don't mean to set a hostname with the OSCustomixationSpec, I try only to IP address info.

    I'm runningn PowerCLI 5.0.1 build 581491

    My ESXi host is 5.0.0 build 914586

    My vCenter Server is Ver 5.0.0 build 623373

    I opened a new thread, because the age of the old thread.  Not sure if this is the best way to do things.

    A very simple and intuitive brake system :-)

    ## Deploy VMs from CSV File
    ## Much borrowed from http://communities.vmware.com/thread/315193?start=15&tstart=0  
    
    $maxJobs = 3 $currentJobs = 0
    ## Imports CSV file
    Import-Csv "C:\temp\TestDeploy1" -UseCulture | %{
    ## Gets Customization info to set NIC to Static and assign static IP address
        Get-OSCustomizationSpec $_.Customization | Get-OSCustomizationNicMapping | ` ## Sets the Static IP info
        Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $_."IP Address" `        -SubnetMask $_.Subnet -DefaultGateway $_.Gateway -Dns $_.DNS## Sets the name of the VMs OS
        $cust = Get-OSCustomizationSpec -Name Test    Set-OSCustomizationSpec -OSCustomizationSpec $cust -NamingScheme Fixed -NamingPrefix $_.VMName## Creates the New VM from the template
        $vm=New-VM -Name $_."Server Name" -Template $_.Template -Host $_."Esx Host" `        -Datastore $_.Datastore -OSCustomizationSpec $_.Customization `        -Confirm:$false -RunAsync
    
        $currentJobs = Get-Job -State Running | Measure-Object | Select -ExpandProperty Count    while($currentJobs -ge $maxJobs){
          sleep 30      $currentJobs = Get-Job -State Running | Measure-Object | Select -ExpandProperty Count    }
    ## .......
    }
    

    You can be more selective about the current jobs. For example, you can check if the name of the job shows that they are actually cloning jobs.

  • AutoStart, more than one virtual machine in Fusion?

    Hello

    Is it possible to autostart more than one virtual machine at startup of mergers?

    If so - how?

    If I press the star on a virtual machine, it will away from each other.

    Sincerely,

    DB

    No, only one favorite is both allowed but prevents you from scripts at startup of several Virtual Machines.  It could be a simple bash script or you can use AppleScript or Automator to achieve this.  If you what them to count when you connect, you can then add to your login under your account items in system preferences.

  • Get the name of the cluster which is on a virtual machine by using the virtual machine name

    Hello

    I wrote a code to get the various bits of information about our machines virtual for use in the capacity planning, we have 5 virtual centers, each has at least two clusters.

    My code already gets a handle to the virtual computer object (using the code snippet below) I can get the hostname.  Is there anyway to determine which cluster this host resides on, for example, is there a property of the virtual computer object that can be used to get this info?

    Public Sub connectVC()

    {

    string URI = " " https:// "+ Server +" / sdk "; "

    customer. Connect (Uri);

    customer. Login (username, password);

    }

    Public Sub get_vms()

    {

    NameValueCollection filter = new NameValueCollection();

    filter. Add ("name", "^ wks");

    IList & lt; EntityViewBase & gt; vmList = customer. FindEntityViews (typeof (VirtualMachine), null, filter, null);

    foreach (VirtualMachine vm in vmList)

    {

    "Do things

    }

    Thank you

    Mick

    Take a look at this Perl script that gets what you are looking for, you may need to translate this into another language if you are not using Perl bindings: whichClusterIsMyVMIn.pl - Find that your VM clustered belongs (requires a vCenter)

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

    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

    http://Twitter.com/lamw

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

  • More than a Virtual Machine on vSwitch\Virtual Machine Network will be NOTconnect

    I have a problem when I start more than one guest on a single vSwitch will connect to the network.

    I have a DELL of 710 with 4 network cards installed.  2 of them are assigned to network management.

    I created a vSwitch1 using 2 other network adapters and that assigned to the virtual machine network.

    I then can't get one of the Virtual Machines to connect to the network.

    Then, I created vSwitch2\Virtual Machine Network2 and use 1 NETWORK for each virtual network card and can then get 2 connected Virtual Machines.

    Any help would be appreciated

    Thank you

    Phil

    Sounds like your network switches is configured to only allow one MAC address per physical port.

    -

  • spend crashes after trying to start more than 1 virtual machine.

    Hi - I'm under CentOS 5.4 x 64.  I had an installation of VMware Server 2.0 running for awhile now.  I did just update this afternoon and now as soon as he tried to run more than 1 VM (I 5 who need to start), accidents pass after the first runs.  I thought that maybe there was a problem with the kernel so I started out of the previous kernel and still no dice.  I tried to do a complete uninstall of Server 2.0 (cleaned up/etc/vmware and/usr/lib/vmware) and then installed the 2.0.1 version.  I was able to enter the console, import my machines and then as soon as I had one running and tried to do something else, pass crashes.

    Here are a few journal entries I see:

    Disconnect the current control: /data/VM/WAVSWI8/XP_SP3.vmx

    2009-10-22 22:10:19.963 'vm:/data/VM/WAVSWI8/XP_SP3.vmx' 1091524928 info Request for information: fatal error VMware Server: (worker #1).

    Unexpected signal: 6.

    A log file is located in ' / data/VM/WAVSWI8/vmware.log '.  Please request support and include the contents of the log file.

    To collect the data to submit to the VMware support, select help & gt; Topic and click 'collect data for support. You can also run the script 'vm-support' in the folder my computer directly.

    We will respond on the basis of your entitlement to support.

    Id: 2: Type: 3 default: 0, number of options: 1

    2009-10-22 22:10:19.964 "vm:/data/VM/WAVSWI8/XP_SP3.vmx" 1091524928 WARNING Could not find activation record, user unknown event.

    Disconnect the current control: /data/VM/WAVSWI8/XP_SP3.vmx

    Event 13: Message on WAVSWI8 on fs10 ha-Datacenter: fatal error VMware Server: (worker #1).

    Unexpected signal: 6.

    A log file is located in ' / data/VM/WAVSWI8/vmware.log '.  Please request support and include the contents of the log file.

    To collect the data to submit to the VMware support, select help & gt; Topic and click 'collect data for support. You can also run the script 'vm-support' in the folder my computer directly.

    We will respond on the basis of your entitlement to support.

    ASSIGN RecordOp: latestEvent, ha-eventmgr

    2009-10-22 22:10:19.966 "vm:/data/VM/WAVSWI8/XP_SP3.vmx" 1096735040 WARNING Received a double transition of Foundry: 1

    2009-10-22 22:10:19.966 "vm:/data/VM/WAVSWI8/XP_SP3.vmx" 1089206592 WARNING Received a double transition of Foundry: 1

    vmdbPipe_Streams could not read: OVL_STATUS_EOF

    VMHS: VM connection broken: cfg: /data/VM/WAVSWI8/XP_SP3.vmx; error: Pipe: failed to read; State: 3

    Disassembly of the VM: /data/VM/WAVSWI8/XP_SP3.vmx

    VM full disassembly: /data/VM/WAVSWI8/XP_SP3.vmx

    State of Mount values have changed: /data/VM/WAVSWI8/XP_SP3.vmx

    Reloading of config State: /data/VM/WAVSWI8/XP_SP3.vmx

    VMHS: Past vmx/execState/val of poweredOff

    Caught signal 11

    The vmware.log that is referenced above is filled with a bunch of debug messages (I have attached the file b/c There are a LOT of them).

    Anyone else see something like that?

    Thank you!

    Don

    Hello

    Looks like you're bumping into a known problem.

    Please read this: http://planetvm.net/blog/?p=844

    and then click on the link on the bug report in this article because it has the steps to solve your problem.

    Good luck!

    --

    Wil

    _____________________________________________________

    VI-box tools & scripts wiki at http://www.vi-toolkit.com

  • recently, I intend to download, but unfortunately this is already more than 5 attempts. Thanks to the slow connection and the power outage, my download has failed to complete. Would it not possible to download the app again? Concerning

    Recently I wanted to download, but unfortunately it's already more

    only 5 attempts. Thanks to the slow connection and the power outage, my

    to complete the failed download.

    Would it not possible to download the app again?

    Concerning

    A trial version is not different from the full version.  Using your serial number to activate a trial version, the access limit is removed.

    If you get access errors thrown at you when you try to use a download link, check that you have enabled cookies and clear your cookie cache.  If he continues to not try to use a different browser.

  • What are the limits of size of virtual machine to use the mode of transport NBD in VADP?

    We have some problem to run backup VADP with EMC² Networker 7.6.2 with a virtual machine which, in total, amounts to about 2.3 TB of data.
    The configuration is the following:

    VM (file server) running on Windows 2008 R2

    The backup server (physical) is running Networker 7.6.2 and is also host to proxy for backups VADP.

    VMware vSphere, ESXi 4.1 Update 1

    When we make a snapshot of the file server ESX, no problem.
    When we try a support VADP through Networker, it fails with the following error:

    Creating a snapshot for ' vm-2153'...»
    Task is-1% complete
    Task is 95 percent complete
    Task is 95 percent complete
    Task is 95 percent complete
    Task is 95 percent complete
    74854:nsrvadp_save: VMware following associated error has occurred: cannot create the snapshot "_VADP-backup_" for VM: vm-2153.  Details: "an error has occurred for task"CreateSnapshot_Task".  Details: Operation timed out. ».
    80405:nsrvadp_save: could not create snapshot for VM 'PWVFILE05 '.
    The temporary "V:\backupvmware\PWVFILE05" for VADP directory deleted.

    Other (smaller) customer VADP backups are running thin.

    Someone told me that the business day following a certain limits on the size of the virtual machine.
    He said when he sized VM is equal to 1 TB or more, we should NOT use NBD.

    Anyone explain to me or provide me with evidence?

    Yes, I think it's the best option, visitors don't like the 'limits' much, then maybe look into the SAN transport mode

    Good luck!

  • Can not find templates of virtual machine by using the command 'Get Template '.

    Hi all

    My apologies if this question was asked before, but not could not find any information about this.

    For some reason when I use the command Get-model PowerCLI I get no results even though I have models on the data store. Using a command such as Get - VM works as expected, but for some reason that the command Get-model just can't find anything. There is something pressing that I may have missed in my virtual environment configuration?

    The environment consists of a data center with a 5.1 ESXi host and several virtual machines residing on it. I also have a virtual appliance of vCenter to manage the host.

    Thank you

    Matt

    Hi Matt,

    When you run Connect-VIServer, you connect to the server ESXi and vCenter?

    I just tested the two:

    • SE connect-VIServer-ESXi Server

      • Get-model didn't recover all data
    • SE connect-VIServer-Server vCenter
      • Get model retrieved data

    Maybe that's the case?

    Hope this helps,

    Steven.

  • In my address book, e-mail addresses are repeated over and more, as more than 100 times! What is the fastest way to remove them?

    Also, do you know why the rehearsals took place? Address are not ones I use, and I'm happy to remove them completely, but don't know how?

    Open "address book".
    Select the address book that contains the e-mail addresses, so that you can see them listed in the right pane of Contact.

    If you click on the "E-mail address" column heading, you can sort by e-mail address, so that all the email address are now listed one after the other.

    Left click on that to highlight the top
    'Shift' key and click the last one - everything else will be highlighted.
    Right-click on the highlighted email addresses and select 'delete '.

    How has it happened?
    Good question.
    You say that the relevant addresses are not ones I use.
    They are in the address book "collected addresses"?

    Please search to see if you have all the "Sent" saved messages seem to have used this email address in a 'TO' or 'Reply-to' field. ?

  • More than two devices to connect to the LAN ports and none can see Internet

    If I connect another router to my Netgear and use this another router by connecting four or five devices, all can see the internet and work very well. But if I remove this another router and connect these four devices to one of the ports on my Netgear modem/router, these devices each receive its own IP address (as expected), but NONE of THEM can access the internet.

    No idea why?

    Everything works fine. Note, please, that the Netgear modem/router has always worked well - the problem was with the flaky DNS server addresses provided by Comcst.

  • Is it possible to adjust the sound volume of Windows to more than 100%?

    Hello

    I have a very simple question:

    Is it possible to adjust the sound volume of Windows to more than 100%?

    I explain why I need to do this:
    I can watch DVD files or .avi with my computer and VLC, that allows to adjust the volume to 100%. Some DVDs have a very low sound. So if I set VLC to 200% volume and the system volume to 100%, I can watch movies in good sound conditions. Then, my computer speakers are strong enough for me watching a movie.

    However, I have a problem with VSD: I use VOD with Windows media player and that player does not allow me to adjust the sound to more than 100%. So I put the sound of Windows media player at 100%, the sound of Windows to 100%, but the sound is very low.

    Please don't tell me to buy speakers, mine are pretty strong, and I find it uncomfortable to plug the speakers.

    Please don't tell me to use a software that increase the volume of the file I want to watch VOD.

    Is there a way to increase the sound volume of Windows to more than 100%?

    Please don t tell me this, please don t tell me that. You want to hear other people's opinions or what?

    AFAIK all sound level settings in Windows are synchronized and if you change the sound level in the properties of the speaker at the same level will appear in the Windows for the Volume Mobility Center and the maximum level is 100%. No more than that.

    As you already wrote the sound level can be increased in combination with Windows and some players.

    Is there any other way to watch these videos, but using WMP?

  • How can I make my program works with more than 100 class files?

    As soon as my program generates more than 100 class files I get the following error: cannot run program "jar": CreateProcess = 2 error, the system cannot find the file specified. Is there a way I can increase this limit? My program is small. There must be way to work and Add again all the features I need to add. Thank you

    I got it to work. I reinstalled the JDK, then set the path in the environment variable, restarted eclipse and it worked. It's still a mystery why it worked until I got 100 classes.

  • What is the best method to manage more than 100 oracle instance?

    our company have run on the 100 on VM Linux oracle instance.

    What is the best method to manage more than 100 oracle instance? use Oracle Enterprise Manager?

    Thank you.

    How your company grow to 100 cases?  There would be some oversight in place as he grew.

    What do you exactly mean by "manage"?  Monitor?  Start/stop?  Performance optimization?  Add storage / Storage?  Backup?

    You may need a mixture of methods / facilities.  Again, it should be obvious that you have something in place already - if you replace it entirely?

    Hemant K Collette

  • Failed to get more than 1 email on the shipment line [blush].

    Hello and thank you for your time, just use Mozilla for 2 months [ex user of outlook express]. I want to send an email, the address is available for good, now I want to include a different address, as soon as I get the address first becomes 2nd red and my second address is not, only the first letter is then I quit smoking and do not send anything. I need help, my mail before develops. Thank you, frosty.

    Thanks Todd, had the opportunity to move your suggestions and I have learned from them, I now can I send more than one forward both by using the Enter key, thank you for helping me along the way. Frosty

Maybe you are looking for