-
Notifications
You must be signed in to change notification settings - Fork 48
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
(POOLER-83) Add ability to specify a datacenter for vsphere #223
(POOLER-83) Add ability to specify a datacenter for vsphere #223
Conversation
69a5b6b
to
55d286f
Compare
Code has been completed. Just pending an actual test on vsphere infrastructure to make sure it all works. |
Verified manually, against a real vSphere instance, that the datacenter setting is being used:
:vsphere:
...
datacenter: 'pdx'
... |
This PR is ready for merge |
@@ -422,8 +434,9 @@ def add_disk(vm, size, datastore, connection) | |||
true | |||
end | |||
|
|||
def find_datastore(datastorename, connection) | |||
datacenter = connection.serviceInstance.find_datacenter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this one need changed too?
https://github.com/glennsarti/vmpooler/blob/55d286f8bb3b60c9798546b231096ea6d0005854/lib/vmpooler/providers/vsphere.rb#L427
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you're right. I'm concerned the specs didn't pick that up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. And modified the specs to fail if it regresses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some method comment to find_folder because I was confused at first how a nil value to the datacentername could return the first datacenter found. see commit.
0a775f0
to
e580faf
Compare
Looks like this needs a rebase |
There's always something :-) |
e580faf
to
42b8bbc
Compare
Previously the vsphere provider assumed that there was one and only one datacenter (DC) in the vsphere instance. However this is simply not true for many vSphere installations. This commit: - Adds the ability to define a vSphere datacenter at the Pool or Provider level whereby the Pool setting takes precedence - If no datacenter is specified the default behaviour of picking the first DC in the vSphere instance - Updated all tests for the new setting - Update the vmpooler configuration file example with relevant setting name and expected behaviour - Fixed a bug in the rvmomi_helper whereby if no DC was found it would return all DCs. This is opposite behaviour of the real RBVMOMI library as it returns nil
Specifically that the 3rd argument datacentername supports a 'nil' value, in which case the first datacenter is returned.
42b8bbc
to
5355d1c
Compare
Rebased. |
This PR builds on PR #224
Previously the vsphere provider assumed that there was one and only one
datacenter (DC) in the vsphere instance. However this is simply not true for
many vSphere installations. This commit:
whereby the Pool setting takes precedence
in the vSphere instance
and expected behaviour
all DCs. This is opposite behaviour of the real RBVMOMI library as it returns
nil