-
Notifications
You must be signed in to change notification settings - Fork 455
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
New resource: vsphere_datastore_cluster #436
Conversation
Resource is partially done - part way into read now, also added StoragePod helpers and made a few other touch ups here and there.
Testing is next!
And a few fixes and additions to test helpers to assist. More complex tests coming.
Tests for a number of cases have been added. This should complete the resource for all intents and purposes save documentation.
@@ -191,6 +191,8 @@ func folderFromObject(client *govmomi.Client, obj interface{}, folderType RootPa | |||
p, err = RootPathParticleNetwork.PathFromNewRoot(o.InventoryPath, folderType, relative) | |||
case *object.Datastore: | |||
p, err = RootPathParticleDatastore.PathFromNewRoot(o.InventoryPath, folderType, relative) | |||
case *object.StoragePod: | |||
p, err = RootPathParticleDatastore.PathFromNewRoot(o.InventoryPath, folderType, relative) |
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.
It would be nice if they just used some interfaces occasionally 😢
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.
Not 100% ruling out there could be some refactoring here, and InventoryPath
is part of a Common
object that everything embeds, but we still need to know what kind of object is being passed in, and there is no common interface for say datastore clusters. In fact, this would not 100% work here even if there was, as for example, StoragePod
actually would inherit from Folder
versus Datastore
- and indeed emebeds that object instead of Datastore
. 😛
ValidateFunc: validation.StringInSlice(storageDrsPodConfigInfoBehaviorAllowedValues, false), | ||
}, | ||
"sdrs_load_balance_interval": { | ||
Type: schema.TypeInt, |
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 wonder if it would be better UX to express this as a string
/time.Duration
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 think this is minor, especially in the face of if we changed it here to something like 60m
/1h
/2d
, we would probably need to change it everywhere, else we risk harming the UX more than enriching it.
Thanks @paultyng! |
This is the first part of a new push to add clustering and DRS support in the vSphere provider.
This adds
vsphere_datastore_cluster
, which can be used to create datastore clusters and configure Storage DRS for it respectively. Pretty much everything that's exposed in vSphere is exposed in the resource.Note that the docs reference functionality that is not implemented yet - this is the
datastore_cluster_id
attribute, which will basically be a "pseudo-folder" attribute and conflict withfolder
in thevsphere_nas_datastore
andvsphere_vmfs_datastore
resources, allowing a datastore to be created in or moved to a datastore cluster.After this support is in and functional we can use it to start writing datastore cluster support into the
vsphere_virtual_machine
resource to address #2.