Membuat instance VM Linux di Compute Engine

Pelajari cara membuat instance virtual machine (VM) Linux di Compute Engine menggunakan Google Cloud konsol.


Untuk mengikuti panduan langkah demi langkah untuk tugas ini langsung di Google Cloud konsol, klik Pandu saya:

Pandu saya


Sebelum memulai

  1. Login keakun Anda. Google Cloud Jika Anda baru menggunakan Google Cloud, buat akun untuk mengevaluasi performa produk kami dalam skenario dunia nyata. Pelanggan baru juga mendapatkan kredit gratis senilai $300 untuk menjalankan, menguji, dan men-deploy workload.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Make sure that you have the following role or roles on the project: Compute Instance Admin (v1), Compute Security Admin, OSPolicyAssignment Admin, Service Account User, Service Usage Admin

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. Click Grant access.
    4. In the New principals field, enter your user identifier. This is typically the email address for a Google Account.

    5. Click Select a role, then search for the role.
    6. To grant additional roles, click Add another role and add each additional role.
    7. Click Save.
  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Make sure that you have the following role or roles on the project: Compute Instance Admin (v1), Compute Security Admin, OSPolicyAssignment Admin, Service Account User, Service Usage Admin

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. Click Grant access.
    4. In the New principals field, enter your user identifier. This is typically the email address for a Google Account.

    5. Click Select a role, then search for the role.
    6. To grant additional roles, click Add another role and add each additional role.
    7. Click Save.
  8. Mengaktifkan Compute Engine API

    Mengaktifkan Compute Engine API

Membuat instance VM Linux

  1. Di Google Cloud konsol, buka halaman Buat instance.

    Buka Create an instance

  2. Di bagian OS and Storage, klik Change untuk mulai mengonfigurasi boot disk Anda.
  3. Di tab Public images, pilih Ubuntu dari daftar Operating system.
  4. Pilih Ubuntu 24.04 LTS dari daftar Version.
  5. Klik Select.
  6. Di bagian Firewall, pilih Allow HTTP traffic.
  7. Untuk membuat VM, klik Create.

Tunggu beberapa saat hingga instance VM dimulai. Setelah instance VM siap, instance akan dicantumkan di halaman VM instances dengan ikon status hijau.

Compute Engine memberikan peran roles/compute.instanceAdmin kepada pengguna yang membuat instance VM. Compute Engine juga menambahkan pengguna tersebut ke grup sudo.

Terhubung ke instance VM

Hubungkan ke instance VM menggunakan Google Cloud konsol dan selesaikan langkah-langkah berikut. Anda terhubung ke instance VM sebagai pengguna yang Anda gunakan untuk mengakses halaman VM instances.

  1. Di Google Cloud konsol, buka halaman VM instances.

    Buka instance VM

  2. Di daftar instance virtual machine, klik SSH di baris instance yang ingin Anda hubungkan.

    Tombol SSH di samping nama instance.

Pembersihan

Agar akunAnda tidak dikenai biaya untuk resource yang digunakan pada halaman ini, ikuti langkah-langkah berikut. Google Cloud

  1. Di Google Cloud konsol, buka halaman VM instances.

    Buka instance VM

  2. Pilih baris yang berisi instance VM yang telah Anda buat dalam tutorial ini.

  3. Klik Delete, lalu klik Delete untuk mengonfirmasi.

Langkah berikutnya