Jika image Ubuntu LTS mencapai akhir siklus prosesnya, image tersebut tidak akan didukung lagi dan tidak akan menerima update keamanan. Jika Anda mengupgrade ke Ubuntu Pro, Anda akan terus menerima update keamanan selama Extended Security Maintenance (ESM).
Dokumen ini menunjukkan cara mengupgrade dari Ubuntu ke Ubuntu Pro dengan melakukan hal berikut untuk setiap VM:
- Instal update dan dependensi.
- Ganti lisensi Ubuntu dengan lisensi Ubuntu Pro.
- Validasi lisensi.
Jalur upgrade yang didukung
Tabel berikut menunjukkan jalur upgrade yang didukung:
Versi awal | Versi akhir |
---|---|
Ubuntu 16.04 LTS | Ubuntu Pro 16.04 LTS |
Ubuntu 18.04 LTS | Ubuntu Pro 18.04 LTS |
Ubuntu 20.04 LTS | Ubuntu Pro 20.04 LTS |
Ubuntu 22.04 LTS | Ubuntu Pro 22.04 LTS |
Ubuntu 24.04 LTS | Ubuntu Pro 24.04 LTS |
Batasan
Anda harus menghentikan VM sebelum mengganti lisensi.
Anda hanya dapat mengupgrade dari Ubuntu LTS ke Ubuntu Pro LTS jika keduanya memiliki versi yang sama. Misalnya, Anda dapat mengupgrade dari Ubuntu 16.04 LTS ke Ubuntu Pro 16.04 LTS, tetapi tidak dapat mengupgrade dari Ubuntu 16.04 LTS ke Ubuntu Pro 20.04 LTS.
Penagihan
Anda akan ditagih untuk Ubuntu Pro LTS sesuai dengan harga untuk image premium.
Untuk mengetahui informasi selengkapnya tentang penagihan, lihat Penagihan Cloud.
Sebelum memulai
-
Jalankan perintah berikut di setiap VM, dengan mengganti
VM_NAME
dengan nama VM yang akan diupgrade:-
Update indeks paket menggunakan perintah berikut:
gcloud compute ssh VM_NAME --command "sudo apt update"
-
Instal versi terbaru paket menggunakan perintah berikut:
gcloud compute ssh VM_NAME --command "sudo apt -f upgrade"
-
Instal Ubuntu Pro menggunakan perintah berikut:
gcloud compute ssh VM_NAME --command "sudo apt -f install ubuntu-advantage-pro"
-
Update indeks paket menggunakan perintah berikut:
-
Jika Anda belum melakukannya, siapkan autentikasi.
Autentikasi adalah
proses yang digunakan untuk memverifikasi identitas Anda untuk mengakses Trusted Cloud by S3NS layanan dan API.
Untuk menjalankan kode atau sampel dari lingkungan pengembangan lokal, Anda dapat melakukan autentikasi ke
Compute Engine dengan memilih salah satu opsi berikut:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Trusted Cloud console to access Trusted Cloud by S3NS services and APIs, you don't need to set up authentication.
gcloud
-
Instal Google Cloud CLI, lalu login ke gcloud CLI dengan identitas gabungan Anda. Setelah login, lakukan inisialisasi Google Cloud CLI dengan menjalankan perintah berikut:
gcloud init
- Set a default region and zone.
Mengganti lisensi
Ganti lisensi Ubuntu dengan lisensi Ubuntu Pro menggunakan prosedur berikut:
Hentikan VM menggunakan perintah
gcloud compute instances stop
:gcloud compute instances stop VM_NAME \ --zone=ZONE
Ganti kode berikut:
VM_NAME
: nama VM yang akan dihentikanZONE
: zona yang berisi VM yang akan dihentikan
Dapatkan daftar disk yang terkait dengan VM menggunakan perintah
gcloud compute instances describe
:gcloud compute instances describe VM_NAME \ --zone=ZONE \ --format="yaml(disks)"
Ganti kode berikut:
VM_NAME
: nama VM untuk mendapatkan daftar disk terkaitZONE
: zona yang berisi VM untuk mendapatkan daftar disk terkait
Pastikan output-nya mirip dengan:
disks: - autoDelete: true boot: true deviceName: ubuntu diskSizeGb: '10' guestOsFeatures: - type: VIRTIO_SCSI_MULTIQUEUE - type: SEV_CAPABLE - type: UEFI_COMPATIBLE - type: GVNIC index: 0 interface: SCSI kind: compute#attachedDisk licenses: - https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/licenses/ubuntu-1604-xenial mode: READ_WRITE shieldedInstanceInitialState: dbxs: - content: ... fileType: BIN source: https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE/disks/VM_NAME type: PERSISTENT
Perhatikan bahwa tidak ada
Licenses
yang diganti.Dapatkan nama boot disk dengan menjalankan perintah
gcloud compute disks list
:gcloud compute disks list
Perbarui boot disk dengan URI lisensi Ubuntu Pro menggunakan perintah
gcloud compute disks update
:gcloud compute disks update DISK_NAME \ --zone=ZONE \ --replace-license="PREVIOUS_LICENSE, NEW_LICENSE"
Ganti kode berikut:
DISK_NAME
: nama boot disk yang akan diganti lisensinya.ZONE
: zona yang berisi boot disk untuk mengganti lisensi.PREVIOUS_LICENSE
: URI lisensi untuk versi UbuntuNEW_LICENSE
: URI lisensi Ubuntu Pro baru.
Tabel berikut menunjukkan URI lisensi untuk versi Ubuntu Pro yang didukung:
Versi Ubuntu Pro URI lisensi Ubuntu Pro 16.04 LTS https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-1604-lts
Ubuntu Pro 18.04 LTS https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-1804-lts
Ubuntu Pro 20.04 LTS https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-2004-lts
Ubuntu Pro 22.04 LTS https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-2204-lts
Ubuntu Pro 24.04 LTS https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-2404-lts
Memvalidasi lisensi
Validasi lisensi Ubuntu Pro menggunakan prosedur berikut:
Dapatkan informasi tentang boot disk dengan menjalankan perintah
gcloud compute disks describe
:gcloud compute disks describe DISK_NAME \ --zone=ZONE
Ganti kode berikut:
DISK_NAME
: nama boot disk untuk memvalidasi lisensinyaZONE
: zona yang berisi boot disk untuk memvalidasi lisensi
Verifikasi output yang mirip dengan:
creationTimestamp: '2021-10-20T17:20:26.616-07:00' guestOsFeatures: - type: VIRTIO_SCSI_MULTIQUEUE - type: SEV_CAPABLE - type: UEFI_COMPATIBLE - type: GVNIC id: '7008232787326864549' kind: compute#disk labelFingerprint: 42WmSpB8rSM= lastAttachTimestamp: '2021-10-20T17:20:26.617-07:00' licenseCodes: - '1000201' - '8045211386737108299' licenses: - https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/licenses/ubuntu-1604-xenial - https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-1604-lts name: ubuntu physicalBlockSizeBytes: '4096' selfLink: https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE/disks/DISK_NAME sizeGb: '10' sourceImage: https://www.googleapis.com/compute/v1/projects/IMAGE_PROJECT/global/images/IMAGE sourceImageId: '1233998915439563944' status: READY type: https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE/diskTypes/DISK_TYPE users: - https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE/instances/VM_NAME zone: https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE
Pastikan lisensi Ubuntu Pro ditambahkan ke boot disk dengan memeriksa output langkah sebelumnya untuk kolom
licenses
pada string lisensi yang sesuai.Jika kolom
licenses
tidak berisi string lisensi yang diinginkan, Anda mungkin perlu menghapus dan memperbarui lisensi. Untuk informasi selengkapnya, lihat perintahgcloud compute disks update
.Mulai VM menggunakan perintah
gcloud compute instances start
:gcloud compute instances start VM_NAME \ --zone=ZONE \ [--csek-key-file ENCRYPTION_KEY]
Ganti kode berikut:
VM_NAME
: nama VM yang akan dimulaiZONE
: zona yang berisi VM yang akan dimulaiENCRYPTION_KEY
: Opsional: menentukan jalur ke file Kunci Enkripsi yang Disediakan Pelanggan (CSEK) jika disk booting dienkripsi
Setelah VM melakukan booting, jalankan perintah
gcloud compute ssh
untuk memverifikasi bahwa Ubuntu ESM berhak dan diaktifkan:gcloud compute ssh VM_NAME --command "sudo ua status --wait" \ --zone=ZONE
Ganti kode berikut:
VM_NAME
: nama VM yang akan diverifikasiZONE
: zona yang berisi VM yang akan diverifikasi
Periksa apakah Ubuntu ESM berhak dan diaktifkan dengan memverifikasi bahwa outputnya mirip dengan:
SERVICE ENTITLED STATUS DESCRIPTION cis yes disabled Center for Internet Security Audit Tools esm-apps yes enabled UA Apps: Extended Security Maintenance (ESM) esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM) fips yes n/a NIST-certified core packages fips-updates yes n/a NIST-certified core packages with priority security updates livepatch yes n/a Canonical Livepatch service
Melihat log aktivitas
Lihat histori pembaruan lisensi untuk VM dalam sebuah project menggunakan prosedur berikut:
Di konsol Trusted Cloud , buka halaman Logs Explorer.
Di toolbar, pastikan Tampilkan kueri diaktifkan.
Salin ekspresi berikut ke editor kueri:
resource.type="gce_disk" logName="projects/PROJECT_NAME/logs/cloudaudit.googleapis.com%2Factivity" severity>=NOTICE protoPayload.request.@type="type.googleapis.com/compute.disks.update" protoPayload.request.licenses:*
Ganti
PROJECT_NAME
dengan nama project Anda.Klik Run query.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-08-18 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-18 UTC."],[[["\u003cp\u003eThis document provides instructions on how to upgrade from Ubuntu LTS to Ubuntu Pro LTS, which extends security updates during the Extended Security Maintenance (ESM) period.\u003c/p\u003e\n"],["\u003cp\u003eThe upgrade process involves installing updates and dependencies, appending the Ubuntu Pro license to the VM's boot disk, and then validating that the license has been correctly applied.\u003c/p\u003e\n"],["\u003cp\u003eUpgrades are only supported between Ubuntu LTS and Ubuntu Pro LTS of the same version, such as Ubuntu 16.04 LTS to Ubuntu Pro 16.04 LTS.\u003c/p\u003e\n"],["\u003cp\u003eBefore appending the license, the VM must be stopped, and the user must have the \u003ccode\u003ecompute.disks.update\u003c/code\u003e permission on the boot disk.\u003c/p\u003e\n"],["\u003cp\u003eAfter applying and validating the license, you can verify that Ubuntu ESM is entitled and enabled by using the \u003ccode\u003egcloud compute ssh\u003c/code\u003e command to check the status on the VM.\u003c/p\u003e\n"]]],[],null,[]] -