-
Notifications
You must be signed in to change notification settings - Fork 192
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
nil OS profile in response - Cannot export VMs (but able to export other resources types) #412
Comments
Hey @JavierCCC, could you try running |
@JavierCCC This is an error raised by |
If run this query (search for VMs with null osProfile) using Resource Graph Explorer resources i got 265 VMs. If i run the opossite query (search for VMs with an osProfile) | where type == "microsoft.compute/virtualmachines" i got 189 VMs So, a big portion of my VMs has osProfile = null. 70% of those VMs are Windows Server VMs. Almost all VMs (Windows and Linux) are running Azure images (not custom). So, im not sure if this is something i must escalte to MS support or not. |
Just the same error. If the VMs doesn't have an osProfile, they are skipped by aztfexport. Its seems to be partially related to the product we use to manage spot instances. All the VMs with spot instances are VMs with nil osProfile, but there are more VMs with nil osProfile for wich i don't have an explanation yet. |
The osProfile property does not seems to hold enough information to identify the OS of a VM, just the kind (windows or linux given the presence of a linuxConfiguration or a windowsConfiguration block): Windows:
Linux:
The property that holds more specific information regarding OS seems to be "imageReference" Windows
Linux
|
@JavierCCC Thanks for the additional info! Would you mind to query whether all these VMs have |
After running resources I can see there is a "Windows" or "Linux" for each VM, and the data its ok for all VMs. |
@magodo should i try with a local build from main branch? |
@JavierCCC Yes, by doing |
XXXX@XXXXXXXXXXXXXXX:~/aztfexport$ ../go/bin/aztfexport query --continue --non-interactive --recursive 'type == "microsoft.compute/virtualmachines" and name == "XXXXXXXXX"' Error: The "azurerm_windows_virtual_machine" resource doesn't support attaching OS Disks - please use the Running fine with VMs with no nil osProfile. |
@JavierCCC Thanks for the feedback, I'll make another fix for this! |
When i run:
aztfexport query --log-path /tmp/tfy.log -r 'type == "microsoft.compute/virtualmachines" and resourceGroup == "my_rg"'
I get all vm listed as "skipped". There is one log entry per vm that look like this:
2023-06-07T11:16:57.883-0300 [WARN] aztfexport: Failed to query resource type for /subscriptions/my_subscrip_id/resourceGroups/my_rg/providers/Microsoft.Compute/virtualMachines/a_vm: /subscriptions/my_subscrip_id/resourceGroups/my_rg/providers/Microsoft.Compute/virtualMachines/a_vm: resolving "/subscriptions/my_subscrip_id/resourceGroups/my_rg/providers/Microsoft.Compute/virtualMachines/a_vm": unexpected nil OS profile in response
What am i doing wrong?
Edit: Using resource graph, i see i have some VMs with OSProfile property and some other with no OSProfile property. I was able to export with no issues VMs with OSProfile present.
The text was updated successfully, but these errors were encountered: