Hướng dẫn chuyển VPS thành Template cho các khách hàng có hệ thống riêng

Bước 1: Đăng nhập vào Dashboard của khách hàng để xem VPS gốc dùng hệ điều hành gì > Lấy thông tin uuid, password, is_linux, root_path

Bước 2: Nếu VPS gốc là ubuntu thì login vào console xóa history, và xóa file netplan

history -c
> /root/.bash_history
rm -f /etc/netplan/….yaml
  • Nếu vps gốc là almalinux
history -c
> /root/.bash_history
rm -f /etc/sysconfig/network-script/ifcfg-ens192

Bước 3: off VM, move vào folder template và đổi tên VPS

Bước 4: Update VPS thành đã xóa ở Dashboard:

Bước 5: Vào menu IP, đổi trạng thái IP thành “Không dùng”

Bước 6: Truy cập vào db mysql để update

update vps set status_vps=’delete_vps’, vm_id=-1 where vm_id=[vm_id];
update ips set status=0 where ip='[ip_vm]’;

Bước 7: Tạo template trên Dashboard

+ Name: cùng tên đã đổi trên vCenter
+ Host: vSAN
+ Uuid: lấy từ InstanceUUID từ VM
+ OS: lấy số tiếp theo từ danh sách Template
+ is_linux: lấy theo thông số template của VM
+ password: lấy theo password của VM
+ root_path: lấy theo thông số template của VM

Bước 8: Dùng Postman để tạo Template tương ứng cho Portal

Method: POST
URL: https://cloudserver.h2cloud.vn/api/update-os-vps
Token: Token BN/v)+}V6RBH9w}.#w[qNmGueBF&w#*pdMC-cU$e;i=MZwpA5V{0yxbHKS#E2P*M
Body:
{
“type”: “add”,
“list-os”: {
“0”: {
“id”: [ứng với os tạo ở bước 7],
“name”: “[ứng với name tạo ở bước 7]”
}
}
}

Was this article helpful?

Hướng dẫn liên quan

Leave A Comment?