Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static void createEncryptedInstance(String project, String zone, String i
networkName: network interface to associate with the instance. */
String machineType = String.format("zones/%s/machineTypes/n1-standard-1", zone);
String sourceImage = String
.format("projects/debian-cloud/global/images/family/%s", "debian-11");
.format("projects/debian-cloud/global/images/family/%s", "debian-13");
long diskSizeGb = 10L;
String networkName = "default";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static void createInstance(String project, String zone, String instanceNa
// networkName: network interface to associate with the instance.
String machineType = String.format("zones/%s/machineTypes/n1-standard-1", zone);
String sourceImage = String
.format("projects/debian-cloud/global/images/family/%s", "debian-11");
.format("projects/debian-cloud/global/images/family/%s", "debian-13");
long diskSizeGb = 10L;
String networkName = "default";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void main(String[] args)
* https://cloud.google.com/sdk/gcloud/reference/compute/machine-types/list
* newDiskSourceImage - Path the the disk image you want to use for your new
* disk. This can be one of the public images
* (like "projects/debian-cloud/global/images/family/debian-11")
* (like "projects/debian-cloud/global/images/family/debian-13")
* or a private image you have access to.
* You can check the list of available public images using the doc:
* http://cloud.google.com/compute/docs/images
Expand All @@ -72,7 +72,7 @@ public static void createInstanceFromTemplateWithOverrides(String projectId, Str
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.create()) {

String machineType = "n1-standard-1";
String newDiskSourceImage = "projects/debian-cloud/global/images/family/debian-11";
String newDiskSourceImage = "projects/debian-cloud/global/images/family/debian-13";

// Retrieve an instance template.
InstanceTemplate instanceTemplate = instanceTemplatesClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static void createInstanceTemplate(String projectId, String templateName)
try (InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.create()) {

String machineType = "e2-standard-4";
String sourceImage = "projects/debian-cloud/global/images/family/debian-11";
String sourceImage = "projects/debian-cloud/global/images/family/debian-13";

// The template describes the size and source image of the boot disk
// to attach to the instance.
Expand Down Expand Up @@ -110,7 +110,7 @@ public static void createInstanceTemplateWithDiskType(String projectId, String t
.setInitializeParams(AttachedDiskInitializeParams.newBuilder()
.setDiskSizeGb(10)
.setDiskType("pd-balanced")
.setSourceImage("projects/debian-cloud/global/images/family/debian-11").build())
.setSourceImage("projects/debian-cloud/global/images/family/debian-13").build())
.setAutoDelete(true)
.setBoot(true)
.setType(AttachedDisk.Type.PERSISTENT.toString()).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ private static Instance createWithDisks(String project, String zone, String inst
// [START compute_instances_create_from_image]

/**
* Create a new VM instance with Debian 11 operating system.
* Create a new VM instance with Debian 13 operating system.
*
* @param project project ID or project number of the Cloud project you want to use.
* @param zone name of the zone to create the instance in. For example: "us-west3-b"
Expand All @@ -265,7 +265,7 @@ public static Instance createFromPublicImage(String project, String zone, String
throws IOException, InterruptedException, ExecutionException, TimeoutException {
try (ImagesClient imagesClient = ImagesClient.create()) {
// List of public operating system (OS) images: https://cloud.google.com/compute/docs/images/os-details
Image image = imagesClient.getFromFamily("debian-cloud", "debian-11");
Image image = imagesClient.getFromFamily("debian-cloud", "debian-13");
String diskType = String.format("zones/%s/diskTypes/pd-standard", zone);
Vector<AttachedDisk> disks = new Vector<>();
disks.add(diskFromImage(diskType, 10, true, image.getSelfLink()));
Expand Down Expand Up @@ -301,7 +301,7 @@ public static Instance createFromCustomImage(String project, String zone, String
// [START compute_instances_create_from_image_plus_empty_disk]

/**
* Create a new VM instance with Debian 11 operating system and a 11 GB additional empty disk.
* Create a new VM instance with Debian 13 operating system and a 11 GB additional empty disk.
*
* @param project project ID or project number of the Cloud project you want to use.
* @param zone name of the zone to create the instance in. For example: "us-west3-b"
Expand All @@ -312,7 +312,7 @@ public static Instance createWithAdditionalDisk(String project, String zone, Str
throws IOException, InterruptedException, ExecutionException, TimeoutException {
try (ImagesClient imagesClient = ImagesClient.create()) {
// List of public operating system (OS) images: https://cloud.google.com/compute/docs/images/os-details
Image image = imagesClient.getFromFamily("debian-cloud", "debian-11");
Image image = imagesClient.getFromFamily("debian-cloud", "debian-13");
String diskType = String.format("zones/%s/diskTypes/pd-standard", zone);
Vector<AttachedDisk> disks = new Vector<>();
disks.add(diskFromImage(diskType, 10, true, image.getSelfLink()));
Expand Down Expand Up @@ -349,7 +349,7 @@ public static Instance createFromSnapshot(String project, String zone, String in
// [START compute_instances_create_from_image_plus_snapshot_disk]

/**
* Create a new VM instance with Debian 11 operating system and data disk created from snapshot.
* Create a new VM instance with Debian 13 operating system and data disk created from snapshot.
*
* @param project project ID or project number of the Cloud project you want to use.
* @param zone name of the zone to create the instance in. For example: "us-west3-b"
Expand All @@ -363,7 +363,7 @@ public static Instance createWithSnapshottedDataDisk(String project, String zone
throws IOException, InterruptedException, ExecutionException, TimeoutException {
try (ImagesClient imagesClient = ImagesClient.create()) {
// List of public operating system (OS) images: https://cloud.google.com/compute/docs/images/os-details
Image image = imagesClient.getFromFamily("debian-cloud", "debian-11");
Image image = imagesClient.getFromFamily("debian-cloud", "debian-13");
String diskType = String.format("zones/%s/diskTypes/pd-standard", zone);
Vector<AttachedDisk> disks = new Vector<>();
disks.add(diskFromImage(diskType, 10, true, image.getSelfLink()));
Expand All @@ -377,7 +377,7 @@ public static Instance createWithSnapshottedDataDisk(String project, String zone
// [START compute_instances_create_from_image]

/**
* Create a new VM instance with Debian 11 operating system in specified network and subnetwork.
* Create a new VM instance with Debian 13 operating system in specified network and subnetwork.
*
* @param project project ID or project number of the Cloud project you want to use.
* @param zone name of the zone to create the instance in. For example: "us-west3-b"
Expand All @@ -394,7 +394,7 @@ public static Instance createWithSubnetwork(String project, String zone, String
throws IOException, InterruptedException, ExecutionException, TimeoutException {
try (ImagesClient imagesClient = ImagesClient.create()) {
// List of public operating system (OS) images: https://cloud.google.com/compute/docs/images/os-details
Image image = imagesClient.getFromFamily("debian-cloud", "debian-11");
Image image = imagesClient.getFromFamily("debian-cloud", "debian-13");
String diskType = String.format("zones/%s/diskTypes/pd-standard", zone);
Vector<AttachedDisk> disks = new Vector<>();
disks.add(diskFromImage(diskType, 10, true, image.getSelfLink()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static void createRegionalInstanceTemplate(
RegionInstanceTemplatesClient.create()) {

String machineType = "n1-standard-1"; // Example machine type
String sourceImage = "projects/debian-cloud/global/images/family/debian-11"; // Example image
String sourceImage = "projects/debian-cloud/global/images/family/debian-13"; // Example image

// Define the boot disk for the instance template
AttachedDisk attachedDisk = AttachedDisk.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static void createTemplateWithSubnet(String projectId, String network, St
AttachedDisk disk = AttachedDisk.newBuilder()
.setInitializeParams(AttachedDiskInitializeParams.newBuilder()
.setSourceImage(
String.format("projects/%s/global/images/family/%s", "debian-cloud", "debian-11"))
String.format("projects/%s/global/images/family/%s", "debian-cloud", "debian-13"))
.setDiskSizeGb(250).build())
.setAutoDelete(true)
.setBoot(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void main(String[] args)
createWithLocalSsd(projectId, zone, instanceName);
}

// Create a new VM instance with Debian 11 operating system and SSD local disk.
// Create a new VM instance with Debian 13 operating system and SSD local disk.
public static void createWithLocalSsd(String projectId, String zone, String instanceName)
throws IOException, ExecutionException, InterruptedException, TimeoutException {

Expand All @@ -57,7 +57,7 @@ public static void createWithLocalSsd(String projectId, String zone, String inst
boolean autoDelete = true;
String diskType = String.format("zones/%s/diskTypes/pd-standard", zone);
// Get the latest debian image.
Image newestDebian = getImageFromFamily("debian-cloud", "debian-11");
Image newestDebian = getImageFromFamily("debian-cloud", "debian-13");
List<AttachedDisk> disks = new ArrayList<>();

// Create the disks to be included in the instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static void createInstanceWithCustomHostname(String projectId, String zon
// * For example: global/networks/default - if you want to use the default network.
String machineType = "n1-standard-1";
String sourceImage = String.format("projects/%s/global/images/family/%s", "debian-cloud",
"debian-11");
"debian-13");
String networkName = "global/networks/default";

try (InstancesClient instancesClient = InstancesClient.create()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static void createInstanceWithCustomMachineType(
AttachedDiskInitializeParams.newBuilder()
.setSourceImage(
String.format("projects/%s/global/images/family/%s", "debian-cloud",
"debian-11"))
"debian-13"))
.setDiskSizeGb(10)
.build()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public static void createInstanceWithCustomSharedCore(
AttachedDiskInitializeParams.newBuilder()
.setSourceImage(
String.format("projects/%s/global/images/family/%s", "debian-cloud",
"debian-11"))
"debian-13"))
.setDiskSizeGb(10)
.build()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public static void createInstanceWithCustomMachineTypeWithHelper(
AttachedDiskInitializeParams.newBuilder()
.setSourceImage(
String.format("projects/%s/global/images/family/%s", "debian-cloud",
"debian-11"))
"debian-13"))
.setDiskSizeGb(10)
.build()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static void createInstanceWithCustomMachineTypeWithoutHelper(
.setSourceImage(
String.format("projects/%s/global/images/family/%s",
"debian-cloud",
"debian-11"))
"debian-13"))
.setDiskSizeGb(10)
.build()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void createInstanceWithExtraMemoryWithoutHelper(
AttachedDiskInitializeParams.newBuilder()
.setSourceImage(
String.format("projects/%s/global/images/family/%s", "debian-cloud",
"debian-11"))
"debian-13"))
.setDiskSizeGb(10)
.build()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static void createInstanceDeleteProtection(String projectId, String zone,

String machineType = String.format("zones/%s/machineTypes/e2-small", zone);
String sourceImage = String
.format("projects/debian-cloud/global/images/family/%s", "debian-11");
.format("projects/debian-cloud/global/images/family/%s", "debian-13");
long diskSizeGb = 10L;
String networkName = "default";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static void main(String[] args) throws IOException {
// Name of the image family you want to retrieve the image from.
// List of public operating system (OS) images:
// https://cloud.google.com/compute/docs/images/os-details
String family = "debian-11";
String family = "debian-13";

getImageFromFamily(projectId, family);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static Instance assignStaticExternalNewVmAddress(String projectId, String
// Initialize client that will be used to send requests. This client only needs to be created
// once, and can be reused for multiple requests.
try (ImagesClient imagesClient = ImagesClient.create()) {
sourceImage = imagesClient.getFromFamily("debian-cloud", "debian-11").getSelfLink();
sourceImage = imagesClient.getFromFamily("debian-cloud", "debian-13").getSelfLink();
}
AttachedDisk attachedDisk = buildAttachedDisk(sourceImage, zone);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static void createPremptibleInstance(String projectId, String zone, Strin
throws IOException, ExecutionException, InterruptedException, TimeoutException {

String machineType = String.format("zones/%s/machineTypes/e2-small", zone);
String sourceImage = "projects/debian-cloud/global/images/family/debian-11";
String sourceImage = "projects/debian-cloud/global/images/family/debian-13";
long diskSizeGb = 10L;
String networkName = "default";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void main(String[] args)
String machineTypeName = "n1-standard-4";
// sourceImage: path to the operating system image to mount.
// * For details about images you can mount, see https://cloud.google.com/compute/docs/images
String sourceImage = "projects/debian-cloud/global/images/family/debian-11";
String sourceImage = "projects/debian-cloud/global/images/family/debian-13";
// diskSizeGb: storage size of the boot disk to attach to the instance.
long diskSizeGb = 10L;
// networkName: network interface to associate with the instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void main(String[] args)
String machineTypeName = "n1-standard-4";
// sourceImage: path to the operating system image to mount.
// * For details about images you can mount, see https://cloud.google.com/compute/docs/images
String sourceImage = "projects/debian-cloud/global/images/family/debian-11";
String sourceImage = "projects/debian-cloud/global/images/family/debian-13";
// diskSizeGb: storage size of the boot disk to attach to the instance.
long diskSizeGb = 10L;
// networkName: network interface to associate with the instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void main(String[] args)
String machineTypeName = "n1-standard-4";
// sourceImage: path to the operating system image to mount.
// * For details about images you can mount, see https://cloud.google.com/compute/docs/images
String sourceImage = "projects/debian-cloud/global/images/family/debian-11";
String sourceImage = "projects/debian-cloud/global/images/family/debian-13";
// diskSizeGb: storage size of the boot disk to attach to the instance.
long diskSizeGb = 10L;
// networkName: network interface to associate with the instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void main(String[] args)
String machineTypeName = "n1-standard-1";
// sourceImage: path to the operating system image to mount.
// * For details about images you can mount, see https://cloud.google.com/compute/docs/images
String sourceImage = "projects/debian-cloud/global/images/family/debian-11";
String sourceImage = "projects/debian-cloud/global/images/family/debian-13";
// diskSizeGb: storage size of the boot disk to attach to the instance.
long diskSizeGb = 10L;
// networkName: network interface to associate with the instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void main(String[] args)
// Name of the template you want to query.
String templateName = "YOUR_INSTANCE_TEMPLATE_NAME";
String machineType = "e2-standard-4";
String sourceImage = "projects/debian-cloud/global/images/family/debian-11";
String sourceImage = "projects/debian-cloud/global/images/family/debian-13";

createTemplateWithoutConsumingReservationAsync(
projectId, templateName, machineType, sourceImage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ public static void main(String[] args)
createSpotInstance(projectId, instanceName, zone);
}

// Create a new Spot VM instance with Debian 11 operating system.
// Create a new Spot VM instance with Debian 13 operating system.
public static Instance createSpotInstance(String projectId, String instanceName, String zone)
throws IOException, ExecutionException, InterruptedException, TimeoutException {
String image;
// Initialize client that will be used to send requests. This client only needs to be created
// once, and can be reused for multiple requests.
try (ImagesClient imagesClient = ImagesClient.create()) {
image = imagesClient.getFromFamily("debian-cloud", "debian-11").getSelfLink();
image = imagesClient.getFromFamily("debian-cloud", "debian-13").getSelfLink();
}
AttachedDisk attachedDisk = buildAttachedDisk(image, zone);
String machineTypes = String.format("zones/%s/machineTypes/%s", zone, "n1-standard-1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static void cleanup()
private static Image getActiveDebian()
throws IOException {
try (ImagesClient imagesClient = ImagesClient.create()) {
return imagesClient.getFromFamily("debian-cloud", "debian-11");
return imagesClient.getFromFamily("debian-cloud", "debian-13");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static void setup()
// Create disk from image.
DEBIAN_IMAGE = null;
try (ImagesClient imagesClient = ImagesClient.create()) {
DEBIAN_IMAGE = imagesClient.getFromFamily("debian-cloud", "debian-11");
DEBIAN_IMAGE = imagesClient.getFromFamily("debian-cloud", "debian-13");
}

// Create KMS Encrypted disk.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public static void setup()
// Create disk from image.
Image debianImage = null;
try (ImagesClient imagesClient = ImagesClient.create()) {
debianImage = imagesClient.getFromFamily("debian-cloud", "debian-11");
debianImage = imagesClient.getFromFamily("debian-cloud", "debian-13");
}
CreateDiskFromImage.createDiskFromImage(PROJECT_ID, ZONE, DISK_NAME, DISK_TYPE, DISK_SIZE,
debianImage.getSelfLink());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static void setup()

Image debianImage = null;
try (ImagesClient imagesClient = ImagesClient.create()) {
debianImage = imagesClient.getFromFamily("debian-cloud", "debian-11");
debianImage = imagesClient.getFromFamily("debian-cloud", "debian-13");
}

// Create zonal snapshot.
Expand Down
Loading