Git Product home page Git Product logo

vsts-vmware's Introduction

vso-vmware

To build Java code

- Ensure you have instilled the maven
- compile - mvn compile
- run test  -   mvn test    
- code coverage -   mvn test verify
        Go to _build ( _build\testReports\codecoverage ) folder on root directory to check the code coverage

To build JS / TS code

- Ensure you have node.js installed
- code build - gulp
- test run - gulp test

vsts-vmware's People

Contributors

chshrikh avatar codito avatar krishnaadityab avatar microsoft-github-policy-service[bot] avatar mvvsubbu avatar nphmuller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vsts-vmware's Issues

waitForVMToBeDeployReady validation during snapshot restore

It looks like that currently your extension where reverting to certain snapshot is waiting for VM to come online to validate whether revert operation completed successfully. You basically use the same waitForVMToBeDeployReady function as in the case of PowerOn operation. This does not work for the scenario when your VM is turned off when snapshot was taken.
I think the code should be checking whether the revert operation has completed successfully, instead of trying to discover that VM on the network. Does PowerCli and/or VMWare API allow you to do that?

waitForNetworkDiscoveryOfVM relies on Guest HostName to be same as vmName

Scenario:
When the Guest HostName is not same as the vmName , the network discovery fails (probing the dns fails), this issues a timeout with a warning that the machine might not have network connection, which is not true.

Suggest a solution:
I suggest to combine the current checks for network presence with the confirmation that the gest has an ip address.

Code:
getMorProperties(vmMor, new String[]{"guest.ipAddress"}).get("guest.ipAddress").toString().isEmpty()

Loop to find a snapshot on the virtual machine doesn't return when it actually finds a snapshot

Visual Studio Team Foundation Server 2015 Update 3 (on premise)
VMware Resource Deployment 1.0.0 (ms-vscs-rm.vmwareapp)

The loop to find a snapshot on the virtual machine doesn't return when it actually finds a snapshot.

https://github.com/Microsoft/vsts-vmware/blob/master/src/Tools/vmOpsTool/VMWareImpl.java#L614

Right after that line, there should be a check to see if snapshotMor is not null and if so, break out of the loop or return snapshotMor.

The problematic behavior is observed when there's a snapshot hierarchy similar to the following:

- Root Snapshot
     |- Child Snapshot A
              |- Grandchild Snapshot 1
     |- Child Snapshot B

When trying to revert to "Grandchild Snapshot 1", the output log is similar to the follow:

...
Successfully established session with vCenter server.
Restoring snapshot [ Grandchild Snapshot 1 ] on virtual machine [ My Virtual Machine ].
Querying VirtualMachine objects on vCenter server.
Querying snapshot information for virtual machine [ My Virtual Machine ].
Found snapshot [ Grandchild Snapshot 1 ] for virtual machine.
No snapshot found on virtual machine [ My Virtual Machine ] with name Grandchild Snapshot 1
Failed to [restore] snapshot [Grandchild Snapshot 1] on virtual machines  [My Virtual Machine ].
Return code: 1
##[debug]rc:1
##[debug]success:false
##[error]Failure reason : Error: C:\ProgramData\Oracle\Java\javapath\java.exe failed with return code: 1
##[debug]load strings from: C:\agent\tasks\VMwareTask\1.0.0\node_modules\vsts-task-lib\lib.json
##[debug]load loc strings from: C:\agent\tasks\VMwareTask\1.0.0\node_modules\vsts-task-lib\strings\resources.resjson\en-US\resources.resjson
##[debug]task result: Failed
Finishing task: VMwareTask
##[error]Task VMwareTask failed. This caused the job to fail. Look at the logs for the task for more details.

Ideally, I would like to be able to specify the specific snapshot hierarchy in the case where there's more than one snapshot with the same name.

For example, I want to explicitly specify the snapshot name "Root Snapshot\Child Snapshot B\Grandchild Snapshot 1", in the case where there's already a snapshot named "Grandchild Snapshot 1" higher up in the hierarchy, i.e. "Root Snapshot\Child Snapshot A\Grandchild Snapshot 1".
Currently, there isn't a way to specify which snapshot I want to revert to.

Thank you!

Should vmOpsTool execute networkDiscovery by vm name?

In vmOpsTool:VMWareImpl.java many methods run the waitForVMToBeDeployReady method. This method finally checks if the vm is fully up, by trying to resolve the dns name and/or netbios name.

I however don't really understand how this would work, since it tries to resolve both by vm name. Is it really that common for the vm name to be the dns and/or netbios name? Because when it isn't, the method keeps polling for the max build time (about 20~30 minutes in my case).

This really doesn't seem optimal to me. But it can be solved in one of the following way's:
-Add a checkbox to the task ui, which indicates if the task should wait for the vm to be deploy ready (or at least network discovered). This makes the waiting optional.
-Added a textfield for the dnsname/netbiosname/ip-address, which is used to poll if the vm is up.

What do you think of the proposed solutions? Do you have any better solutions?
I'm willing to implement the solution and create a PR. Can't promise when, though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.