-
Notifications
You must be signed in to change notification settings - Fork 454
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
feat: add vsan file services #1968
Conversation
Description: "The subnet mask of vsan file server ip config.", | ||
}, | ||
"file_server_ip_config": { | ||
Type: schema.TypeSet, |
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.
Like @appilon suggested in you may use schema.TypeList
and MaxItems: 1
in order to ensure a single entry.
domainConf := fileServiceConf["vsan_file_service_domain_conf"].(*schema.Set).List()[0].(map[string]interface{}) | ||
|
||
var serverIpConf []vsantypes.VsanFileServiceIpConfig | ||
for _, ip := range domainConf["file_server_ip_config"].(*schema.Set).List() { |
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.
Since thevsan_file_service_domain_conf
is optional should not there be something like a null check ?
I also do not see where the d
variable is used. If I am not missing something this should be removed from the function arguments.
if err != nil { | ||
return fmt.Errorf("cannot find vsan file service OVF url, err: %s", err) | ||
} | ||
|
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.
Please add log statement with fileServiceOvfUrl
|
||
if err := vsanclient.DownloadFileServiceOvf(meta.(*Client).vsanClient, meta.(*Client).vimClient, fileServiceOvfUrl); err != nil { | ||
return fmt.Errorf("cannot download vsan file service OVF with url: %s", fileServiceOvfUrl) | ||
} else { |
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.
No need of the else statement sine there is a return in the if statement
} | ||
} | ||
|
||
if !d.Get("vsan_file_service_enabled").(bool) && d.HasChange("vsan_file_service_enabled") { |
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 about if the file service is enabled and there is a change ?
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.
For this comment and the next one, we're planning to combine two fields as former features (fd/sc) did, if the block start to appear it means we're going to enable file service, if the content of block changed, it means reconfigure file service, and if we remove whole block from .tf file, it means disable file service, however in this PR, for the first version of this feature, only basic enable/disable will be supported, since reconfigure fs need new vmodl API, we'll add inline comments accordingly.
"vsan_file_service_domain_conf": fsDomainConf, | ||
}) | ||
|
||
if err := d.Set("vsan_file_service_conf", serviceConf); err != nil { |
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.
How is vsan_file_service_conf
set if vsanConfig.FileServiceConfig.Enabled equals false ?
Converting to draft whilst merged conflicts and open comments are resolved by @zxinyu08. |
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.
This PR now only offers limited support in file service configuration, so close this draft PR as of now. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
Feat: add support for vSAN File Service enablement and its domain configurations.
This feature is to support configuring vSAN File service and its domain settings. We added two new fields in compute cluster resource
vsan_file_service_enabled
andvsan_file_service_conf
.vsan_file_service_enabled
- Switch to enable and disable.vsan_file_service_conf
- Configurations for enabling vSAN FS. It contains:-
network
- (mandatory) The network selected for vSAN FS.-
vsan_file_service_domain_conf
- FS domain configurations.Testing Details:
We did end to end test from 3 standalone hosts based on the vSphere 7.0 and 8.0. vSAN FS could be enabled with domain configurations, or be disabled by setting switch to
false
.Please note in this change, FS domain reconfiguration is not supported, this will be implemented in future.
Following is an example for .tf file.
Acceptance tests
Output from acceptance testing:
Release Note
Release note for CHANGELOG:
References
#1965