How to create a virtualmachine from a customimage with SSD disk?
See original GitHub issueQuery/Question How can I create a new virtual machine with an SSD OS Disk, using an existing custom image.
We use the following snippet to get the image
var vmImage = _azure.VirtualMachineCustomImages
.ListByResourceGroup(_resourceGroupName)
.SingleOrDefault(ci => ci.Name.Equals(_serverImageName, StringComparison.OrdinalIgnoreCase));
and the following snippet to create the VM
var vm = await _azure.VirtualMachines.Define(vmName)
.WithRegion(_region)
.WithExistingResourceGroup(_resourceGroupName)
.WithNewPrimaryNetworkInterface(networkInterface)
.WithWindowsCustomImage(vmImage.Id)
.WithAdminUsername(vmWindowsAdminUser)
.WithAdminPassword(vmWindowsAdminPassword)
.WithTimeZone("W. Europe Standard Time")
.WithSize(VirtualMachineSizeTypes.StandardD4sV3)
.WithTags(tags)
.CreateAsync()
.ConfigureAwait(false);
Why is this not a Bug or a feature Request? Searching the web, it seems that this is possible, however, I cannot find the fluent API to do this.
Setup (please complete the following information if applicable):
- OS:Windows
- IDE : .NET
- Microsoft.Azure.Management.Fluent 1.22.0
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- Query Added
- Setup information Added
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Attach an existing OS disk to a VM - Azure Virtual Machines
Create a snapshot and then create a disk from the snapshot. This strategy allows you to keep the original VHD as a fallback:...
Read more >Build a custom VM image for Azure deployments
Follow this step-by-step guide to create a custom virtual machine image for Microsoft Azure deployments. ; Step 3. Convert to VHD format.
Read more >Azure SDK C# - Create VM from Image with specified disk ...
We are using the Azure SDK in a C# .NET Core application to create Azure VMs on demand. At the moment, the VMs...
Read more >Create VM instances from machine images
Click New VM instance from machine image. Select your machine image and click Continue. Optional: Customize the VM details. Click Create.
Read more >Add a New Hard Disk to a Virtual Machine
Right-click a virtual machine in the inventory and select Edit Settings. · On the Virtual Hardware tab, click the Add New Device button....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for opening this issue! We are routing it to the appropriate team for follow up.
Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.