Why not hehe, though I must admit it's easier, yes you can have a simpler template :) just copy a libvirt.xml and update the instance name. You could even come up with a small bash script ./recover.sh $instance-name that would perform the following steps :
• Retrieve the instance name and put it into the <name></name> brackets • Run "virsh define " • Restart nova-compute
voila :)
Razique Mahroua - Nuage & CoTel : +33 9 72 37 94 15
anytime this happend with me I do the following.
create a lost_instance.xml with the content below(I think it's possible to create a simpler file, with less content) just to register a VM with libvirt. Make sure to change the <name></name> tag. In your case
<domain type='kvm'> <name>instance-0000002a</name> <memory unit='KiB'>4194304</memory> <currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>4</vcpu> <os> <type arch='x86_64' machine='pc-1.0'>hvm</type> <boot dev='hd'/> </os> <features>
<acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot>
<on_crash>restart</on_crash> <devices> <emulator>/usr/bin/kvm</emulator> <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller> <controller type='usb' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller> <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target type='serial' port='0'/>
</console> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <video> <model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</memballoon> </devices> </domain>
save and exit
and then # virsh define lost_instance.xml # service nova-compute restart
it's easier then mess with the database.
|
_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp