vsphere/datastore_structure.go
func flattenDatastoreSummary(d *schema.ResourceData, obj *types.DatastoreSummary) error {
	d.Set("accessible", obj.Accessible)
	d.Set("capacity", structure.ByteToMB(obj.Capacity))
	d.Set("free_space", structure.ByteToMB(obj.FreeSpace))
	d.Set("maintenance_mode", obj.MaintenanceMode)
	d.Set("multiple_host_access", obj.MultipleHostAccess)
	d.Set("uncommitted_space", structure.ByteToMB(obj.Uncommitted))
	d.Set("url", obj.Url)

	// Set the name attribute off of the name here - since we do not track this
	// here we check for errors
	if err := d.Set("name", obj.Name); err != nil {
		return err
	}
	return nil
}
func flattenDatastoreSummary(d *schema.ResourceData, obj *types.DatastoreSummary) error {
	d.Set("accessible", obj.Accessible)
	d.Set("capacity", structure.ByteToMB(obj.Capacity))
	d.Set("free_space", structure.ByteToMB(obj.FreeSpace))
	d.Set("maintenance_mode", obj.MaintenanceMode)
	d.Set("multiple_host_access", obj.MultipleHostAccess)
	d.Set("uncommitted_space", structure.ByteToMB(obj.Uncommitted))
	d.Set("url", obj.Url)

	// Set the name attribute off of the name here - since we do not track this
	// here we check for errors
	if err := d.Set("name", obj.Name); err != nil {
		return err
	}
	return nil
}
// flattenDatastoreSummary reads various fields from a DatastoreSummary into
// the passed in ResourceData.