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

Unable to import Managed Disk #77

Closed
yukihonhk opened this issue Apr 26, 2022 · 7 comments · Fixed by #91
Closed

Unable to import Managed Disk #77

yukihonhk opened this issue Apr 26, 2022 · 7 comments · Fixed by #91
Labels
question Further information is requested

Comments

@yukihonhk
Copy link

Unable to import Managed Disk. e.g. if the VM has 3 attached managed disks, only the OS disk can be imported.

@magodo
Copy link
Collaborator

magodo commented Apr 26, 2022

@yukihonhk Thank you for submitting this! I'm wondering the symptom of the issue, is the import raise error, or something else?

@magodo magodo added the question Further information is requested label Apr 26, 2022
@yukihonhk
Copy link
Author

yukihonhk commented Apr 26, 2022

@magodo, thank you for your reply. There is no error during "import" but I found the main.tf file does not include the "managed data disk" for the VMs. Hence, failed to import the attached data disk for the VM.

@magodo
Copy link
Collaborator

magodo commented Apr 27, 2022

@yukihonhk You shall ensure during the interactive stage, all the managed data disks are correctly mapped to the TF resource from their Azure resource ID, otherwise, they'll be skipped from importing.

@yukihonhk
Copy link
Author

@magodo Thank you for your feedback. However, during the interactive stage, I can't see any managed data disks available for mapping to the TF resource (I can only see VM, network interface, etc but no managed disk resource). Attached the screen cap for your quick reference.
Screenshot 2
Screenshot 3
Screenshot 1

@magodo
Copy link
Collaborator

magodo commented Apr 27, 2022

@yukihonhk Thank you for providing the details! This indicates the managed data disk is missing in the exported ARM template in this resource group scope. Would you please confirm this in Portal via exporting ARM template?

@yukihonhk
Copy link
Author

@magodo I can see the data disk in the ARM template. Attached the screen cap for your info.

image

@magodo
Copy link
Collaborator

magodo commented Apr 27, 2022

@yukihonhk 👆 shows the managed disk is referenced by the VM, but didn't mean the exported ARM template includes the managed disk as a separate resource. In this case, the only way to include them is via https://github.com/magodo/tfadd to manually import and generate config for it. Note that you have to manually add the dependency between the managed disk and the VM afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants