Create Instance Template based on an exported image - google-cloud-platform

I have an image created from a VM and I want to create an Instance Template to use that image for boot disk. I cannot find any way to do this in Google Cloud Console. How can create an Instance Template, using an image for boot disk?
Thanks!

Go to Compute Engine -> Images. In Filter images, enter the tag that you used to create the image. If you did not use a tag or something descriptive, then you will have to look thru the entire list. If you do not find your image, then go back and figure out what went wrong with your import.
Once you know your image and its name, go to Compute Engine -> Instance tempates.
Click on Change in Boot disk. Select the tab Custom images. If you do not see your image, then go back again and figure what went wrong with your import.
If you see your image select it and press the Select button. Continue configuring your instance template.

Related

Cannot create GCP VM, public images are empty

When attempting to create a new GCP VM on a new account, the list of public images is empty. If I try to launch an image from the public marketplace, the boot device will not be attached.
What am I doing wrong here?
Turns out the problem was caused by the security group in my organization which set a public image constraint and neglected to ensure my team was aware of it.
https://cloud.google.com/compute/docs/images/restricting-image-access
open cloud shell as per my comment (right upper corner square with ">" sign)
list images using
gcloud compute images list
Output will look like this:
try to create your VM with desired image via opened cloud shell using for example the following
gcloud compute instances create test --image-family ubuntu-1804-lts --image-project ubuntu-os-cloud
Output should look something like this:
If so, you will find your instance running under compute engine.
PS.
Dont forget to turn these VMs off when you are done.
If you want to select another image make sure to use image project and image family from output from step 2.
Either way at least this should give you some errors to resolve

How to fix with custom image from slurm-gcp?

I distributed slurm-gcp using Terraform through the GitHub and it was available successfully. Source:
Slurm on Google Cloud Platform
But I want to change the image I use when using node to a custom image.
I am trying to edit /slurm/scripts/config.yaml.
Among the contents of the file:
image: projects/schedmd-slurm-public/global/images/family/schedmd-slurm-20-11-7-hpc-centos-7
I want to edit the part.
How to reroute this part to my custom image?
First you need to create your own image.
Create a new VM with the image you want to modify; make appropriate changes and stop the VM. Then create a new image from the VM's disk.
Next create a custom image from that disk and your path in the config.yaml file can look like this:
image: projects/my-project-name/global/images/your-image-name
You can get exact path to your custom image by running:
wb#cloudshell:~ (wb)$ gcloud compute images describe your-image-name | grep selfLink
selfLink: https://www.googleapis.com/compute/v1/projects/wb/global/images/your-image-name

AWS Sagemaker Cant train my Keras model - ErrorMemoryError: Unable to allocate 20 GiB for an array with shape and data type

it's my very first time using AWS Sagemaker, so I'm trying to fit my keras model and get this error the whole time. I don't know how can I solve it , I tried doing echo 1 > /proc/sys/vm/overcommit_memory but then kernel died. I was using the most basic and cheapest version for Sagemaker, I think it has 4GB ,may it be the problem?
But I dont really know with this configuration I can fit this model in my own computer, so that means that Sagemaker has less power than my computer?
Thanks.
For a model that requires a 20GB array to be stored, you'd probably want to use something like an ml.t3.2xlarge or ml.m5.8xlarge instance, which have 32GB of memory available.
There are two ways to solve this problem:
Method 1
You can select this from the SageMaker Studio environment if you're using the SM Studio IDE, via the "Switch instance type" button at the top of your notebook tab.
Once you've done this, the instance list will appear in a pop up, and you need to click on the "Fast launch only" selector button, so that you can see all available instance types.
Method 2
Alternatively, if you're using a "traditional" SageMaker Jupyter notebook without the SageMaker Studio IDE:
Goto the main SageMaker console.
Click on Notebook -> Notebook Instances.
Click on the hyperlink of the notebook you want to change the instance type for.
This will take you to the "Notebook instance settings" page.
Click on the "Edit" button (top right).
Select your new, larger instance type from the "Notebook instance type" drop down list.
Scroll down to the bottom of the page and click on the "Update notebook instance" button.
This will take you back to your list of notebook instances.
Note that the list will contain the word "Updating", with a clock icon next to it in the Status column.
If this hasn't refreshed after a few minute, click on your browser refresh button.
The instance should now show as being available/In Service, with the new instance size/type listed in the "Instance" column.
If it's not started, click on the "Start" link in the "Actions" column and it should start with the new instance type.

Google Cloud: Disk labels aren't inheriting from instance templates or images

I have instance templates with labels attach and image related to the template has labels attach as well, once the instance group spin up instances my disk aren't inheriting the labels from template or images.
I would like to know is there way to label disk which created by instance templates.
It seems that there is no way to inherit the Label of a Disk.
I tried to reproduce the behavior you mentioned but it is not possible at this moment.
I created an image (gave it a label) using a disk that already has labels.
Then created an instance template using the same image and gave it a different label this time.
I then created instance group using the instance template and a VM instance was created with label inherited from the template, but the disk created for this VM Instance didn’t have any label.
The inheritance only works at instance level.
I have found that there is already a ticket created for this Feature Request, where you can track the updates for this request and you can ask for more information about it if you need it.

AWS CodeBuild - Environment based off of image from docker hub

Quick question and this may be a dumb one. I am attempting to use AWS Code Build with an image I've published to Docker Hub. I selected the option to use a custom image, and the the option to look for the image in another location (an external image repo).
I can't seem to figure out how to reference my image in the appropriate format to use it in the other location field.
Any help would be greatly appreciated.
In the "Other location" text box you can enter the image name from DockerHub. For example, simply give "openjdk" or "openjdk:latest" to use https://hub.docker.com/r/library/openjdk/ as the Docker image for your build. Don't put the "docker pull " prefix for your image name is all.
Note that CodeBuild only supports public Docker images from DockerHub today. Private registries are not supported.
Lets say that you published your image in hub.docker.com, and your repo name is gjackson/myrepo, and you want to grab the image tagged latest, you should populate the other location field with docker.io/gjackson/myrep:latest.