Repository: netbox-community/netbox

Issue:
Change maximum possible power draw from 32767 Watt
### NetBox version

v3.3.8

### Feature type

Change to existing functionality

### Proposed functionality

Increase the maximum possible power draw from ~32kW to any positive value.

### Use case

We tried to map our (hardwired) UPS-systems in NetBox, they have a possible power output of more than 120kW.

### Database changes

Probably none required.

### External dependencies

Probably none required.


Discussion:
Please provide more detail about your specific use case.
Ok, we have a [Riello MPW 300 ](https://www.riello-ups.com/products/1-ups/94-multi-power) mapped as an unracked device with 2 communication module slots (For [Network-Modules](https://www.riello-ups.com/products/4-software-connectivity/85-netman-204)) and Power Module Slots (NetBox used for Inventory Tracking of Power Modules).

Due to the high power demand the UPS is hardwired and can consume/provide up to 125kVA (VA is roughly Watt, depending on power factor) 32kW as maximum for a power port is just not enough, when trying to create a 125kW Power Port in NetBox the following error message appears:
![netbox error message](https://user-images.githubusercontent.com/18295403/204317367-bcae3db3-531d-4845-a254-01b537c7e26d.png)

Does this clear up the use case?


> Does this clear up the use case?

I'm afraid it doesn't. From your description, it sounds like you're attempting to model the aggregate output of an UPS as opposed to an individual connection. Where in your network do you have a _single_ power port consuming more than 32kW of power?
Here in Europe it's a very valid power port. We have extension cords rated for 400V/63A three phase (which turns into a bit over 37kW). And there are [CEE17](https://en.wikipedia.org/wiki/CEE_17) plugs available for up to 800A.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
What revisions are needed, @jeremystretch?

I'm trying to model a couple of [APC PDPM](https://www.se.com/ww/en/product/PDPM277H/apc-modular-remote-power-panel-277kva-400a-400v-72-pole-300mm/)s with Module bays, if that helps.

They're connected with three phase to our UPS system, and have pluggable output modules for different power outlet configurations (3x1~, 3~, 3~ double amperage, and so on)

Resolving patch:
diff --git a/netbox/dcim/migrations/0172_larger_power_draw_values.py b/netbox/dcim/migrations/0172_larger_power_draw_values.py
new file mode 100644
--- /dev/null
+++ b/netbox/dcim/migrations/0172_larger_power_draw_values.py
@@ -0,0 +1,42 @@
+# Generated by Django 4.1.9 on 2023-05-12 18:46
+
+import django.core.validators
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dcim', '0171_cabletermination_change_logging'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='powerport',
+            name='allocated_draw',
+            field=models.PositiveIntegerField(
+                blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
+            ),
+        ),
+        migrations.AlterField(
+            model_name='powerport',
+            name='maximum_draw',
+            field=models.PositiveIntegerField(
+                blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
+            ),
+        ),
+        migrations.AlterField(
+            model_name='powerporttemplate',
+            name='allocated_draw',
+            field=models.PositiveIntegerField(
+                blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
+            ),
+        ),
+        migrations.AlterField(
+            model_name='powerporttemplate',
+            name='maximum_draw',
+            field=models.PositiveIntegerField(
+                blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
+            ),
+        ),
+    ]
diff --git a/netbox/dcim/models/device_component_templates.py b/netbox/dcim/models/device_component_templates.py
--- a/netbox/dcim/models/device_component_templates.py
+++ b/netbox/dcim/models/device_component_templates.py
@@ -232,13 +232,13 @@ class PowerPortTemplate(ModularComponentTemplateModel):
         choices=PowerPortTypeChoices,
         blank=True
     )
-    maximum_draw = models.PositiveSmallIntegerField(
+    maximum_draw = models.PositiveIntegerField(
         blank=True,
         null=True,
         validators=[MinValueValidator(1)],
         help_text=_("Maximum power draw (watts)")
     )
-    allocated_draw = models.PositiveSmallIntegerField(
+    allocated_draw = models.PositiveIntegerField(
         blank=True,
         null=True,
         validators=[MinValueValidator(1)],
diff --git a/netbox/dcim/models/device_components.py b/netbox/dcim/models/device_components.py
--- a/netbox/dcim/models/device_components.py
+++ b/netbox/dcim/models/device_components.py
@@ -329,13 +329,13 @@ class PowerPort(ModularComponentModel, CabledObjectModel, PathEndpoint):
         blank=True,
         help_text=_('Physical port type')
     )
-    maximum_draw = models.PositiveSmallIntegerField(
+    maximum_draw = models.PositiveIntegerField(
         blank=True,
         null=True,
         validators=[MinValueValidator(1)],
         help_text=_("Maximum power draw (watts)")
     )
-    allocated_draw = models.PositiveSmallIntegerField(
+    allocated_draw = models.PositiveIntegerField(
         blank=True,
         null=True,
         validators=[MinValueValidator(1)],


Test patch: