sribs / azure-support-scripts Goto Github PK
View Code? Open in Web Editor NEWAzure Powershell Scripts ported to BASH
Azure Powershell Scripts ported to BASH
Using the BASH Linux VM Recovery script on a migrated VM gave an error of:
Querying the image of 'null:null:null:null' failed for an error 'The value of parameter version is invalid.'. Configuring plan settings will be skipped Deployment failed. Correlation ID: 7c7a0b44-f041-4b4f-99de-1d3e08391f23. { "error": { "code": "InvalidParameter", "message": "The value of parameter imageReference.version is invalid.", "target": "imageReference.version" } }
--
This is because the script attempts to create a recovery VM based on the version of the source VM which on a migrated VM appears to be missing
A workaround was to use the PowerShell version of the script, which offers the ability to specify the Publisher and versions to be used for creating the Recovery VM.
These are the commands from PowerShell in Cloud Shell which force to create a recovery VM with Centos 7.5
./New-AzureRMRescueVM.ps1 -ResourceGroupName Source_VM_RG -VmName Source_vm_name -subscriptionId xxxxxx -offer CentOs -Publisher OpenLogic -sku 7.5 -Version 7.5.20180815 -UserName xxxxxx -Password xxxxxx
Ask: Integrate missing parameters into BASH Version (Publisher, sku, Version)
I suggest that logic is inserted into the script that if a version or other information is missing from the source VM, which prevents creation of a recovery VM then we should provide examples or the actual commands to create the recovery VM
or list the images and display them to customer
az vm image list --all --offer centos --output table
When running the script against a VM in a Region with a storage account name that is not consistent with location an error is thrown at the Creating snapshot phase:
##### Generatnig Snapshot #######
lvm-test_OsDisk_1_7436bea72ede4298bd956f5fc146566c
lvm-test-OsDisk-1-7436bea72ede4298bd956f5fc146566c-06-03-2019-04-34-19
Resource lvm-test_OsDisk_1_7436bea72ede4298bd956f5fc146566c is not found.
Storage Account name: cloud-shell-storage-westeurope
Storage Region: West Europe
VM Region: North Europe
./new-rescue.sh --rescue-vm-name rescuetestvm2 -g cloud-shell-storage-westeurope -n lvm-test -s 754fe295-xxxx-xxxx -u azureadmin -p M1cr0softazure
It's possibly due to the VM and Storage Account being in different locations
Running the create snapshot manually as per the script throws the error:
**az snapshot create -g cloud-shell-storage-westeurope -n vflsnap2 --source lvm-test_OsDisk_1_7436bea72ede4298bd956f5fc146566c -l northeurope6f5fc146566c
Resource lvm-test_OsDisk_1_7436bea72ede4298bd956f5fc146566c is not found.
vittorio@Azure:~/azure-support-scripts$**
Using the -l flag with the location of the VM creates the snapshot
az snapshot create -g cloud-shell-storage-westeurope -n vflsnap1 --source lvm-test_OsDisk_1_7436bea72ede4298bd956f5fc146566c -l northeurope
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.