how to deploy multiple virtual machines using custom image? - image

I am using a Azure.
I created a custom image of Linux virtual machine.
I have to create multiple virtual machines of a custom image.
BUT I don't know the way to do.
In Resource manager portal, 'virtual machine scale out' function is only for OS images (not for custom images).
I prefer a solution done in the portal though, using Azure CLI or using template is okay to me.

There is an azure-quickstart-template named 201-vmss-windows-customimage that will give you a template to achieve your scenario.
From the readme.md
The template allows a URL to a custom image to be provided as a
parameter at run time. The custom image should be contained in a
storage account which is in the same location as the VM Scale Set is
created in, in addtion the storage account which contains the image
should also be under the same subscription that the scale set is being
created in.
Update: If your custom image is based on Linux, you need modify osType in this template. Modify it to Linux and save it as name test.json. You could execute following cmdlet.
New-AzureRmResourceGroupDeployment -Name ExampleDeployment -ResourceGroupName mygroup -TemplateFile C:\Users\shui\Desktop\test.json
This is my test in my lab.
Also, you could use this Deployment template for autoscaled custom image vmss
This template allows you to deploy an autoscaled VM Scale Set of Linux
VMs based of an existing custom image. The load balancers and vms
should be assigned public IPs

Related

Azure DevTestLabs custom Image error "Creating a virtual machine from Marketplace image requires Plan information in the request"

In Azure DevTestlabs I have made a custom image from a market resource (CIS hardened image) and saved it to blob storage. After this I want to create a VM from this image (and do other things with the image).
I have this process automated through Azure Pipeline which was working until three months ago. A few days ago I gave it another spin and it fails on creating the VMs.
Since the custom image was created, instead of going through my scripting I decided to create a VM from the portal.
Now when I try to create a VM from the image in the portal I get the following error:
Creating a virtual machine from Marketplace image requires Plan information in the request
Did anyone run into this or have any ideas where to look for a solution?
Thanks in advance
The plan resource does not exist for Microsoft.DevTestLab labs/virtualmachines template
https://learn.microsoft.com/en-us/azure/templates/microsoft.devtestlab/2018-09-15/labs/virtualmachines
Try re-creating the custom image and try again.

How to save a compute engine VM-instance setup in Google Cloud Platform?

I have created a compute engine VM-instance in Google Cloud Platform. Then I have installed go using the standard procedure downloading it from https://dl.google.com/go/go1.11.4.linux-amd64.tar.gz. Everything worked properly and I was able to run go application. However, after closing the instance when I reopened it, it says go is not installed. The message is following.
-bash: go: command not found
How can I save the instance setup?
Creating, Deleting, and Deprecating Custom Images
You can create custom images of boot disks and use these images to create new instances. This is ideal for situations where you have created and modified a persistent boot disk to a certain state and need to save that state to create new instances.
I think you should also consider using Docker containers.
Pushing and pulling images
Container-optimized VM images

Files not updating on google cloud platform instance

i am using google cloud platform and i have created an instance from compute engine. i installed apache server and then fresh laravel installation using ssh. All my laravel files exist on this path
var/www/html
but now when i am trying to edit any file its not reflecting. When i access my site using this link
https://project-id.appspot.com/
it only display a fresh laravel installation. not reflecting new changes.
I am using filezilla to update files.
The link you have provided is the URL format used by App Engine applications, not a Compute Engine instance. I believe you may be confusing the two.
To view the changes you have done to the files in a Compute Engine instance, you have to access the external IP of said instance, just as you would with a regular machine or VM.
Therefore, navigate to the Compute Engine section of the Cloud Console and look for the external IP of the Compute Engine instance where you have installed Laravel.

Where can I create images from? Locally at all? (Docker remote API)

May/may not be an easy question here, but where can I pull images from to create a new docker image via the API?
Documentation
My (unsuccessful) attempts have been trying to build an image from something local. Using docker images to get a list of images, then trying to use their Image ID or Repository has not worked for me while using the fromImage query param like so:
curl --data '' host:port/images/create?fromImage=test/hello-world&tag=webTesting
I consistently get the following error:
{"errorDetail":{"message":"Error: image test/hello-world not found"},"error":"Error: image test/hello-world not found"}
In running docker images, we can very clearly see the following:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
test/hello-world latest 6d9bd5e6da4e 2 days ago 556.9 MB
In all combinations of using the repository/tag/id the error still displays. I understand that we can create images from urls with fromSrc, and there are alternative create image routes by uploading .tar files, but is it possible in the case to create an image from one that already exists locally? I've had success in compiling images from ubuntu or centos, but I'm looking basically to replicate something local with new tags/repository.
I do see in the documentation that fromImage parameter may only be used when pulling an image -- does this mean we can only import images that are hosted on Dockerhub?
As you noted, the Docker remote API documentation clearly states that a pull operation must be triggered for this image reference.
This does not require that you use DockerHub, but it means that the image must be located on a registry and not simply in your daemon's local cache. If you were running a Docker registry instance on your host (which is easily done with the public registry image in DockerHub) on port 5000, then you could use "localhost:5000/test/hello-world" as the fromImage, and it will pull it from your locally hosted registry (after you push it locally of course).

Amazon AWS EC2 - Elastic IP - can i mirror my site closing certain ports?

THE MISSION:
I have a development environment running on an Amazon AWS EC2 virtual server which i want to have tested by third parties.
THE PROBLEM:
I do NOT trust the companies who will test it not to sabotage environment and / or steal code. Therefore, i don't want them to know URL's, permanent IP's or even to access the web pages, which they could eventually use a crawler to find.
My environment includes web applications and socket servers. I do NOT want to expose the web applications, while giving access only to socket servers.
THE CONCEPT:
I have opted to use a secondary, impermanent Elastic IP pointing to the environment. this IP will be destroyed after 1 or 2 days, after basic tests have run. Subject to change (depending on suggestions from this thread).
THE QUESTION:
Can i create a secondary Elastic IP instance that allows access only to ports 5000-5100? If so, how?
THE ALTERNATIVE: In case this is not the most efficient procedure, what alternative would you propose?
MY SOLUTIONS: followed FAQ Launching Instance From Backup
create snapshot
create image from snapshot (snapshot menu - create image tag)
instances - launch instance
choose image created from snapshot as your root volume
edit security groups (opened port range for sockets only, no web)
deleted all web code from this instance
after 2 days, will delete instance
followed Create Image From, Instance
select (exclusively) running instance you wish to mirror
right click on selected instance
choose create image from dropdown
to 7. same as above
this second solution seems to be more stable (especially re: status check and connectivity issues).
any better solutions? thanx!

Resources