溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

openstack如何刪除一個實例

發(fā)布時間:2021-12-29 15:09:46 來源:億速云 閱讀:254 作者:小新 欄目:云計算

這篇文章將為大家詳細講解有關openstack如何刪除一個實例,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。

從dashboard頁面上terminate instance

1.刪除配置文件

/etc/libvirt/qemu/instance-0000000*.xml

2.刪除響應的文件目錄

/var/lib/nova/instances/instance-0000000*

3.

修改數(shù)據(jù)庫

1)instance表中修改deleted_at,deleted,vm_state,terminated_at字段。沒有修改手工操作中power_state,root_device_name,task_state 三個字段。

  手工操作如下:

update instances set  

deleted_at = updated_at,  

deleted = 1,  

power_state = 0,  

vm_state = "deleted",  

terminated_at = updated_at,  

root_device_name = NULL,  

task_state = NULL  

where id = 9; 

2)virtual_interfaces 表中響應的instanceid的記錄刪除。手工操作如下:

delete from virtual_interfaces where instance_id=9;

3) instance_info_caches 表中修改deleted_at 和deleted字段。 手工操作如下

update instance_info_caches set  

deleted_at = updated_at,  

deleted = 1  

where instaceid = 9; 

4)fixed_ips 表中修改instance_id,allocated,virtual_interface_id ,leased字段。手工操作如下

update fixed_ips set  

instance_id = NULL,  

allocated = 0,  

leased= 0,

virtual_interface_id = NULL  

where instanceid = 9; 

注意:

創(chuàng)建一個instance時fixed_ip表的變化

fixed_ips 表中修改instance_id,allocated,virtual_interface_id 字段。instance_id

allocated=1

leased=1

virtual_interface_id=select id from virtual_interfaces where instance_id=9

手工操作如下

update fixed_ips set  

instance_id = instanceid,  

allocated = 1,

leased = 1,  

virtual_interface_id = select id from virtual_interfaces where instance_id=9

where id = 9; 

5)security_group_instance_association表中deleted_at  deleted兩個字段

注意:

創(chuàng)建一個instance時security_group_instance_association表的變化

insert into `nova`.`security_group_instance_association`
            (`created_at`,
             
             `deleted`,
             `id`,
             `security_group_id`,
             `instance_id`)
values ('created_at',
        
        '0',
        'id',
        '1',
        '9');`

關于“openstack如何刪除一個實例”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內容。

AI