Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClusterSelection: Get datastores directly from cluster #23

Merged
merged 2 commits into from Feb 3, 2015

Conversation

damienbiggs
Copy link
Collaborator

In our Vsphere setup, searching for Datastores under the cluster doesn't work.
When calling getDataStoreClusters on a cluster, the cluster is found though.
Unfortunately I don't know enough about the vmware vim25 api to know why the
datastore wasn't found.
It is found if I don't pass in the cluster for the searching and the searching
takes place on the root entity.
Pass in logger to Vsphere clone method so that output can be seen in jenkins
console.

While testing this I realized that several arguments are not expanded.
Cluster for instance is not expanded in either Clone or Deploy.
This would mean that ${CLUSTER} for instance wouldn't be expanded.
Improved logging messaging as well so errors in configuration are easier to find.

In our Vsphere setup, searching for Datastores under the cluster doesn't work.
When calling getDataStoreClusters on a cluster, the cluster is found though.
Unfortunately I don't know enough about the vmware vim25 api to know why the
datastore wasn't found.
It is found if I don't pass in the cluster for the searching and the searching
takes  place on the root entity.
Pass in logger to Vsphere clone method so that output can be seen in jenkins
console.

While testing this I realized that several arguments are not expanded.
Cluster for instance is not expanded in either Clone or Deploy.
This would mean that ${CLUSTER} for instance wouldn't be expanded.
Improved logging messaging as well so errors in configuration are easier to find.
Only change between clone and deploy is to not set a snapshot when deploying a
vm  from a template.
Refactored cloneVm method into smaller methods for easier readability.
jswager added a commit that referenced this pull request Feb 3, 2015
ClusterSelection: Get datastores directly from cluster
@jswager jswager merged commit 0086d1c into jenkinsci:master Feb 3, 2015
@grjones
Copy link

grjones commented Apr 24, 2015

@damienbiggs I believe this change broke some things. My vSphere doesn't have any clusters configured. I was using the Datacenter name before, but after upgrading from 2.2 to 2.4 this no longer works.

[vSphere] Deploying new vm "MyVM" from template "my_template"
[vSphere] org.jenkinsci.plugins.vsphere.tools.VSphereException: vSphere Error: Cluster "MyDatacenterName" not found
Build step 'vSphere Build Step' marked build as failure

@damienbiggs
Copy link
Collaborator Author

Sorry about that.
The old approach wasn't working for me in our Vcenter with clusters, I'll try and create a patch on Monday to incorporate both approaches. Would you be able to test a merge request, ideally it'd be good to know it works before merging it to master.

@grjones
Copy link

grjones commented Apr 25, 2015

@damienbiggs Absolutely I can test. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants