Hi, I am seeing code `NicInUse` when replacing my ...
# azure
r
Hi, I am seeing code
NicInUse
when replacing my VM with a new one:
Copy code
error: Code="NicInUse" Message="Network Interface scraper-nic6417d4c0 is used by existing resource /subscriptions/74855d4a-57bd-4216-8481-6ff689bc3fca/resourceGroups/scraper-rg/providers/Microsoft.Compute/virtualMachines/scraper-vm-22a0ae59. In order to delete the network interface, it must be dissociated from the resource. To learn more, see <http://aka.ms/deletenic|aka.ms/deletenic>." Details=[]
I've read that I can use
deleteBeforeReplace
. Is there a possibility to delete the vm after replacing it?
b
Blue-green deployment? don't think so.
r
I mean, I want the default behavior of pulumi but the nic needs to be recreated as well. is that possible?
funny enough, the disks are getting duplicated without deletion but the NIC does not
c
Can you use a vmss instead of creating a vm directly? If you are going to be replacing the vm often, maybe a vmss would work better. (I am assuming Azure's vm scale sets function similar to AWS and GCP's launch/instance templates.)
r
probably but it just adds complexity