Skip to content

ClusterSelection: Get datastores directly from cluster#23

Merged
jswager merged 2 commits intojenkinsci:masterfrom
damienbiggs:topic/deployVm
Feb 3, 2015
Merged

ClusterSelection: Get datastores directly from cluster#23
jswager merged 2 commits intojenkinsci:masterfrom
damienbiggs:topic/deployVm

Conversation

@damienbiggs
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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

Development

Successfully merging this pull request may close these issues.

3 participants