Skip to content
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

Feature request: Set advanced settings on disks #119

Closed
cospeedster opened this issue Dec 3, 2019 · 13 comments
Closed

Feature request: Set advanced settings on disks #119

cospeedster opened this issue Dec 3, 2019 · 13 comments

Comments

@cospeedster
Copy link

It would be a good extension to this provider, if the advanced settings on disks can be set.

From Proxmox manual:

Details
aio=<native | threads>
    AIO type to use.
backup=<boolean>
    Whether the drive should be included when making backups.
bps=<bps>
    Maximum r/w speed in bytes per second.
bps_max_length=<seconds>
    Maximum length of I/O bursts in seconds.
bps_rd=<bps>
    Maximum read speed in bytes per second.
bps_rd_max_length=<seconds>
    Maximum length of read I/O bursts in seconds.
bps_wr=<bps>
    Maximum write speed in bytes per second.
bps_wr_max_length=<seconds>
    Maximum length of write I/O bursts in seconds.
cache=<directsync | none | unsafe | writeback | writethrough>
    The drive’s cache mode
cyls=<integer>
    Force the drive’s physical geometry to have a specific cylinder count.
detect_zeroes=<boolean>
    Controls whether to detect and try to optimize writes of zeroes.
discard=<ignore | on>
    Controls whether to pass discard/trim requests to the underlying storage.
file=<volume>
    The drive’s backing volume.
format=<cloop | cow | qcow | qcow2 | qed | raw | vmdk>
    The drive’s backing file’s data format.
heads=<integer>
    Force the drive’s physical geometry to have a specific head count.
iops=<iops>
    Maximum r/w I/O in operations per second.
iops_max=<iops>
    Maximum unthrottled r/w I/O pool in operations per second.
iops_max_length=<seconds>
    Maximum length of I/O bursts in seconds.
iops_rd=<iops>
    Maximum read I/O in operations per second.
iops_rd_max=<iops>
    Maximum unthrottled read I/O pool in operations per second.
iops_rd_max_length=<seconds>
    Maximum length of read I/O bursts in seconds.
iops_wr=<iops>
    Maximum write I/O in operations per second.
iops_wr_max=<iops>
    Maximum unthrottled write I/O pool in operations per second.
iops_wr_max_length=<seconds>
    Maximum length of write I/O bursts in seconds.
iothread=<boolean>
    Whether to use iothreads for this drive
mbps=<mbps>
    Maximum r/w speed in megabytes per second.
mbps_max=<mbps>
    Maximum unthrottled r/w pool in megabytes per second.
mbps_rd=<mbps>
    Maximum read speed in megabytes per second.
mbps_rd_max=<mbps>
    Maximum unthrottled read pool in megabytes per second.
mbps_wr=<mbps>
    Maximum write speed in megabytes per second.
mbps_wr_max=<mbps>
    Maximum unthrottled write pool in megabytes per second.
media=<cdrom | disk> (default = disk)
    The drive’s media type.
queues=<integer> (2 - N)
    Number of queues.
replicate=<boolean> (default = 1)
    Whether the drive should considered for replication jobs.
rerror=<ignore | report | stop>
    Read error action.
scsiblock=<boolean> (default = 0)
    whether to use scsi-block for full passthrough of host block device
 secs=<integer>
    Force the drive’s physical geometry to have a specific sector count.
serial=<serial>
    The drive’s reported serial number, url-encoded, up to 20 bytes long.
shared=<boolean> (default = 0)
    Mark this locally-managed volume as available on all nodes. 
 size=<DiskSize>
    Disk size. This is purely informational and has no effect.
snapshot=<boolean>
    Controls qemu’s snapshot mode feature. If activated, changes made to the disk are temporary and will be discarded when the VM is shutdown.
ssd=<boolean>
    Whether to expose this drive as an SSD, rather than a rotational hard disk.
trans=<auto | lba | none>
    Force disk geometry bios translation mode.
werror=<enospc | ignore | report | stop>
    Write error action.
wwn=<wwn>
    The drive’s worldwide name, encoded as 16 bytes hex string, prefixed by 0x.

Especially I'm interested on setting speed limits for disks.

Hopefully, anyone can implement this. 😀

@V-Paranoiaque
Copy link
Contributor

Hello @cospeedster
I will have a look, I'm interested too.
I think mbps, mbps_rd and mbps_wr are enough, what is your opinion?

@cospeedster
Copy link
Author

Hi @V-Paranoiaque,
I'll need these four:

  • mbps_rd
  • mbps_rd_max
  • mbps_wr
  • mbps_wr_max

Additional to this, it would be very helpful, if we can set the vcpus optional in the resource. Maybe you can look at it, too?

@V-Paranoiaque
Copy link
Contributor

vcpus looks easier to implement, but maybe better @cospeedster to create a second issue

@cospeedster
Copy link
Author

Okay, I'll do this shortly. You're right! ;-)

@cospeedster
Copy link
Author

I opened it here #120.

@V-Paranoiaque
Copy link
Contributor

I have added the 5 options @cospeedster, waiting your validation before making the PR
https://github.com/V-Paranoiaque/terraform-provider-proxmox/tree/feature/mbps

@cospeedster
Copy link
Author

@V-Paranoiaque
As far as I can evaluate this, it looks good for me. Sadly, I'm not so familiar with go. Am I right that something need to be changed on the API?

Is the following right?
If i just set mbps it will affect mbps_rd and mbps_wr. So I have the choice to set just mbps or mbps_rd and mbps_wr?

@V-Paranoiaque
Copy link
Contributor

No need to modify the API, it's just an extra parameter who will be generated automatically.
I suppose, I have used the documentation.

@cospeedster
Copy link
Author

Okay, that sounds great!

@V-Paranoiaque
Copy link
Contributor

#125

@cospeedster
Copy link
Author

Setting does not work on disk0 for me.
On additional disks it works.
For example, I set:

      mbps_rd      = 250
      mbps_rd_max  = 250
      mbps_wr      = 250
      mbps_wr_max  = 250

@V-Paranoiaque
Copy link
Contributor

For disk0
Telmate/proxmox-api-go#72

@cospeedster
Copy link
Author

This worked for me! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants