https://pulumi.com logo
#azure
Title
# azure
r

ripe-xylophone-26538

01/12/2024, 8:02 AM
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

bumpy-glass-30283

01/12/2024, 9:08 AM
Blue-green deployment? don't think so.
r

ripe-xylophone-26538

01/12/2024, 9:14 AM
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

clever-sunset-76585

01/12/2024, 3:50 PM
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

ripe-xylophone-26538

01/13/2024, 7:39 PM
probably but it just adds complexity