diff --git a/CHANGELOG.md b/CHANGELOG.md index 879cfbe..e430850 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.3.2 + +- Raised `max_version` to `4.7.99`; verified against NetBox 4.7.2 (the plugin was skipped on 4.7.2 before). +- Restored migrations `0003`–`0006`, which had been deleted while the model still uses their fields + (`provider`, `auth_method`, `token_name`, timeouts, retries, `sync_lxc_containers`). Fresh + installations were missing these columns. Existing installations already have them recorded as + applied, so nothing changes there. + ## 0.3.1 - Fixed Django migration dependencies for NetBox 4.6.5 through 4.6.8. diff --git a/netbox_vmware_importer/__init__.py b/netbox_vmware_importer/__init__.py index a171d37..3f18dc8 100644 --- a/netbox_vmware_importer/__init__.py +++ b/netbox_vmware_importer/__init__.py @@ -5,11 +5,11 @@ class VMwareImporterConfig(PluginConfig): name = "netbox_vmware_importer" verbose_name = "NetBox VMware Importer" description = "Synchronize VMware vSphere virtual machines into NetBox." - version = "0.3.1" + version = "0.3.2" author = "Codex & Claude" base_url = "vmware-importer" min_version = "4.6.5" - max_version = "4.7.1" + max_version = "4.7.99" def ready(self): super().ready() diff --git a/netbox_vmware_importer/migrations/0003_add_proxmox_endpoint_fields.py b/netbox_vmware_importer/migrations/0003_add_proxmox_endpoint_fields.py new file mode 100644 index 0000000..75e202f --- /dev/null +++ b/netbox_vmware_importer/migrations/0003_add_proxmox_endpoint_fields.py @@ -0,0 +1,69 @@ +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("netbox_vmware_importer", "0002_align_netbox_46_model_state"), + ] + + operations = [ + migrations.AlterField( + model_name="vcenterendpoint", + name="host", + field=models.CharField(help_text="vCenter, ESXi, or Proxmox VE hostname or IP address", max_length=255), + ), + migrations.AlterField( + model_name="vcenterendpoint", + name="validate_ssl", + field=models.BooleanField(default=False, help_text="Validate the endpoint TLS certificate."), + ), + migrations.AlterField( + model_name="vcenterendpoint", + name="cluster", + field=models.ForeignKey( + help_text="NetBox cluster into which hypervisor VMs will be synchronized.", + on_delete=django.db.models.deletion.PROTECT, + related_name="vmware_import_endpoints", + to="virtualization.cluster", + ), + ), + migrations.AddField( + model_name="vcenterendpoint", + name="provider", + field=models.CharField( + choices=[ + ("vmware", "VMware vSphere"), + ("proxmox", "Proxmox VE"), + ], + default="vmware", + max_length=30, + ), + ), + migrations.AddField( + model_name="vcenterendpoint", + name="auth_method", + field=models.CharField( + choices=[ + ("password", "Username/password"), + ("api_token", "API token"), + ], + default="password", + max_length=30, + ), + ), + migrations.AddField( + model_name="vcenterendpoint", + name="token_name", + field=models.CharField( + blank=True, + help_text="Proxmox API token ID, e.g. netbox-import. The token secret is stored in the password field.", + max_length=100, + ), + ), + migrations.AddField( + model_name="vcenterendpoint", + name="sync_lxc_containers", + field=models.BooleanField(default=True, verbose_name="Sync Proxmox LXC containers"), + ), + ] diff --git a/netbox_vmware_importer/migrations/0004_add_endpoint_api_timeout.py b/netbox_vmware_importer/migrations/0004_add_endpoint_api_timeout.py new file mode 100644 index 0000000..5e473aa --- /dev/null +++ b/netbox_vmware_importer/migrations/0004_add_endpoint_api_timeout.py @@ -0,0 +1,23 @@ +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("netbox_vmware_importer", "0003_add_proxmox_endpoint_fields"), + ] + + operations = [ + migrations.AddField( + model_name="vcenterendpoint", + name="request_timeout_seconds", + field=models.PositiveIntegerField( + default=120, + help_text="HTTP/API read timeout in seconds.", + validators=[ + django.core.validators.MinValueValidator(5), + django.core.validators.MaxValueValidator(600), + ], + ), + ), + ] diff --git a/netbox_vmware_importer/migrations/0005_add_proxmox_connection_tuning.py b/netbox_vmware_importer/migrations/0005_add_proxmox_connection_tuning.py new file mode 100644 index 0000000..5f91dcd --- /dev/null +++ b/netbox_vmware_importer/migrations/0005_add_proxmox_connection_tuning.py @@ -0,0 +1,51 @@ +import decimal + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("netbox_vmware_importer", "0004_add_endpoint_api_timeout"), + ] + + operations = [ + migrations.AddField( + model_name="vcenterendpoint", + name="connect_timeout_seconds", + field=models.PositiveIntegerField( + default=10, + help_text="TCP/TLS connection timeout in seconds.", + validators=[ + django.core.validators.MinValueValidator(1), + django.core.validators.MaxValueValidator(120), + ], + ), + ), + migrations.AddField( + model_name="vcenterendpoint", + name="max_retries", + field=models.PositiveSmallIntegerField( + default=0, + help_text="Retries for safe Proxmox GET requests when the endpoint returns transient errors.", + validators=[ + django.core.validators.MinValueValidator(0), + django.core.validators.MaxValueValidator(10), + ], + ), + ), + migrations.AddField( + model_name="vcenterendpoint", + name="retry_backoff_seconds", + field=models.DecimalField( + decimal_places=2, + default=decimal.Decimal("0.50"), + help_text="Exponential retry backoff base delay in seconds.", + max_digits=5, + validators=[ + django.core.validators.MinValueValidator(decimal.Decimal("0.00")), + django.core.validators.MaxValueValidator(decimal.Decimal("60.00")), + ], + ), + ), + ] diff --git a/netbox_vmware_importer/migrations/0006_remove_proxmox_sync_support.py b/netbox_vmware_importer/migrations/0006_remove_proxmox_sync_support.py new file mode 100644 index 0000000..9692c43 --- /dev/null +++ b/netbox_vmware_importer/migrations/0006_remove_proxmox_sync_support.py @@ -0,0 +1,106 @@ +import decimal + +import django.core.validators +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("netbox_vmware_importer", "0005_add_proxmox_connection_tuning"), + ] + + operations = [ + migrations.AlterModelOptions( + name="vcenterendpoint", + options={ + "ordering": ("name",), + "verbose_name": "VMware endpoint", + "verbose_name_plural": "VMware endpoints", + }, + ), + migrations.AlterField( + model_name="vcenterendpoint", + name="provider", + field=models.CharField( + choices=[ + ("vmware", "VMware vSphere"), + ("proxmox", "Proxmox VE (legacy)"), + ], + default="vmware", + max_length=30, + ), + ), + migrations.AlterField( + model_name="vcenterendpoint", + name="auth_method", + field=models.CharField( + choices=[ + ("password", "Username/password"), + ("api_token", "API token (legacy)"), + ], + default="password", + max_length=30, + ), + ), + migrations.AlterField( + model_name="vcenterendpoint", + name="host", + field=models.CharField(help_text="vCenter or ESXi hostname or IP address", max_length=255), + ), + migrations.AlterField( + model_name="vcenterendpoint", + name="validate_ssl", + field=models.BooleanField(default=False, help_text="Validate the VMware endpoint certificate."), + ), + migrations.AlterField( + model_name="vcenterendpoint", + name="cluster", + field=models.ForeignKey( + help_text="NetBox cluster into which VMware VMs will be synchronized.", + on_delete=django.db.models.deletion.PROTECT, + related_name="vmware_import_endpoints", + to="virtualization.cluster", + ), + ), + migrations.AlterField( + model_name="vcenterendpoint", + name="token_name", + field=models.CharField( + blank=True, + help_text="Legacy Proxmox API token ID. Kept only for deleting old endpoints.", + max_length=100, + ), + ), + migrations.AlterField( + model_name="vcenterendpoint", + name="max_retries", + field=models.PositiveSmallIntegerField( + default=0, + help_text="Legacy connection retry setting. Kept only for compatibility with older plugin versions.", + validators=[ + django.core.validators.MinValueValidator(0), + django.core.validators.MaxValueValidator(10), + ], + ), + ), + migrations.AlterField( + model_name="vcenterendpoint", + name="retry_backoff_seconds", + field=models.DecimalField( + decimal_places=2, + default=decimal.Decimal("0.50"), + help_text="Exponential retry backoff base delay in seconds.", + max_digits=5, + validators=[ + django.core.validators.MinValueValidator(decimal.Decimal("0.00")), + django.core.validators.MaxValueValidator(decimal.Decimal("60.00")), + ], + ), + ), + migrations.AlterField( + model_name="vcenterendpoint", + name="sync_lxc_containers", + field=models.BooleanField(default=True, verbose_name="Sync legacy Proxmox LXC containers"), + ), + ] diff --git a/pyproject.toml b/pyproject.toml index 5855449..f5dd3f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "netbox-vmware-importer" -version = "0.3.1" +version = "0.3.2" description = "NetBox plugin to synchronize VMware vSphere virtual machines into NetBox." readme = "README.md" requires-python = ">=3.12"