Skip to content
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

Importing VM's with no OSProfile #197

Closed
PaulShay66 opened this issue Aug 5, 2022 · 0 comments · Fixed by #198
Closed

Importing VM's with no OSProfile #197

PaulShay66 opened this issue Aug 5, 2022 · 0 comments · Fixed by #198
Labels
enhancement New feature or request

Comments

@PaulShay66
Copy link

PaulShay66 commented Aug 5, 2022

Hi,
I have been using Azure Migrate to move on-prem hyper-v VM's to Azure. These will sit in terraformed Vnets, subnets and resource groups. I'd like to bring these machines into the fold using aztfy.
Unfortunately I get an error:

"Error: /subscriptions/*****************/resourceGroups/rt-1-pr-euw-bfxapp-rsg-01/providers/Microsoft.Compute/virtualMachines/HYPAPPRT110: resolving "/subscriptions/****************/resourceGroups/rt-1-pr-euw-bfxapp-rsg-01/providers/Microsoft.Compute/virtualMachines/HYPAPPRT110": unexpected nil OS profile in response"

When I investigated there was indeed no OSProfile section in the Export Template for migrated VM's.
Our Azure VM's created with the old ARM templates or CLI'd have the OSProfile present and correct and can play nicely with aztfy.

Is there a workaround or are there plans to tackle this issue?

Thanks.
Paul.

EDIT: I found I could use terraform import to drag the VM into a state file then use tfadd to create the code. Looking in the state file I can find where the 'nil OS profile' is coming from:
"os_profile": [],
"os_profile_linux_config": [],
"os_profile_secrets": [],
"os_profile_windows_config": [],
"plan": [],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants