Antsle Forum
Welcome to our Antsle community! This forum is to connect all Antsle users to post experiences, make user-generated content available for the entire community and more.
Please note: This forum is about discussing one specific issue at a time. No generalizations. No judgments. Please check the Forum Rules before posting. If you have specific questions about your Antsle and expect a response from our team directly, please continue to use the appropriate channels (email: [email protected]) so every inquiry is tracked.
Antlet Virtual Drive Deleted, Restore Snapshot?
Quote from akak01000101 on March 24, 2020, 6:03 pmSomeone on our team deleted the virtual drive of an antlet thinking it was the external hard drive. Is it possible to restore the antlet from a snapshot that was taken earlier today?
We tried to create a new antlet with the same hostname, but it already exists in /antlets with an XML file and Antman will not create it.
Any help is greatly appreciated.
Someone on our team deleted the virtual drive of an antlet thinking it was the external hard drive. Is it possible to restore the antlet from a snapshot that was taken earlier today?
We tried to create a new antlet with the same hostname, but it already exists in /antlets with an XML file and Antman will not create it.
Any help is greatly appreciated.
Quote from lancem on March 25, 2020, 7:13 amIf you need to get a certain file from a snapshot (and not the entire snapshot), you can access the files with:
ssh to the antsle (antsle, not antlet)
cd /antlets/{antletname}/.zfs/snapshot/{snapshotname}
Then copy whatever files you need to their original locations.
But to restore the whole antlet, in Antman, you click on the antlet, then the snapshots tab. Then there's a menu at the far right to restore that snapshot.
*Note that if you want to restore to a snapshot older than the latest, it will delete the newer snapshots (newer than the one you're restoring to)
If you need to get a certain file from a snapshot (and not the entire snapshot), you can access the files with:
ssh to the antsle (antsle, not antlet)
cd /antlets/{antletname}/.zfs/snapshot/{snapshotname}
Then copy whatever files you need to their original locations.
But to restore the whole antlet, in Antman, you click on the antlet, then the snapshots tab. Then there's a menu at the far right to restore that snapshot.
*Note that if you want to restore to a snapshot older than the latest, it will delete the newer snapshots (newer than the one you're restoring to)
Quote from akak01000101 on March 25, 2020, 8:28 amThanks for the reply, but .zfs isn't there. I know there were 2 snapshots made, one from yesterday morning.
root@myantsle:/ # ls -al /antlets/pizza
total 7
drwxr-xr-x 2 root root 3 Mar 24 17:24 .
drwxr-xr-x 44 root root 4096 Mar 24 18:42 ..
-rw-r--r-- 1 root root 3119 Mar 24 16:04 antlet-libvirt.xml
Thanks for the reply, but .zfs isn't there. I know there were 2 snapshots made, one from yesterday morning.
root@myantsle:/ # ls -al /antlets/pizza
total 7
drwxr-xr-x 2 root root 3 Mar 24 17:24 .
drwxr-xr-x 44 root root 4096 Mar 24 18:42 ..
-rw-r--r-- 1 root root 3119 Mar 24 16:04 antlet-libvirt.xml
Quote from lancem on March 25, 2020, 9:23 amIt's invisible (even ls -la doesn't show it).
Try typing:
cd /antlets/pizza/.zfs
Then
ls -l
It's invisible (even ls -la doesn't show it).
Try typing:
cd /antlets/pizza/.zfs
Then
ls -l
Quote from akak01000101 on March 25, 2020, 1:27 pmI wasn't expecting it to be hidden, thanks! Files were copied as recommended, but when the virtual drive was deleted, the Antlet was no longer listed in antMan.
"But to restore the whole antlet, in Antman, you click on the antlet, then the snapshots tab. Then there's a menu at the far right to restore that snapshot."
So your comment on the next step, can't be performed.
I wasn't expecting it to be hidden, thanks! Files were copied as recommended, but when the virtual drive was deleted, the Antlet was no longer listed in antMan.
"But to restore the whole antlet, in Antman, you click on the antlet, then the snapshots tab. Then there's a menu at the far right to restore that snapshot."
So your comment on the next step, can't be performed.
Quote from mardo.delcid on March 25, 2020, 3:57 pmHi @akak01000101,
You can also try cloning the antlet from the snapshot. Then take move or copy the drive back, and optionally delete the clone.
Hi @akak01000101,
You can also try cloning the antlet from the snapshot. Then take move or copy the drive back, and optionally delete the clone.
Quote from akak01000101 on March 25, 2020, 4:07 pmI have this now below, but again antMan doesn't see it. What shell commands can I use to get antMan to see it. I tried restarting antMan thinking it would re-scan everything. That didn't work.
root@myantsle:/ # ls -l /antlets/pizza
total 17243486
-rw-r--r-- 1 root root 3119 Mar 25 12:07 antlet-libvirt.xml
-rw------- 1 root root 1111750191 Mar 25 12:07 libvirt-state
-rw-r--r-- 1 root root 32750960640 Mar 25 12:12 Ubuntu-18.04.kvm.qcow2
I have this now below, but again antMan doesn't see it. What shell commands can I use to get antMan to see it. I tried restarting antMan thinking it would re-scan everything. That didn't work.
root@myantsle:/ # ls -l /antlets/pizza
total 17243486
-rw-r--r-- 1 root root 3119 Mar 25 12:07 antlet-libvirt.xml
-rw------- 1 root root 1111750191 Mar 25 12:07 libvirt-state
-rw-r--r-- 1 root root 32750960640 Mar 25 12:12 Ubuntu-18.04.kvm.qcow2
Quote from mardo.delcid on March 25, 2020, 4:14 pm@akak01000101
If you manually moved it, you need to update the domain's XML with the `virsh edit pizza` command, then add the following XML below the `<emulator>` tag:
```
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/antlets/pizza/Ubuntu-18.04.kvm.qcow2'/>
<target dev='vda' bus='virtio'/>
</disk>
```
If you manually moved it, you need to update the domain's XML with the `virsh edit pizza` command, then add the following XML below the `<emulator>` tag:
```
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/antlets/pizza/Ubuntu-18.04.kvm.qcow2'/>
<target dev='vda' bus='virtio'/>
</disk>
```
Quote from mardo.delcid on March 25, 2020, 4:15 pmJust to be clear, should look like this:
```
<emulator>...</emulator>
<disk type='file' device='disk'>
...
</disk>
```
Just to be clear, should look like this:
```
<emulator>...</emulator>
<disk type='file' device='disk'>
...
</disk>
```
Quote from akak01000101 on March 25, 2020, 5:20 pm[SOLVED] I'm up and running. Thanks guys!
- cd /antlets/{antletname}/.zfs/snapshot/{snapshotname};
- cp * /antlets/[antletname}/
- virsh edit {antletname}
<emulator>...</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/antlets/{antletname}/{OS_template}.{type}.qcow2'/>
<target dev='vda' bus='virtio'/>
</disk>4. The antlet will boot at this point.
BUT... I also have a USB drive attached. I discovered the Device number in Antman changed, and the Antlet would still would not boot. It would give an error "Internal Error: Did not find USB device BUS:2 Device:4" when I tried to start the Antlet.
So in the virsh edit, I also removed the following and just re-added the USB drive that was displayed in Antman.
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='1' device='4'/>
</source>
<address type='usb' bus='0' port='2'/>
</hostdev>Antlet boots and the USB drive mounts just fine!
Thanks again.
[SOLVED] I'm up and running. Thanks guys!
- cd /antlets/{antletname}/.zfs/snapshot/{snapshotname};
- cp * /antlets/[antletname}/
- virsh edit {antletname}
<emulator>...</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/antlets/{antletname}/{OS_template}.{type}.qcow2'/>
<target dev='vda' bus='virtio'/>
</disk>
4. The antlet will boot at this point.
BUT... I also have a USB drive attached. I discovered the Device number in Antman changed, and the Antlet would still would not boot. It would give an error "Internal Error: Did not find USB device BUS:2 Device:4" when I tried to start the Antlet.
So in the virsh edit, I also removed the following and just re-added the USB drive that was displayed in Antman.
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='1' device='4'/>
</source>
<address type='usb' bus='0' port='2'/>
</hostdev>
Antlet boots and the USB drive mounts just fine!
Thanks again.