Scale Set with custom image from another subscription - azure

I created a scale set with managed disks and a custom image (something like /subscriptions/<SUB-ID>/resourceGroups/my-rg/providers/Microsoft.Compute/images/my-base-image) and also an ARM template to deploy a new scale set with this custom image.
The template deployment works fine if I deploy to the same subscription where my custom image is located. But it fails when I try to deploy it to another subscription - even if these two subscription are part of the same tenant/directory and the user has access to both subscriptions.
So am I right that it's not possible to use a custom image from a different subscription?
If yes: it would be ok (not best solution, but ok), if I could copy the custom image from subscription A to subscription B - But I can't see a way to copy this ressource. I think the only way is to recreate everything and use unmanged disks, because here I can download and upload the .vhd file from/to the storage account.
Any other ideas?

For now, Azure doesn’t support move a managed Image to anther subscription .But, this function will come soon. Also , I supply a way for this issue.
Create a temporary VM in A subscription using your Image.
Move this temporary VM to B subscription.
Capture a new Image and delete the temporary VM.
Then, you can use this image to do what you want to do.
NOTE: Moving a VM to another subscription is very easy. You just need to click Move button on VM’s overview in portal.
Also, this link supply another solution and it may be helpful to your case.

Related

How to schedule to change VM resources in azure?

I have 4 VMs in azure and I am trying to set up a schedule to lower the RAMs and CPU cores for after-hours and revert them back to their original size during business hours.
can someone guide me through the steps or share a how-to resource, please? I can't find any documents and I am sure my search key is not correct.
Thanks
As suggested by #harshavmb, you can make use of VMSS.
In Azure, Auto-Scaling is possible if you make use of Virtual Machine Scale-Sets.
Virtual Machine Scale-Sets allows you to automatically scale as resource demand changes.
Based on schedules, you can create auto scale rules.
These schedule-based rules allow you to automatically scale the number of VM resources at fixed times.
To create the Auto-Scale rule, you can make use of following tools:
Azure PowerShell
Azure CLI
Azure template
Otherwise, you can create an automation account in Azure and execute runbooks as mentioned in below link if helpful:
Automatically Resize an Azure VM - Automation account

Azure scaleset storage | update app code | Add an existing VM to a new scale-set

I have three questions that I couldn't get a clear answer for in the documentation I visited.
1- In case I deployed a VM scale-set with auto-scaling and I had a VM that was scaled-in (according to the set policy) then it remained active for a while and after that, it was scaled-out after the utilization got back to normal. My question here is what happens to the data generated by the VM that was scaled in, then out (ex: logs) in case I was using Managed storage. Noting that the aim here is to persist important data (app logs...)?
2- As per what I understood from the documentation in order to update your app code for example (using SCM ex Git) on all the scale set nodes you will need the help of an automation tool (ex: ansible), or you'll need to update the custom image and redeploy it to the scale set. Is there a more centralized way that I missed?
3- Is there a way to add an existing VM to a new scale set other than converting it to a base image?
thanks in advance.
A1. If you do not set the persistent storage, then the scale in will just delete the instance without persisting the data in the VM.
A2. There is no other way to update your code, the best way is to change your VM image. Or use storage to store your code and then mount the storage to your VMSS. For example, the
Azure file share.
A3. No, you can't add other existing VMs to VMSS. It's impossible.

Azure Marketplace - Do I need to create VM offer separately from Azure Applications offer?

I'm going to make an solution offer to Azure Marketplace using this documents.
https://learn.microsoft.com/en-us/azure/marketplace/partner-center-portal/create-new-azure-apps-offer
I have already created the ARM templates. But inside my templates, they're referring to custom images in Share Images Gallery that I captured from Azure Portal. Do i need to create VMs offer for my Images separately?
If yes, Let say if I have 10 templates that are referring to 20 custom images in Share Images Gallery, then I need to create 20 VM offers for 20 custom images, don't I?
Sorry I very new on Azure Cloud.
Without knowing too much detail here is an answer based on some assumptions:
The Azure App is meant for public customers
The Azure App (ARM Template) is going to deploy Virtual Machine images
If that’s the right set of assumptions then: Using Shared Image Gallery would turn out to be a costly exercise because it would be someone’s Storage account. The preferred solution would be
Create a Azure Virtual Machine offer
Each offer can have many plans (selling motion)
Each plan can have up to 40 versions of an image
Keep the VM offer hidden, so users don’t buy that, instead publish an Azure App that manages the deployments
Another way to think about it is, if you have same product with many versions, you create a single plan
If you have same product with different tiers you can create different plans (and code your VM to query azure to find out what context (plan) its running in and behave appropriately)
You want to keep the same “offering” under the same “offer”. For example all Windows Server images are under the same offer (with plans for each major release)
If you are offering a banana in one image and a potato in the other, you want to put them in different offers.

Change location of an Azure IoTHub

I would like to change the location of my IoT Hub image attached.
For some reason there doesn't seem to be any way to do it within the portal. Am I going to have to delete the IoT Hub and create it again?
It is not possible to move an Azure resource to a different location. If you need to move your resource you will have to develop your own migration plan and redeploy the resource in the desired location.

Azure VM scaling, able to set the initial instance count?

Have a several IaaS VM running under an internal load balancer in Azure, for scaling, is it possible to set an initial instance count rather than starting from the minimum count. Thanks
This isn't quite as easy as "set it in the portal", but it should still be relatively easy. If you go to one of the VMSS templates in the Azure Quickstart Templates repo (e.g. https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-windows-nat), and click on "Deploy To Azure", it will take you to portal and allow you to deploy with the parameters you want from the UI. One caveat is that you won't be able to change the size from portal though.
Hope this helps :)
Actually, thinking about this a bit more, you might be able to change the size from the UI once it's been created. If you deploy the VMSS, then at a later point in time click on the "Deploy To Azure" button again, it will take you to the portal again. If you deploy with the exact same parameters but just change the capacity, it might scale the VMSS to the number of VMs you desire (theoretically, deployments are supposed to only deploy the parts of infrastructure that haven't already been deployed, but I haven't tested it with this particular template, so it's possible that something breaks).
If you are using the classic auto-scaling option that has been available for a while now, you should take a look at the templates and Azure Scale Sets functionality - https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-vmss-walkthrough/ It appears to allow to you provide a starting instance count.

Resources