-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add computed data to VDC storage profile data source #782
Conversation
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
vcd/resource_vcd_vapp_vm.go
Outdated
@@ -653,6 +653,9 @@ func genericResourceVmCreate(d *schema.ResourceData, meta interface{}, vmType ty | |||
vmComputePolicy = nil | |||
} | |||
vmTemplate := vmTemplatefromVappTemplate(d.Get("vm_name_in_template").(string), vappTemplate.VAppTemplate) | |||
if vmTemplate == nil { | |||
return fmt.Errorf("[VM creation] vm template isn't found. Please check vApp templat %s : %s", vmName, 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.
return fmt.Errorf("[VM creation] vm template isn't found. Please check vApp templat %s : %s", vmName, err) | |
return fmt.Errorf("[VM creation] VM template isn't found. Please check vApp template %s : %s", vmName, 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.
fixed
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
* `limit` - Maximum number of storage bytes (scaled by Units) allocated for this profile. A value of 0 is understood to mean `maximum possible` | ||
* `used_storage` - Storage used, in Megabytes, by the storage profile | ||
* `default` - True if this is default storage profile for this vDC. The default storage profile is used when an object that can specify a storage profile is created with no storage profile specified | ||
* `enabled` - True if this storage profile is enabled for use in the vDC" |
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 we use Org
and VDC
* `enabled` - True if this storage profile is enabled for use in the vDC" | |
* `enabled` - True if this storage profile is enabled for use in the VDC" |
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.
fixed
|
||
* `limit` - Maximum number of storage bytes (scaled by Units) allocated for this profile. A value of 0 is understood to mean `maximum possible` | ||
* `used_storage` - Storage used, in Megabytes, by the storage profile | ||
* `default` - True if this is default storage profile for this vDC. The default storage profile is used when an object that can specify a storage profile is created with no storage profile specified |
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.
* `default` - True if this is default storage profile for this vDC. The default storage profile is used when an object that can specify a storage profile is created with no storage profile specified | |
* `default` - True if this is default storage profile for this VDC. The default storage profile is used when an object that can specify a storage profile is created with no storage profile specified |
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.
fixed
(Supported in provider *v3.6+*) | ||
|
||
* `limit` - Maximum number of storage bytes (scaled by Units) allocated for this profile. A value of 0 is understood to mean `maximum possible` | ||
* `used_storage` - Storage used, in Megabytes, by the storage profile |
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.
Maybe it is just me, but it sounds strange - could this be simpler.
* `used_storage` - Storage used, in Megabytes, by the storage profile | |
* `used_storage` - Storage used, by the storage profile (in Megabytes) |
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.
changed
This data source exports only `id` field. | ||
(Supported in provider *v3.6+*) | ||
|
||
* `limit` - Maximum number of storage bytes (scaled by Units) allocated for this profile. A value of 0 is understood to mean `maximum possible` |
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.
* `limit` - Maximum number of storage bytes (scaled by Units) allocated for this profile. A value of 0 is understood to mean `maximum possible` | |
* `limit` - Maximum number of storage bytes (scaled by 'units' field) allocated for this profile. A value of 0 is understood to mean `maximum possible` |
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
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
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.
A few more inconsistencies in docs, but the code itself worked in my manual testing
(Supported in provider *v3.6+*) | ||
|
||
* `limit` - Maximum number of storage bytes (scaled by 'units' field) allocated for this profile. `0` means `maximum possible` | ||
* `used_storage` - Storage used, by the storage profile (in Megabytes) |
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.
* `used_storage` - Storage used by the storage profile (in Megabytes)
* `default` - True if this is default storage profile for this VDC. The default storage profile is used when an object that can specify a storage profile is created with no storage profile specified | ||
* `enabled` - True if this storage profile is enabled for use in the VDC | ||
* `iops_allocated` - Total IOPS currently allocated to this storage profile | ||
* `units` - Scale used to define Limit |
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.
* `units` - Scale used to define Limit | |
* `units` - Scale used to define limit |
* `maximum_disk_iops` - The maximum IOPS value that this storage profile is permitted to deliver. Value of 0 means this max setting is disabled and there is no max disk IOPS restriction | ||
* `default_disk_iops` - Value of 0 for disk IOPS means that no IOPS would be reserved or provisioned for that virtual disk | ||
* `disk_iops_per_gb_max` - The maximum disk IOPs per GB value that this storage profile is permitted to deliver. A value of 0 means there is no per GB IOPS restriction | ||
* `iops_limit` - Maximum number of IOPs that can be allocated for this profile. `0` means `maximum possible` |
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.
* `iops_limit` - Maximum number of IOPs that can be allocated for this profile. `0` means `maximum possible` | |
* `iops_limit` - Maximum number of IOPS that can be allocated for this profile. `0` means `maximum possible` |
* `iops_limiting_enabled` - True if this storage profile is IOPS-based placement enabled | ||
* `maximum_disk_iops` - The maximum IOPS value that this storage profile is permitted to deliver. Value of 0 means this max setting is disabled and there is no max disk IOPS restriction | ||
* `default_disk_iops` - Value of 0 for disk IOPS means that no IOPS would be reserved or provisioned for that virtual disk | ||
* `disk_iops_per_gb_max` - The maximum disk IOPs per GB value that this storage profile is permitted to deliver. A value of 0 means there is no per GB IOPS restriction |
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.
* `disk_iops_per_gb_max` - The maximum disk IOPs per GB value that this storage profile is permitted to deliver. A value of 0 means there is no per GB IOPS restriction | |
* `disk_iops_per_gb_max` - The maximum disk IOPS per GB value that this storage profile is permitted to deliver. A value of 0 means there is no per GB IOPS restriction |
"iops_limit": &schema.Schema{ | ||
Type: schema.TypeInt, | ||
Computed: true, | ||
Description: "Maximum number of IOPs that can be allocated for this profile. `0` means `maximum possible`", |
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.
Description: "Maximum number of IOPs that can be allocated for this profile. `0` means `maximum possible`", | |
Description: "Maximum number of IOPS that can be allocated for this profile. `0` means `maximum possible`", |
"units": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "Scale used to define Limit", |
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.
Description: "Scale used to define Limit", | |
Description: "Scale used to define limit", |
"used_storage": &schema.Schema{ | ||
Type: schema.TypeInt, | ||
Computed: true, | ||
Description: "Storage used, in Megabytes, by the storage profile", |
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.
Description: "Storage used, in Megabytes, by the storage profile", | |
Description: "Storage used, by the storage profile (in Megabytes)", |
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.
LGTM!
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
ref: #692, #605
dep: vmware/go-vcloud-director#435
Added additional information returned from API to be written to state.
Additional fields:
IOPS settings details: