我的任务是将多个 VMware 虚拟机迁移到 Openstack,而无需重新启动它们。我们目前使用 VMwareVCDriver 来允许 Openstack 管理虚拟机。我面临的问题是让 Openstack 在将新虚拟机迁移到 VMware 后识别它们。我正尝试通过使用 sql 注入来填充 Openstack 数据库来解决这个问题。
示例 SQL 插入:
INSERT INTO instances(created_at,updated_at,deleted_at,user_id,project_id,image_ref,kernel_id,ramdisk_id,launch_index,key_name,key_data,power_state,vm_state,memory_mb,vcpus,hostname,host,user_data,reservation_id,scheduled_at,launched_at,terminated_at,display_name,display_description,availability_zone,locked,os_type,launched_on,instance_type_id,vm_mode,uuid,architecture,root_device_name,access_ip_v4,access_ip_v6,task_state,default_ephemeral_device,default_swap_device,progress,auto_disk_config,shutdown_terminate,disable_terminate,root_gb,ephemeral_gb,cell_name,node,deleted,locked_by,cleaned,ephemeral_key_uuid) VALUES ('2017-08-10 16:43:45','2017-08-10 12:41:10','NULL','e3612a55e2854b1092xxxxxxxxxxxxxxx','ce86e191cf854cb2a26bxxxxxxxxxxxxxxx','7436e749-56fc-xxxxxxxxxxxxxxx','NULL','NULL','0','NULL','NULL','1','shutdown','4096','1','servername','compute','NULL','r-ih3jv02l','NULL','2016-06-16 16:44:15','NULL','a',servername','A','0','NULL','compute','1000','NULL','2532a9e0-3cd3-4eef-b6bb-xxxxxxxxxxxxxxx','NULL','/dev/sda','NULL','NULL','NULL','NULL','NULL','1','0','0','0','100','0','NULL','xxxxx(lab)','0','NULL','0','NULL');
错误:
[root@controller ~]# nova show 2532a9e0-3cd3-4eef-b6bbxxxxxxxxxxxxxxx 错误(ClientException):服务器出现错误或无法执行请求的操作。(HTTP 500)(请求 ID:req-6cf5160d-1748-41dc-acd2-74db7fc9df94)