Azure VM Migration

Keywords: PostgreSQL - Microsoft Azure - Technical issue - Other
Description:
Hello everyone,

I am having a problem recreating an Azure VM from an existing disk that was initial created using Bitnami PostgreSQL image reference. After creating the ticket to Azure, they confirmed that I was trying to use a reference from the Market that doesn’t exist anymore. The Market VM Image I am trying to use is: Publisher: bitnami, Offer: PostgreSQL , SKU: 9-5 . I need to run Set-AzureRMVMPlan to point to the initial VM Image that was used for the VM creation in order to redeploy the VM. Can someone help me with a reference to the image?

Thank you

Hi

The SKU of that image was renamed. The new one is simply “postgresql”. Therefore, the reference to the image is:

publisher: bitnami, offer: postgresql, sku: postgresql

Best Regards,

Juan Ariza


Was my answer helpful? Click on :heart:

Hello Juan,

Ussing the new image reference will generate an error that is not valid. I
already tried it. Is there any other workaround??

Thank you,
Nicu

Hello @nicu

Are you using PostgreSQL or postgresql as “offer”? Please note that’s case sensitive.

Best Regards,

Juan Ariza

Hello @jariza,

I am ussing postgresql.

Thank you,
Nicu

Hi @nicu

That’s pretty weird… Could you please attach a screenshot of the error and the configuration you’re setting on Azure Portal?

Best Regards,

Juan Ariza

Portal Error:

Provisioning failed. The purchase information does not match. Unable to deploy from the Marketplace image. OS disk name is

PowerShell Error:

New-AzureRmVM : Long running operation failed with status ‘Failed’. Additional Info:'The purchase information does not match. Unable to deploy
from the Marketplace image. OS disk name is *******
ErrorCode: VMMarketplaceInvalidInput
ErrorMessage: The purchase information does not match. Unable to deploy from the Marketplace image. OS disk name is

Hi @nicu

Could you share the complete set of commands you tried on Powershell?

Did you follow the approach explained in the link below?
https://www.linkedin.com/pulse/deploying-3rd-party-custom-images-azure-via-command-line-lewis/

Please pay special attention where it says:

make sure you have deployed the software manually in your subscription (1 time) in order to avoid any issues with licensing when automated images are deployed

Best Regards,

Juan Ariza

$VirtualMachine = New-AzureRmVMConfig -VMName $VMNewName -VMSize $OriginalVM.HardwareProfile.VmSize 
    
$Terms = Get-AzureRmMarketplaceTerms -Publisher $SourceImagePubliser -Product $SourceImageOffer -Name $SourceImageOffer
Set-AzureRmMarketplaceTerms -Publisher $SourceImagePubliser -Product $SourceImageOffer -Name $SourceImageOffer -Terms $Terms -Accept

        
$VirtualMachine =  Set-AzureRmVMPlan -VM $VirtualMachine -Name $SourceImageOffer -Product $SourceImageOffer -Publisher $SourceImagePubliser 
$OSDisk = Get-AzureRmDisk -DiskName $NewOSDiskName -ResourceGroupName $TargetRG 
    
Set-AzureRmVMOSDisk -VM $VirtualMachine -ManagedDiskId $OSDisk.Id  -Linux -Name $OSDisk.Name -CreateOption Attach 
  
$Nic = ($PrimaryNic.Id)
Add-AzureRmVMNetworkInterface -VM $VirtualMachine -Id $PrimaryNic.Id -Primary

#Create the VM
New-AzureRmVM -ResourceGroupName $TargetRG -Location $Location -VM $VirtualMachine -DisableBginfoExtension

Hi @nicu

I can see you defined the Plan information:

$VirtualMachine = Set-AzureRmVMPlan -VM $VirtualMachine -Name $SourceImageOffer -Product $SourceImageOffer -Publisher $SourceImagePubliser 

However, I’m missing the definition of the Azure Source Image:

$VirtualMachine = Set-AzureRmVMSourceImage ...

Best Regards,

Juan Ariza

Hello @Jariza,

Because I am creating a VM based on a existing disk, I don’t need to
Set-AzureRmVMSourceImage, I am not creating a disk from an image, I am
just attaching it.

Thank you,
Nicu

Hello @nicu

Honestly, that’s so weird since we re-checked the information several times and the image SKU is the one we provided you for sure.

I recommend you to contact Azure Support, they might be able to provide you more information about how the reason why it consider the image as invalid.

Best Regards,

Juan Ariza

Hello @jiraza,

I opened the ticket after I received an ticket from Microsoft that states:

First of all, we would like to highlight that the errors you are getting are expected.
Some third-party images available in Marketplace requires a “plan”.
If you use a plan information different from the one already present in the OS disk, then you would probably get an error like “The purchase information does not match”.
If you use a plan information that is not valid, you would probably see “Plan with PublisherId… not found”.
We have reviewed the available SKUs for bitnami - postgresql in different locations, and we can only see a sku named “postgresql”. We are not able to find 9-5.
Therefore, the errors you have seen are expected as it looks like the sku 9-5 is no longer available.
At this point, we would like to clarify that Azure Marketplace is a service where publishers (Microsoft, ISVs, start-ups , etc.) can offer their solutions, and that each publisher is responsible of managing their “images”. You can find more information about this in the following article:

I will try again with your suggestions, but still I am not sure this will solve the problems.
In the end I think we need to recreate the VM from 0 and somehow import the data if possible.

Thank you for your time,
Nicu Birlea

Trying to use:

Set-AzureRmVMSourceImage …

As you suggested

I get:

New-AzureRmVM : Cannot attach an existing OS disk if the VM is created from a platform or user image.
ErrorCode: InvalidParameter
ErrorMessage: Cannot attach an existing OS disk if the VM is created from a platform or user image.
StatusCode: 400
ReasonPhrase: Bad Request
OperationID : d4d54c12-1504-401d-b304-ce3b8422304d
At line:1 char:5

  • New-AzureRmVM -ResourceGroupName $TargetRG -Location $Location -V ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : CloseError: (:slight_smile: [New-AzureRmVM], ComputeCloudException
    • FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.NewAzureVMCommand

As I was saying, I don’t need to setup the source image because I already have a disk with a reference to a VM Image

Thank you,
Nicu

Hi @nicu

I see… The reference changed and, therefore, the disk (which was created with the old reference) can’t be used to increate a new instance since it complains about the reference.

As you mentioned, you don’t need to add the source image since you have already a disk. Could you ask the Azure Support Team if there is a way to change the source image of an existing disk? If so, the solution will be to change that reference so it points to the new one.

Best Regards,

Juan Ariza

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.