question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to create a virtualmachine from a customimage with SSD disk?

See original GitHub issue

Query/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:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kurtzeborncommented, May 20, 2019

Thank you for opening this issue! We are routing it to the appropriate team for follow up.

0reactions
msftbot[bot]commented, Sep 11, 2019

Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found