We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c9466b commit c956b1cCopy full SHA for c956b1c
1 file changed
linode_api4/objects/linode.py
@@ -42,6 +42,9 @@
42
from linode_api4.util import drop_null_keys, generate_device_suffixes
43
44
PASSWORD_CHARS = string.ascii_letters + string.digits + string.punctuation
45
+MIN_DEVICE_LIMIT = 8
46
+MEMORY_DIVISOR = 1024
47
+MAX_DEVICE_LIMIT = 64
48
49
50
class InstanceDiskEncryptionType(StrEnum):
@@ -1259,7 +1262,7 @@ def config_create(
1259
1262
1260
1263
hypervisor_prefix = "sd" if self.hypervisor == "kvm" else "xvd"
1261
1264
- device_limit = int(max(8, min(self.specs.memory // 1024, 64)))
1265
+ device_limit = int(max(MIN_DEVICE_LIMIT, min(self.specs.memory // MEMORY_DIVISOR, MAX_DEVICE_LIMIT)))
1266
1267
device_names = [
1268
hypervisor_prefix + suffix
0 commit comments