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. 

Please or Register to create posts and topics.

Pre-purchase questions - restore to antlets?

I've been a software developer for more than 25 years, and one problem I have is maintaining legacy applications.  I literally have a few old computers laying around that I sometimes have to fire up to get access to an old application.  I have a Windows XP box, Windows 7, Windows 10, Ubuntu 14.04, etc.

I also have a couple Digital Ocean droplets with web applications that I maintain.

My goal is to move this all to antlets.  How difficult is it to backup these various systems and restore them to antlets?  Seriously, my life would be perfect if I could just log into antMan, click "Start" on my XP instance, RDP into it, do what I need to do, and stop the instance.

Any personal experience with restoring existing OSes to antlets?

I have done this multiple times:

A Windows 7 desktop

A Windows Vista laptop

A Windows 10 Pro laptop

Two Windows 10 Pro desktops [these are "fail-over" computers I periodically restore from the physical computers in case the physical dies]

The computers that didn't have UEFI and were very easy.  The UEFI computer needed a tweak to the antlet configuration (directly editing the XML definition) to enable UEFI.

For the non-UEFIs:

I create a blank KVM antlet (this is just a blank empty vm -- the Antsle comes with other "pre-defined" template like Ubuntu and Windows server etc).

I gave this antlet the same size hard drive as the physical computer and added the Windows rescue cd ISO to the antlet as a CDROM.

https://docs.antsle.com/antlets/virtual-drives

*tip -- when I create a virtual hard drive for my antlets (say for 1 TB), I create a 1 GB drive.  Then I go to the antsle command line and re-size it using:

qemu-img resize {path to virtual drive file} +1023G

This is much faster than re-sizing in the web ui

This describes importing an ISO image as a CDROM:

https://docs.antsle.com/templates/install-os-from-.iso

I backed-up the physical to a network-accessible drive using Windows backup.

Then I started the antlet.  When i booted from the rescue CD, I did a restore from the windows backup (via the network).

And that was it!  The Windows on the antlet complained about not being activated (it took some searching to get a key for Windows 7).  I haven't activated the 2 Windows 10 computers yet since I don't use them (they're just failover for my 2 currently working computers).

The UEFI computer required adding the OVMF module to the antlet via the XML definition file (I don't remember if the module was already on the antsle or if I had to install it -- I'll have to research that).  But once the UEFI was enabled in the antlet, then it was the same procedure.

 

Thanks for the help.  I have my Antsle one D+ now and I have my Windows 10 antlet set up and running.  Now I'm working on moving a few Digital Ocean droplets.  Here is the process I have established and am using:

  1. Create an antlet (blank or other)
  2. Log into Digital Ocean droplet with ssh
  3. Droplet must have block storage attached
  4. Make a complete image of droplet with command:
    dd if=/dev/vda of=/mnt/volume_nyc3_01/snapshot.image
    (replace /mnt/volume_nyc3_01/ with actual path to block storage)
  5. Log into Antsle with ssh (NOT into antlet)
  6. Navigate to desired antlet directory (cd /antlets/ANTLETNAME)
  7. Copy file from droplet to Antsle
    scp [email protected]:/mnt/volume_nyc3_01/snapshot.image /antlets/ANTLETNAME
    (replace /mnt/volume_nyc3_01/ with actual path to block storage, 0.0.0.0 with actual IP address of droplet, and ANTLETNAME with actual name of antlet)
  8. Delete or rename antlet qcow2 file (copy the original file name for next step)
  9. Convert image file to qcow2 file with the same name as the original
    qemu-img convert -O qcow2 snapshot.image antletname.kvm.qcow2
    (replace antletname with actual name of the file)
  10. Cross your fingers and start the antlet

Please let me know if I'm missing anything, or if I'm making it unnecessarily complicated.  It seems to be working for me, but time will tell...

 

lancem has reacted to this post.
lancem

I don't know anything about Digital Ocean, but that seems good to me.

One thing that hits me sometimes is an issue with a driver (NIC or Drive).

For example, I create my KVM antlet with a virtio driver for the virtual drive, but the Windows instance the drive came from doesn't have the virtio drivers installed (same for bridged virtual NICs).  So it won't boot because the O/S can't "see" the hard drive.

But if I'm bringing in a vmdk image or something (such as converting it to qcow like you're doing), I'll create the virtual drive in the KVM antlet as SATA to be safe.
And for Windows, I'll create the bridged NIC as e1000 driver.

Quote from lancem on September 1, 2020, 10:18 am

I don't know anything about Digital Ocean, but that seems good to me.

Digital Ocean has a large selection of pre-built droplets in their "Marketplace".  Like WordPress on OpenLiteSpeed, Magento 2 Open Source on Ubuntu, SolidInvoice, Invoice Ninja, and more than 150 others.  Sure, you can set these up yourself, but it's pretty cool getting them ready-to-go with a few clicks.  I'll be moving a few over to antlets.

lancem has reacted to this post.
lancem

Looks interesting!  I see they have an OpenVPN droplet.

I'll have to check it out.

Thanks!

@lancem can you expand on "adding the OVMF module to the antlet" that you mentioned?  How do I do that?

I have this message when I try to restore a Windows system image: "The system image was created on a computer using EFI and this computer is using BIOS".

EDIT: Ok, I found this post by you: https://antsle.com/forum/topic/virtualizing-physical-windows-uefi/, but unfortunately my Antsle one D+ does not appear to have a folder called /usr/share/edk2-ovmf/.

With the new edgeLinux 2 (CentOS), you have to add the yum repo and install it:

https://www.nbalonso.com/centos-7-uefi-boot-kvm/index.html

Then you add this line to your antlet XML after the <type arch= line:

<loader type='rom'>/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>

After upgrading my Antsle to the new edgeLinux 2 (and finally restoring one of my phyiscals to an antlet), I found that the "sata" virtual drive type doesn't work.  So I use "ide" for the initial boot.

** Tip:  If you add a virtual drive to an antlet as one type (ide, sata, virtio) and want to change it, you can do it directly in the XML without re-importing it:

  1. add another virtual drive of the type you want (say virtio)
  2. in the antlet XML, there are 2 lines after the path to the virtual drive that define its type.  They look something like:

For IDE:

<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>

For SATA:

<target dev='sda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>

For VIRTIO:

<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>

By putting these 2 lines after the line with the path to the virtual drive, that changes its type

If I want to change a drive from IDE to VIRTIO, I will add a 1 GB virtio drive and then copy its target/address info to my drive.

Then I can delete the 1 GB dummy drive.  That way you know the numbers for the address are valid.

Then I change the antlet to use virtio drivers:

I add the ISO for the drivers to the antlet as a CDROM:

https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso

Add a dummy 1 GB virtio virtual drive to the antlet

Boot into the antlet.  In the Windows Device Manager, it won't recognize the 1 GB drive. So you update the drivers for the device and get them from the mounted ISO

This gets the virtio storage drivers installed in Windows.

Then I shutdown the antlet and edit the XML to change the drive's type from ide to virtio (using the info mentioned above).

Then delete the lines for the 1 GB drive (everything between and including the <disk and /disk>) you don't need that 1 GB drive anymore.  That was just to load the virtio drivers into the O/S.

So, now you should have your main drive using virtio drivers.

You should be able to start the antlet and it (hopefully) will boot into Windows.

In the Windows Device Manager, there's also another unknown device that uses the virtio Balloon memory driver.  You can update it's driver too using the virtio ISO (mounted in the Windows antlet).

In my case, since my Windows antlets are "standbys" for my physical computers, I have to re-do the whole ide/virtio dance each time I restore the physical over the virtual (which is why I typically don't restore them until the physical computer dies).

Here's what I did (if anyone searches this in the future):

  1. Log into Antsle
  2. cd /etc/yum.repos.d/
  3. wget http://www.kraxel.org/repos/firmware.repo
  4. yum install edk2.git-ovmf-x64 -y
  5. virsh edit <ANTLETNAME>
  6. Add the following to the <os> section:
    <loader type='rom'>/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
  7. (I also had to add <boot dev='cdrom'/> before <boot dev='hd'/>)
  8. Save and exit
  9. I gave up trying to use the Windows backup/system restore.  It's just too darn picky.  So instead I used AOMEI Backupper (freeware)
  10. Backup Windows system with AOMEI Backupper
  11. Create AOMEI boot iso image and load it as a CD-ROM in antlet
  12. Boot to CD-ROM and restore image
lancem and danielgalvan have reacted to this post.
lancemdanielgalvan