i make wrong command that make my vm status DONE
that make my vm id 75 cannot start again
![]()
but when i check the data on disk 0 stiill exist
please help me to create new VM id with data VM 75 ![]()
i make wrong command that make my vm status DONE
that make my vm id 75 cannot start again
![]()
but when i check the data on disk 0 stiill exist
please help me to create new VM id with data VM 75 ![]()
You just need to create new image discs with the ones still present in your datastore. You’ll need to move them in a SAFE_DIRS first.
Then, create a new VM template using the new image and start it.
Another option, since you still have the data in system datastrore, is to edit the VM in database to change its state from DONE to POWEROFF using onedb change-body.
Then the VM should be resumable.
Make sure to copy the data before doing more mistakes ![]()
And make sure the VM is not running using a command like virsh list | grep one-75
Hi thanks for your reply, can you make example update status via database step by step? Because im really newbie about this
So, the first backup the 75 directory, I use to just cp -r 75 75.saved-copy in the 0 directory.
Then, best to learn seems to use an editor:
onedb update-body vm --id 75
Then, you replace the <STATE>6</STATE> (meaning DONE) with <STATE>8</STATE> (meaning POWEROFF), you save and quit and you can see what it says now for the vm with onevm show 75
hi im running onedb change-body vm --id 75 /VM/STATE 8, the state is change from DONE to power off,
but on opennebula vm id 75 is still not showing
I need more informations: onevm show -x 75
But maybe resurrecting a DONE VM is a bad idea and you should stick with your first idea, create new images from the old disks and a new VM template to use them.
hi Danniel sory for late reply can you give me example step by step of first idea?
The procedure may look as below.
onedatastore show <imageds_id>|grep -i safe
SAFE_DIRS="/var/tmp /var/lib/one/datastores"
Copy VM disk.0 file from hypervisor node to FE node into one of the directory mentioned in the SAFE_DIRS attribute (e.g. /var/tmp/)
Register new image from that disk copy:
oneimage create --name <new-name> --path /var/tmp/disk.0 --datastore <imageds_id> --prefix vd --type OS
(add --persistent flag in case of necessity to make that image persistent)