VMSnapshot age VCO Workflow

I'm deleting snapshots of a certain age in a certain folder via a VCO workflow. I watched the workflow that comes standard with the library and other examples. Comes with those that they loop through every snapshot of each VM in each folder. In my environment that is literally thousands of snapshots (snapshots are used incorrectly in this environment - but that's another story for another forum) and it takes a lot of time to go through loops. My workflow now crosses all virtual machines in a specifc VC:VMFolder and gets all the VC:VirtualMachineSnapshot object for each virtual computer. I need a way to find the age of individuals VC:VirtualMachineSnapshot. Y at - it an easy/fast way to do it rather than brute force through each snapshot in the system?


created var = thisSnapshot.creationTime ();? It would be great.

Thank you all.

By using com.vmware.library.vc.vm.snapshot.getAllSnapshotsOfVM () as a base action script code, here's how to enumerate all the snapshots of your virtual machine and print their identity papers and the moment where they have been taken:

// 'vm' is the input parameter - the virtual machine object
var snapshots = new Array();
if (vm.snapshot) {
    var snapshotTrees = vm.snapshot.rootSnapshotList;
    for (i in snapshotTrees) {
        getSnapshotsOfVM(snapshotTrees[i]);
    }
}

function getSnapshotsOfVM(tree) {
    snapshots.push([tree.snapshot, tree.createTime]); // store a tupple of the snapshot and its creation time
    var trees = tree.childSnapshotList;
    if (trees != null) {
        for (index in trees) {
            if (trees[index] != null)
                getSnapshotsOfVM(trees[index]);
        }
    }
}

// Print the results
for each (var s in snapshots) {
    System.log("Snapshot: '" + s[0].id + "' created on: '" + s[1] + "'");
}

If you do not want to collect the creation time for all snapshots of your virtual machine, but the only moment in the creation of a given snapshot, then just add a single cheque to add line 11 to compare the attribute id of your snapshot with the attribute id of the snapshot processing tree.snapshot.

Tags: VMware

Similar Questions

  • Get the answer from a url - vCO workflow

    Hello

    Is possible to get the answer to a url if a vCO workflow? I want to check the status of keepalive on a Web server to see if the instance is running or not. All I want is to hit the url, say ""https://webserverfqdn:port/keepalive.html/"and analysis the answer to understand the Web server is running." I don't want SSH to the Server Web query status. It is very before starlight in javascript using xmlHTTPRequest. But, how can I do this using vRO?

    Thank you

    Here you go:

    var website = new URL("https://webserverfqdn:port/keepalive.html");
    var content = website.getContent();
    

    Now 'content' is a string that contains your Web site content that you can now analyze as you wish.

  • Blog post "vCO Workflow to automate certificate generation process.

    In this post we'll take a look in a workflow that can help to automate the generation of certificate. Certificates that are generated from the vCO/vRO workflow are standard certificates that can be used with the VMware products or for any other use or software. Here are some files that can be produced by the workflow

    file Setup - openssl.cfg - OpenSSL

    -rui.crt - CRT certificate

    -rui.csr - Certificate Signing Request.

    certificate - rui.key - private key from an individual (PEM formatted)

    -rui.p12 - PKCS12 package containing the private key and CRT.

    -rui.p7b - PKCS7 package containing CRT

    -rui.pem - PEM certificate with the private key

    -rui orig.key - private key of a specific certificate


    Most aspects of certificate and properties, such as subject alternative names (SAN) are customizable during execution.

    We will take a peek into little opportunities that offer the workflow in this package:

    Use case 1: create the certificate request file - in the first use case, we will use the workflow in the package to create the certificate request (.) CSR file). This file can then be used by administrators to generate an internal enterprise CA certificate form or send to external public certificate authorities that will generate the certificate instead.

    Use case 2: convert a certificate in the PEM - in the second case, we will use the workflow in the package to convert an existing certificate. Certificate PEM. Let's say that you have received a certificate, you must use on your device to VMware. To use this certificate, you must convert to PEM Format to be used by the device. It can be a certificate .cer or a PKCS12 (P12) or the PKCS7 (P7B) certificate package containing the certificate.

    Use case 3: using the "generate certificate: WF to automate the end-to-end process - in the third case we will use a workflow to automate the process of generation of certificate to - end of use.» Since the creation of the OpenSSL configuration file, create a certificate request file, this submission to a certification authority, on receipt of the generated certificate, converting to usable Linux PEM format and finally export the certificate package.


    Best regards

    Kaloferov spas

    ... and here is the link

    vCO Workflow to automate certificate generation process

    vCO Workflow to automate certificate generation process. Kaloferov spas & #039; s Blog

    BR, Spas

  • How to obtain the list of the vCAC host attached to the VCO in the VCO workflow

    Is it possible to get a list of all host vCAC attached to vCenter Orchestrator in the VCO workflow?

    Yes:

    vcacHosts = Server.findAllForType("VCACCAFE:VCACHost");
    
  • VCo workflow to clone a virtual machine of centos. Network interface problem

    Hello

    I use vco workflows to clone a virtual machine of vcenter. The virtual machine is running centos 6.0. When cloning is complete. I see the network eth0 and eth1 interfaces set correctly the static gateway ip and address information I provided. I deleted the 70 - persistent - net .rules on the basic vm form which I clone. So, I get the correct interface names. But when vm powers on and I run "ifconfig eth0" I don't see the IP address of this interface has all the details.  same for the other interface also.

    But if I do a system restart network without changes to networking and then do an ifconfig I see the IP with the previous information.   I don't know why the service network restart is necessary so that he can recognize the ip address.

    Any ideas what I could do wrong. or to avoid this manual step of the execution of the service network restart command on the creation of the vm.

    Thank you

    Kiran

    Yes I'm restarting after after the application of customization.

    Has been able to solve the problem... In CentOS, the network service does not work by default. This is why it does not have network interfaces at startup. So now the machine instant, I started the network services and stop the Network Manager service

    using chkconfig network on

    chkconfig NetworkManager off

    and then cloned from this virtual machine... and apply the customization settings. during the start now it shows the interfaces properly without needing a service restart

  • vCAC 6 - How to add users to a group of commissioning of a vCO workflow?

    I'm trying to drop users into roles in a group of Provisioning (Business Group) in a vCO workflow. Does anyone have advice on how I can achieve this?

    I'm already reading/add/update custom fields, but the action of logEntityDetails() shows not all entries under 'Complex properties', users.

    Examples of VMware how to create PG, but not how to add users.

    Just to answer my own question, since I posted it the vCAC 6.0.1 for vCO plugin was released, which introduced a whole new bunch of features through vCACCAFE, including the manipulation of Provisioning groups (company) members.

  • vCO workflow: create a virtual machine from a model and then ask the user about the CPU, memory size...

    Hi guys,.

    I am trying to create a workflow with vCO that can do the job for me:

    -Create a virtual machine (or maybe a several virtual machines) from a model (the model is in vCenter, of course)

    -L' user who is running the workflow has the thr right to say what he wants for the CPU, the memorysize, the disksize

    Any help?

    I found some workflows in the library can seem to do something similar to what I want, but since I'm a beginner I'd rather have your advice

    Hello there and welcome to vCenter Orchestrator

    Take a look at this series of tutorials to get an idea of how start:

    Create a vCO simple self-service VM Provisioning Portal - part 1

    Create a vCO simple self-service VM Provisioning Portal - part 2

    Create a Simple Self Service VM Provisioning Portal vCO - part 3

    The general approach to take would be to determine which of the clone (or clone and customize) workflows adapts to your nearest need (see your customer vCO: workflows\Library\vCenter\Virtual Machine management\Clone\)

    Then, create a NEW WORKFLOW that calls this one... after that your clone operation is complete, keep the computer turned off virtual and add feeds of extra work from the library to your new workflow that do things like change the amount of Ram, adds disks, change CPU, etc...

    Be sure to watch the videos on http://www.vmwarelearning.com/orchestrator to get a basic understanding of the use of vCO.

  • In the face of the question and try to set the affinity through VCO workflow rule

    In the face of the question then to attempt to set the affinity through VCO workflow rule I'm trying to write workflow VCO to set up the level of affinity of cluster, but it throws the error message cannot convert ClusterComputeResource 'mycluster' to com.vmware.vim.vi4.ClusterConfigSpec (Workflow: create vm-virtual machine affinity rule / Scriptable task (item1) #19) my script to workflow is var rule = new VcClusterAntiAffinityRuleSpec(); Rule.Key = - 30; Rule.enabled = true; Rule.Name = ruleName; rule.userCreated = true; Rule.VM = MV; var clusterSpecRules = new Array(); var clusterSpecRule = new VcClusterRuleSpec(); clusterSpecRule.operation = VcArrayUpdateOperation.add; clusterSpecRule.info = rule; clusterSpecRules.push (clusterSpecRule); var clusterSpec = new VcClusterConfigSpec(); clusterSpec.rulesSpec = clusterSpecRules; var m = computeCluster.vimHost //spec = task = computeCluster.reconfigureCluster_Task (computeCluster, spec, true); Note: In the above code, what are the entry parameter computeCluster entered type parameter VC:clusterComputeResource ruleName is a parameter of type String - APR

    Here is the code I use, give it a shot.

    var affinitySpec = new VcClusterAffinityRuleSpec();
    affinitySpec.enabled = true;
    affinitySpec.name = att_ruleName;
    affinitySpec.userCreated = true;
    affinitySpec.vm = att_vmArray;

    var clusterRuleSpec = new Array (new VcClusterRuleSpec());
    clusterRuleSpec [0] = new VcClusterRuleSpec()
    .operation clusterRuleSpec [0] = VcArrayUpdateOperation.add;
    clusterRuleSpec [0] .info = affinitySpec;

    var clusterConfigSpec = new VcClusterConfigSpecEx();
    clusterConfigSpec.rulesSpec = clusterRuleSpec;

    att_task = att_clusterComputeResource.reconfigureComputeResource_Task (clusterConfigSpec, true);

  • Copy comments to vCO Workflow question

    I'm having some trouble with the copy of the client to a workflow of vCO (library > vCenter > operations > files > copy of comments to vCO).  I followed all the instructions on how to configure a local access on the file system of vCO, but I can't make it work for write access (note: read is very good I can make a copy OF vCO to guest with success).  In addition, I can get this working with native directories listed in the file js - io - rights.conf (meaning, all except the two new entries at the bottom of the file js - io - rights.conf below).

    # cat /etc/vco/app-server/js-io-rights.conf

    -rwx /.

    + rwx/var/run/vco /.

    -rwx/etc/vco/app-server/security /.

    + rx/etc/vco /.

    + rx/var/log/vco /.

    + rwx/nfs/repo /.

    + rwx/repo/nfs/exports.

    The permissions are set exactly the same, for example, like/var/run/vco:

    drwx - 2 vco vco 4096 Oct 5 14:55 / var/run/vco

    drwx - 2 vco vco 4096 Sep 29 14:22 / nfs/repo

    The error I get when running workflow is "permission is denied" see below the exact error:

    / nfs/repo (Permission denied) (workflow: copy of the file of comments to the vCO / Scriptable task (item1) #10)

    Finally, I have restarted the services vRO/vCO, and in desperation, restarted the unit several times but still no go.

    Any help is appreciated!

    I checked it on the device with the same version and had no problems. You can check that the "vco" user have permissions on the folder /nfs off/nfs/repo

  • How to pass values to vCAC in a vCO workflow?

    I am working on a custom naming convention in vCAC 6.1 and I've got Setup custom properties vCO goes via the BuildingMachine stub by using workflows of extensibility module vCAC. I can create my custom in vCO name, but I don't know how to spend back in vCAC. I have seen a few examples using the vCAC Designer, but I'd stick rather just to vCO to if possible. I feel that it is probably quite simple, that I just haven't thought to it yet.

    Any tips?

    Thank you

    Jake

    Thanks, I thought to use that, but wanted to learn the process anyway in case I need to do with another property at any given time. I could find the answer here: Re: how to update vCAC VM workflow BuildingMachine name

  • defining a vCACVmProperties custom property in a vCO workflow...

    My apologies if this has been asked before, (tried searching and has not obtained a great success), am also new on vCAC/vCO :-)

    I have no problem to get the current value of a property, for example:

    var osFamily = vCACVmProperties.get ("Custom.OSFamily"),

    However, after a few adaptations that happens in the workflow of vCO, I need update day/change the value stored in vCAC, wish to change the vCACVmProperties ' a new value to the property and I can't seem to find how?

    Thanks in advance,

    John s.

    DOH! , slaps forehead, had tried to adjust, but do not put :-(...

  • Different Dates expires in overview of the order of the day and display detailed elements having extended the term of the lease (through the vCO Workflow)

    Hello

    I have two different points of view for the field due Date for a virtual machine.

    In the Overview of the agenda , I have the correct expires date of (in DB) as you can see in photo 1.

    Photo 2 shows the detailed view of the elements that one here is a date old expires before I extended the lease on this point.

    I extend the term of the lease without the vCAC process "extend Lease Time.

    I created a workflow to allow only 30 days to expand and write directly through the entity Expiration Date in the DB.

    Is there another DB-field to be updated with the new Expiredate?

    Is this a mistake?

    expires01.PNG

    expires02.PNG

    I solved this by myself once I discovered how this view of retail.

    See the solution here http://vautomate.wordpress.com/2014/04/17/extend-leasetime-in-vcac-with-vco/

  • vCO workflows

    Hey

    What is the best way to give IP and DNS addresses to virtual machines using vCO?

    Any help would be appreciated!

    Thank you

    Hello

    I rarely do the clone/customize for linux machines - simply have not been involved in many projects requiring it... However, to help here, I just went through the process myself to make sure it works. I used the "Clone, Linux with single nic" workflow in Linux customization file. I ran the workflow and provided as follows:

    VM cloning: I chose a valid Linux VM for my vCenter

    The virtual machine name: CloneTest

    Mark the new virtual machine as a model: No.

    Turn on the virtual machine: No.

    List of resources: resources (default root list of cluster resources)

    Host: Undefined (since I put a Pool of resources, host selection is automatic)

    The virtual machine folder: vm (vm by default root folder)

    Data store: NFS-01

    Run Sysprep operations and wait for the task to complete: Yes

    Name or name prefix of the Linux Client: CloneTest

    MAC address:

    Network to fix it...: VM Network

    Use DHCP: No.

    Fixed IP address, valid: 192.168.110.98

    Subnet mask: 255.255.255.0

    List of gateways: 192.168.110.2

    Domain DNS suffix: corp.local

    List of DNS servers: 192.168.110.10

    Final result:

    The workflow completed without error. The resulting virtual machine is properly named in vCenter and its host name. She was also the good static IP & gateway.

    Based on the error message you mentioned in your post, it sounds like you have a problem with host name:

    A specified parameter was not correct.

    spec.identity.hostName

    ..., You specify a valid host name in the entry workflow "name prefix" or name of the Linux Client?

  • Generate a vCloud Blocking task from a vCo Workflow

    Hello

    Is there a way to geneate one task blocking vCo vCloud?

    I have a workflow that runs due to a vCloud blocking the task, but I need can also generate a blocking vCo vCloud task before completing my workflow and fail or approve the vCo to the workflow is based on a scenario that I chose.

    Is this possible?

    Thanks in advance,

    Ran

    Blocking tasks are wide control panel. While you can activate one of vCO he would block all the tasks for a specific operation / API call.

    If you want vCO to trigger an operation and you want that he be blocked just enable a task blocking for the proposed operation. Even if it is triggered by the vCO will be blocked.

    Christophe.

  • Handle Permissions in vCenter with vCO Workflow

    Hello

    I'm changing the permissions of users and roles in vCenter with workflows.

    For example, I want to copy permissions from one folder to another. I found the correct object and method: VcAuthorizationManager.setEntityPermissions ().

    The problem is that I can't find a way to access the Manager. AuthorisationManager is access through the content property of the ServiceContent object and this object is returned by the method "RetrieveServiceInstance" according to the documentation: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.ServiceInstanceContent.html#field_detail ".

    How to call this process? The documentation makes no sense to me because there is no object ServiceInstance in vCO and the ServiceContent object has none of these methods.

    I have an example on how to use these objects.

    Thank you

    Irene

    Hi Irene

    You can use the SdkConnection.authorizationManager (that represents the permissions for you handler vCenter)

    SdkConnection represents a connection to a specific Server vCenter server. You can get all SdkConnection for vCenter servers registered using VcPlugin.allSdkConnections. (VcPlugin is an object that contains a script with static methods)

    Hope this helps.

Maybe you are looking for

  • "Your USB bootable could not be created" - Win 8.1 on Mavericks

    Hello! I tried in vain to 8.1 Windows Installer on my iMac using Boot Camp. That's what I'm trying to use: OS 10.9.5 Mavericks Model name: iMac Model identifier: iMac14, 2 End of 2013 Boot Camp Assistant 5.1.2 Windows 8.1 Pro 64 bit (OEM DVD) I start

  • Satellite L550D-136 - Recvovery HDD after reloading the Image

    HelloI have a Toshiba Satellite L550D-136.For the backup of my custemised system I'm building a Windows 7 image backup.Can I use the Toshiba HARD drive recovery tool after reloading my own image? Frankl

  • Qosmio X 500-12D-from 1680 x 945 1920 x 1080 possible?

    Well I have found anywhere on the forum or on the internet... I would like to have 1920 x 1080, despite the fictional problems problem and tube. My 1680 x 945 resolution isn't enough for me. I asked the LCD ebay reseller, can I mount FHD on my Toshib

  • Reminder for Cancel-button available?

    Hello is there a way to create a sequence of reminder that runs automatically when I press the end button to stop the sequence? In this sequence, I want to disable the instruments. Thanks for help

  • item (s) unknown in Netstat

    When I started Netstat - good to start my computer, the following wre appears: TCP 192.168.1.64:1035 windows\system32\WS2_32.dll component (s) unknown [svchost.exe] TCP 192.168.1.64:1036 windows\system32\WINHTTP.dll [svchost.exe] What is "unknown or