Hello,
recently I’ve been deploying Proxmox VM’s and while configuring the power driver for Proxmox I got the duplicate entry :
duplicate key value violates unique constraint "maasserver_bmc_power_type_parameters_idx" DETAIL: Key (power_type, md5(power_parameters::text))=(proxmox, 9908f56baf408761673418d593f495e0) already exists.
I’ve tried password, API key, IP address as host, FQDN as hostname.. But it seems like the guid is being generated without using the VM ID nr? Because that’s the only thing that is different in the power configuration.
Hello @inimoek
MAAS stores the power parameters as a JSON string in the database. However those that have secret=True are stored in a separate location.
settings = [
make_setting_field(
"power_address", "Proxmox host name or IP", required=True
),
make_setting_field(
"power_user", "Proxmox username, including realm", required=True
),
make_setting_field(
"power_pass",
"Proxmox password, required if a token name and secret aren't "
"given",
field_type="password",
secret=True,
),
make_setting_field("power_token_name", "Proxmox API token name"),
make_setting_field(
"power_token_secret",
"Proxmox API token secret",
field_type="password",
secret=True,
),
make_setting_field(
"power_vm_name", "Node ID", scope=SETTING_SCOPE.NODE, required=True
),
make_setting_field(
"power_verify_ssl",
"Verify SSL connections with system CA certificates",
field_type="choice",
required=True,
choices=SSL_INSECURE_CHOICES,
default=SSL_INSECURE_NO,
),
]
Hey @troyanov , thanks for the quick reply!
Maybe I’m missing something but what exactly do you mean? Is it something that is there by design? Because for instance this does work for vm’s in vCenter, which have kind of the same way of working. But I could be totally wrong here 
Sorry for not being clear.
Yes, it is by design. What I wanted to say is that MAAS has a unique index on the power parameters database values and it doesn’t allow multiple machines to have a BMC with the same IP+user (for example)
Can you share some steps for the reproducer? Would be great if you can give exact steps (e.g. maas CLI invocations or API calls)
I’ve only checked this from the MAAS UI. So I’ll check how I supply something for reproduction.
The strange thing is that we’ve had multiple VMware VM’s configured with the same power config. Only recently it does not seem to accept new VM’s anymore with the same power configuration.
It seems so counter intuitive although I respect the design decision, in our case it would make sense to not having to make credentials for every VM we create.