-
Notifications
You must be signed in to change notification settings - Fork 30
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
Two NICs on a single VM : VM systematically replaced with primary_nic #424
Comments
Hi @ArnaultMICHEL, Best regards, |
Hi @ArnaultMICHEL,
It will work until adding an other nic through I advise you to use: ...
resource "outscale_vm" "myvm" {
...
primary_nic {
nic_id = outscale_nic.myvm_nic01.nic_id
device_number = "0"
}
...
}
...
resource "outscale_nic_link" "nic_link01" {
device_number = "1"
vm_id = outscale_vm.myvm.vm_id
nic_id = outscale_nic.myvm_nic02.nic_id
} We will fix this issues soon Best regards, |
in my use case, i want to be 100% sure that the two NICs exists during the first boot of the OS (& cloudinit configuration operations). So, from my understanding, this is how terraform manage dependencies with resources
So when you use I simply want to avoid that and don't use FYI, we faced a similar issue with disk/volume ressource, when we populate a large number of VMs and volumes. |
Fixed in v0.12.0 |
Terraform Version
Terraform Configuration Files
Output
the first
terraform apply
will create the VM.But the next
terraform apply
with the same terraform code will replaced the VM.Expected Behavior
I suggest two ways to fix it :
terraform apply
if mixingprimary_nic
withnics
nics
blocks if a VM has multiple NICS ( and removeprimary_nic
block?)Adding a code sample for "Create a VM with two NIC" in the documentation would be great +1
Actual Behavior
Will replace (destroy & recreate) the VM on each
terraform apply
, even if the terraform code didn't changeSteps to Reproduce
terraform init
terraform apply
-> the vm will be created 🆗terraform apply
->Workaround
I found that it is working as expected using two
nics
instead ofprimary_nic
+nics
:Documentation
the documentation for outscale provider invite the user/devops to use
primary_nic
withnics
:nics - (Optional) One or more NICs. If you specify this parameter, you must not specify the subnet_id and subregion_name parameters. To define a NIC as the primary network interface of the VM, use the primary_nic argument.
Complete terraform code to reproduce
load your secrets in env vars
the apply the following main.tf file
The text was updated successfully, but these errors were encountered: