azure-xplat-cli icon indicating copy to clipboard operation
azure-xplat-cli copied to clipboard

Unable to create a VM from a specialized vhd

Open bwhiton opened this issue 9 years ago • 30 comments

CLI Version: 0.9.20 OS Type: Mac Installation via: mac installer

Mode: ARM

Description: When I attempt to create a VM from a specialized vhd, the operation just hangs in 'In Progress' via the cli and shows as 'Creating' in the portal UI.

Steps to reproduce:

  1. Run azure vm create -vv -g bobstestresourceg -n testspecialized2 -f specializedVMNic -l westus -d https://somestorageaccount.blob.core.windows.net/images/testvhd.vhd -z Standard_D1 -i specializedVMPublicIP -S Subnet -F specializedVMVNET -o bobstesting -R vhds -s bobstesting

After getting past all of the verification of public IP, nic, etc., it keeps polling the operation status as follows:

silly: requestOptions silly: { silly: rawResponse: false, silly: queryString: {}, silly: method: 'GET', silly: headers: { user-agent: 'WindowsAzureXplatCLI/0.9.20' }, silly: url: 'https://management.azure.com/subscriptions/guid/providers/Microsoft.Compute/locations/westus/operations/4635f163-517e-49bb-bd97-7e6ea657f7e4?api-version=2016-03-30' silly: } silly: returnObject silly: { silly: statusCode: 200, silly: header: { silly: cache-control: 'no-cache', silly: pragma: 'no-cache', silly: content-length: '134', silly: content-type: 'application/json; charset=utf-8', silly: expires: '-1', silly: strict-transport-security: 'max-age=31536000; includeSubDomains', silly: x-ms-served-by: 'b40b7384-df1f-4b82-9eee-e6bc5b02dff4_131065963794394665', silly: x-ms-request-id: '2d44709a-d8fe-44d9-8ca3-7adbe3fc3dd5', silly: server: 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0', silly: x-ms-ratelimit-remaining-subscription-reads: '14946', silly: x-ms-correlation-request-id: '975d343e-4e96-4e6b-b5b3-6f6d77864c6a', silly: x-ms-routing-request-id: 'CENTRALUS:20160503T163536Z:975d343e-4e96-4e6b-b5b3-6f6d77864c6a', silly: date: 'Tue, 03 May 2016 16:35:36 GMT', silly: connection: 'close' silly: }, silly: body: '{\015\n "startTime": "2016-05-03T16:27:55.1760544+00:00",\015\n "status": "InProgress",\015\n "name": "4635f163-517e-49bb-bd97-7e6ea657f7e4"\015\n}' silly: }

bwhiton avatar May 03 '16 16:05 bwhiton

@sauryadas @huangpf can you look into this?

amarzavery avatar May 03 '16 16:05 amarzavery

@bwhiton Did you sysprep the VM while capturing it into the image, or may I know how did you setup the VHD? And may I have the storageProfile part in the request ``-vv` log? Thanks.

huangpf avatar May 03 '16 16:05 huangpf

I did not sysprep the VM. I was under the impression that the sysprep step was only required when creating a generalized vhd. Is this a required step? If so, is there any way to import a vhd from another cloud without executing sysprep? In short, I did no preparation to the vhd other than simply upload it.

Here is the storage profile that the cli sent: {"storageProfile":{"osDisk":{"osType":"Linux","name":"cli18fb6cb50c12e172-os-1462292873770","vhd":{"uri":"https://somestorageaccount.blob.core.windows.net/images/testvhd.vhd"},"caching":"ReadWrite","createOption":"Attach"}}

bwhiton avatar May 03 '16 16:05 bwhiton

Talked to the storage profile API owner, and they said this part looks fine, and it doesn't need sysprep for using specialized VHDs. This is likely a CRP API issue. @sauryadas @mahthi Could you please help involve the service API owner for further investigation? Thanks.

huangpf avatar May 03 '16 17:05 huangpf

@sauryadas @mahthi is there an update on this?

eduardkoller avatar May 09 '16 18:05 eduardkoller

The operation should eventually complete. Can you please get me the VM's InstanceView (detailed status) and paste it here?

mahthi avatar May 09 '16 22:05 mahthi

@bwhiton On our side, it's identified as a service API issue, so we are waiting for further investigation.

Meanwhile, could you please retry the call to see whether it can be reproduced? Thanks.

huangpf avatar May 10 '16 05:05 huangpf

Close for now. Please reopen if you reproduce the issue.

huangpf avatar Jun 29 '16 03:06 huangpf

Still able to reproduce. And, the VM's instanceview is:

{ "vmAgent": { "vmAgentVersion": "Unknown", "statuses": [ { "code": "ProvisioningState/Unavailable", "level": "Warning", "displayStatus": "Not Ready", "message": "VM status blob is found but not yet populated.", "time": "2016-08-04T18:42:39+00:00" } ] }, "disks": [ { "name": "clib5a01de3bf29b630-os-1470335168826", "statuses": [ { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Provisioning succeeded", "time": "2016-08-04T18:28:28.631883+00:00" } ] } ], "statuses": [ { "code": "ProvisioningState/creating", "level": "Info", "displayStatus": "Creating" }, { "code": "PowerState/stopped", "level": "Info", "displayStatus": "VM stopped" } ] }

after awhile, it goes to:

{ "vmAgent": { "vmAgentVersion": "Unknown", "statuses": [ { "code": "ProvisioningState/Unavailable", "level": "Warning", "displayStatus": "Not Ready", "message": "VM status blob is found but not yet populated.", "time": "2016-08-04T19:30:13+00:00" } ] }, "disks": [ { "name": "clib5a01de3bf29b630-os-1470335168826", "statuses": [ { "code": "ProvisioningState/succeeded", "level": "Info", "displayStatus": "Provisioning succeeded", "time": "2016-08-04T18:28:28.631883+00:00" } ] } ], "statuses": [ { "code": "ProvisioningState/failed/VMStartTimedOut", "level": "Error", "displayStatus": "Provisioning failed", "message": "VM 'testspecialized2' did not start in the allotted time. The VM may still start successfully. Please check the power state later.", "time": "2016-08-04T19:08:35.8181718+00:00" }, { "code": "PowerState/stopped", "level": "Info", "displayStatus": "VM stopped" } ] }

@huangpf Can this be reopened?

bwhiton avatar Aug 04 '16 20:08 bwhiton

I do have the same issue. Please reopen.

fadenb avatar Sep 12 '16 15:09 fadenb

@huangpf @singhkays @mahthi - Looks like people are still facing the same issue. Can one of you guys look into this and make sure this is resolved?

amarzavery avatar Sep 12 '16 16:09 amarzavery

@bwhiton @fadenb Could you please confirm that you sysprep the VM before capturing?

huangpf avatar Sep 12 '16 16:09 huangpf

@bwhiton @fadenb There are a multitude of reasons where we've seen VM provisioning fail in generalized/specialized scenarios. Most of the time this has to do with the way the OS exists in it's current state before being brought into Azure which leads to provisioning never completing. I suggest you follow the following articles based on your OS to correctly prepare the VHD for Azure compatibility. If you still run into issues, please file a support request as this is a platform issue rather than a CLI issue that requires deeper investigation of the platform logs.

• Windows - https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-prepare-for-upload-vhd-image/

• Debian - https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-debian-create-upload-vhd/ • Red Hat - https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-redhat-create-upload-vhd/ • CentOs - https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-create-upload-centos/ • Ubuntu - https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-create-upload-ubuntu/ • Oracle Linux - https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-prepare-oracle/

singhkays avatar Sep 12 '16 16:09 singhkays

@bwhiton On the service side, they would like to know how the VHD was created:

OS Blob à bobstesting/morpheus-images/testvhd.vhd

Looks like the size of this blob is 2147992064. How is this VHD created?

Do you have any operation logs for creating the VHDs? Thanks.

huangpf avatar Sep 12 '16 16:09 huangpf

I have the same issue, azure create command pends on "creating vm xx" for a long time and then fail to create vm. Error message is "vm did not start in the allotted time. the vm may still start successfully. please check the power state later". I create vhd following the steps in comment 11.

wangjj1989 avatar Sep 23 '16 12:09 wangjj1989

Where is comment 11? I don't see apparent indices on the comments.

This error you show usually indicates the VHD you captured was not sys-prep'd . Could you please help confirm?

huangpf avatar Sep 23 '16 16:09 huangpf

Was this issue ever resolved, I am having the exact same experience where the VM just stay in the creating state, with same instanceview output as above.

pietmans avatar Sep 27 '16 08:09 pietmans

@pietmans Usually it indicates the VHD has something that can't be processed correctly by the provision pipeline. May I know how you prepared the VHD? Thanks.

huangpf avatar Sep 27 '16 16:09 huangpf

I have the same issue, any news about how to resolve it?

zabranskiy avatar Dec 23 '16 11:12 zabranskiy

I experience the same problem with specialized VHD built from hypervisor. I installed the walinux agent and performed deprovision. I launched the VHD through ARM and got the OSProvisioningTimedOut errror.

lyan-git avatar Aug 03 '17 22:08 lyan-git

I have the same problem with generalized VM I am creating a couple from the same image source, some fail, some don't clearly an azure problem..

images NEVER worked correctly in azure, it is always a hit or miss

pixelicous avatar Dec 17 '17 12:12 pixelicous

I'm confused by the term "Failed" after provisioning a VM. If I connect to it, the VM is fully functional though its state is "Failed". This is a specialized VHD, which was created from an original WIM and it runs in Hyper V locally without issue. This VM is not using AD, but I performed all of the steps here required prior to migration to azure. Since this is specialized, sysprep was not performed. I apologize - I had a conceptual error with this provisioning. I should have used -CreateOption Attach when invoking Set-AzureRmVMOSDisk. Instead, I was using -CreateOption fromImage.

sscheider avatar Mar 01 '18 16:03 sscheider

The issue continues..

ghost avatar Jul 12 '18 08:07 ghost

@VGSandZ We are using packer since to create images.. and our issue was with a specific installation that needed a reboot and we didnt restart the computer before a sysprep, that has caused OOBE experience to get stuck..

The sad/funny thing here i show long this issue is open and nobody from microsoft chimes in to help..

Good luck guys hope you solve your issues

pixelicous avatar Jul 29 '18 15:07 pixelicous

I am having the exact same issue. I have been trying to deploy a specialized VHD for a few days now and nothing seems to work. The deployment states failed due to the time taken. The VM shows as running, i have left it running for ages just to check if it would ever actually work. Anyone got an update or a resolution for this?

I am still testing different things at the moment so will update if i find a workaround.

Nice that Microsoft have jumped in here....

blazedbud avatar Oct 30 '18 21:10 blazedbud

Please file an issue in the new cli. https://github.com/azure/azure-cli. The current cli is not supported anymore.

amarzavery avatar Oct 31 '18 23:10 amarzavery

@blazedbud if its still relevant maybe you did some installation or process on the vm requiring it to reboot, try to reboot the image before you close it with sysprep.. also chekc whether the image is ready to be sysprepped, there is a registry key for that

pixelicous avatar Dec 17 '18 06:12 pixelicous

could you try without the sysprep answer file.... last time i heard.. if sysprep had an answer file it may fail.

Get Outlook for Androidhttps://aka.ms/ghei36


From: pixelicous [email protected] Sent: Monday, December 17, 2018 12:16:15 PM To: Azure/azure-xplat-cli Cc: Venu B; Mention Subject: Re: [Azure/azure-xplat-cli] Unable to create a VM from a specialized vhd (#2848)

@blazedbudhttps://github.com/blazedbud if its still relevant maybe you did some installation or process on the vm requiring it to reboot, try to reboot the image before you close it with sysprep.. also chekc whether the image is ready to be sysprepped, there is a registry key for that

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-xplat-cli/issues/2848#issuecomment-447738610, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOB5LjNODwFM6SSOMRyxKXiKFTmiSteTks5u5z23gaJpZM4IWZhF.

ghost avatar Dec 17 '18 07:12 ghost

Any update on this open item? I have recently used a VHD file, uploaded it on Storage account, created a managed disk using powershell and then a VM using the managed disk, the vm starts and shows state of running, but not able to connect, the error which appears while taking RDP is NLA but when trying to disable the NLA the script doesnt run, under boot diagnostics, its all blank there, any help would be appreciated.

VM status

ResourceGroupName : onprem-build-system-rg Name : translator-vm HyperVGeneration : V1 BootDiagnostics : ConsoleScreenshotBlobUri :

(hiding for some reasons)

SerialConsoleLogBlobUri :

## (hiding for some reasons)

Disks[0] : Name : ####### Statuses[0] : Code : ProvisioningState/succeeded Level : Info DisplayStatus : Provisioning succeeded Time : 3/24/2021 5:53:54 AM Extensions[0] : Name : BGInfo VMAgent : VmAgentVersion : Unknown Statuses[0] : Code : ProvisioningState/Unavailable Level : Warning DisplayStatus : Not Ready Message : VM status blob is found but not yet populated. Time : 3/24/2021 7:49:57 AM Statuses[0] : Code : ProvisioningState/succeeded Level : Info DisplayStatus : Provisioning succeeded Time : 3/24/2021 7:27:58 AM Statuses[1] : Code : PowerState/running Level : Info DisplayStatus : VM running

Thanks

swapnilk-optimus avatar Mar 24 '21 07:03 swapnilk-optimus

@swpanilk-optimus - This repo is deprecated. Please file issues over here https://github.com/azure/azure-cli

amarzavery avatar Mar 29 '21 23:03 amarzavery