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
Bug 1826100: vSphere allow users to specify existing folder #3498
Bug 1826100: vSphere allow users to specify existing folder #3498
Conversation
@patrickdillon: This pull request references Bugzilla bug 1826100, which is valid. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/hold |
/test e2e-vsphere |
one thing we should make sure is that the cloudproviderconfig is also configured to match the changes here. |
/retest |
1 similar comment
/retest |
cc @dav1x |
/retest |
5a5fd7d
to
c735917
Compare
/test e2e-vsphere
I updated 91151a4 with this change. vSphere cloud provider config was using the clustername--not cluster id. API server seemed to be failing in the last run...
|
/test e2e-vsphere |
c735917
to
01bba68
Compare
@patrickdillon: This pull request references Bugzilla bug 1826100, which is valid. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@jcpowermac This requires an update to destroy. Can you take a look at the implementation in the latest commit? When destroying VMs we check whether VMs are tagged and have a tagged parent folder. If we don't create the folder, the folder isn't tagged. I took the easiest option and just removed the folder check, so now we just we delete any tagged VM regardless of parent folder. From what I can see this seems perfectly acceptable. Do you know if the extra check is just a safeguard or does it account for any (corner) cases? The other option would be to add the folder path to the cluster metadata and find a reference to untagged BYO folders by path. Not too much work but probably better to avoid unnecessary complexity if we don't need it. |
That is the only reason I wrote it that way...as a safeguard.
@patrickdillon That seems perfectly fine to me. |
01bba68
to
e7f6cc5
Compare
/test e2e-vsphere |
@patrickdillon: This pull request references Bugzilla bug 1826100, which is valid. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
||
finder := find.NewFinder(vim25Client) | ||
|
||
path := fmt.Sprintf("/%s/vm/%s", cfg.Datacenter, cfg.Folder) |
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.
what if the user already gave us the folder path prefixed with /<datacenter>/vm/
?
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.
we should try to error out saying you have prefixed it, we would like un-prefixed.
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.
we should try to error out saying you have prefixed it, we would like un-prefixed.
I can easily add some static validation.
what if the user already gave us the folder path prefixed with //vm/
When create cluster
is run validation would run to look for a folder called /<datacenter>/vm//<datacenter>/vm/
. Assuming it doesn't exist, the install would abort.
I have probably been thinking about this too much, but my approach has been to rely on the API validation because it is difficult to determine what is actually a valid name and what isn't.
/<datacenter>/vm/<datacenter>/vm
is technically a valid folder name. I haven't tested much with the leading /
... vsphere seems to convert /
to %20
or something like that.
I think we could probably safely statically validate a leading /
and I can confirm that with a little more testing.
I also think it is a safe assumption that although it might be allowed no one will really name their folder /<datacenter>/vm/
and it is much more likely they are making a mistake.
I will work on adding these.
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.
@rgolangh suggested requiring the absolute path, which could actually make things simpler and be easier to validate.
docs/user/vsphere/customization.md
Outdated
@@ -9,6 +9,7 @@ Beyond the [platform-agnostic `install-config.yaml` properties](../customization | |||
* `password` (required string): The password to use to connect to the vCenter. | |||
* `datacenter` (required string): The name of the datacenter to use in the vCenter. | |||
* `defaultDatastore` (required string): The default datastore to use for provisioning volumes. | |||
* `folder` (optional string): The name of the existing folder where the installer should create VMs. The value should be relative to the datacenter's VM folder. To install VMs in `/example_datacenter/vm/example_folder/example_subfolder` specify the value `example_folder/example_subfolder`. If a value is specified, the folder must exist. If no value is specified, a folder named with the cluster ID will be created in the `datacenter` VM folder. |
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.
can we update the godoc for the field inaddition to this customization document.
Hm. Machine API cannot find nested folder when I specify relative path. This PR is 2 steps forward 1 step back. /this-is-fine |
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -33,3 +39,30 @@ func ValidateForProvisioning(ic *types.InstallConfig) error { | |||
|
|||
return allErrs.ToAggregate() | |||
} | |||
|
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.
There missing validation test for this, but we can add those later on...
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
11 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@patrickdillon: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
@patrickdillon: Some pull requests linked via external trackers have merged: . The following pull requests linked via external trackers have not merged:
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Some users may want to use IPI on a shared vSphere cluster, where they do not have full admin privileges. This allows them to use IPI with privileges mostly confined to an existing resource pool. Compliments PR openshift#3498.
Some users may want to use IPI on a shared vSphere cluster, where they do not have full admin privileges. This allows them to use IPI with privileges mostly confined to an existing resource pool. Compliments PR openshift#3498.
Some users may want to use IPI on a shared vSphere cluster, where they do not have full admin privileges. This allows them to use IPI with privileges mostly confined to an existing resource pool. Compliments PR openshift#3498.
Some users may want to use IPI on a shared vSphere cluster, where they do not have full admin privileges. This allows them to use IPI with privileges mostly confined to an existing resource pool. Compliments PR openshift#3498.
Some users may want to use IPI on a shared vSphere cluster, where they do not have full admin privileges. This allows them to use IPI with privileges mostly confined to an existing resource pool. Compliments PR openshift#3498.
Some users may want to use IPI on a shared vSphere cluster, where they do not have full admin privileges. This allows them to use IPI with privileges mostly confined to an existing resource pool. Compliments PR openshift#3498.
Some users may want to use IPI on a shared vSphere cluster, where they do not have full admin privileges. This allows them to use IPI with privileges mostly confined to an existing resource pool. Compliments PR openshift#3498.
Before this PR, we were always creating a folder with the cluster ID (incorrectly ignoring the folder specified in the install config). Now, if users specify a folder in the install config, terraform will expect there to be an existing folder and will use it for installation. If none is specified, a folder will be created with install config.
TODO:
Folder Paths
vSphere libraries seem to use a mixture of relative and absolute paths. Some of these issues only seem to arise when using nested folders; that is, a relative path is ok for a top-level folder but an absolute path is required for a nested folder. This is the case for the Machine API provider and terraform import_ova resource. The cloud config and terraform virtual machine resource need relative paths.
Validation
Adds static validation to ensure absolute path is provided in the install config:
Adds API validation to ensure that a specified folder exists when installing to the cluster: