randy/virtual-canary.md
2023-09-06 12:14:01 -07:00

2.7 KiB

Installing a Virtual Canary on Ganeti

I wanted to install a virtual canary on a ganeti cluster. This is a different scnario from what they expect.

In this example, the virtual canary instance is mycanary.com.

Get a VMDK Image

First, you must have a Canary Tools account, which usually involves money.

Then log on to that account, and in the listing of your canaries, hit the + and select "Add Canary."

Select "Virtual VMware (ESXi)" and "Add VMware Canary." Copy and save the Password, and select "Download," and choose "VMX ..."

Wait 15 minutes for the download.

Convert to Raw Disk Images

Unzip the downloaded file, and you will find two .vmdk disk images,

  • VirtualCanary-d031f88e-disk1.vmdk - the main bootable
  • VirtualCanary-d031f88e-disk2.vmdk - a tiny secondary disk

Convert the vmdks to raw images

qemu-img convert -f vmdk -O raw VirtualCanary-d031f88e-disk1.vmdk virt-canary.img
qemu-img convert -f vmdk -O raw VirtualCanary-d031f88e-disk2.vmdk virt-canary2.img

Create Ganeti VM with two disks

To create the one-drive VM with 10G of virtual disk and 2G of RAM. I tend to steal from my standard debian ganeti install, mainly Create the VM to Find the Console Port. I do not start it.

Save the info from

gnt-instance list -o name,pnode,network_port mycanary.com

Then add the second disk to the VM

gnt-instance modify --disk add:size=1G mycanary.com

You really only need 2M but I tend to think in Gigs.

Copy the Images to the Virtual Disks

First, find the name of the virtual drives by

gnt-instance info mycanary.com | grep "on primary"
      on primary: /dev/ganeti/532a0299-3bc7-4a05-b2d3-6cfc833bd4fb.disk0 (253:4)
      on primary: /dev/ganeti/bdba59eb-6c84-4d4b-9b78-1b5fbd3b1ae0.disk1 (253:5)

then dd the .img files to the the lvm disks

sudo dd bs=10M status=progress if=virt-canary.img of=/dev/ganeti/532a0299-3bc7-4a05-b2d3-6cfc833bd4fb.disk0
sudo dd bs=10M status=progress if=virt-canary2.img of=/dev/ganeti/bdba59eb-6c84-4d4b-9b78-1b5fbd3b1ae0.disk1

Be patient.

Start the Bird

Now you can boot the Virtual Canary.

gnt-instance start mycanary.com

Run a VNC to the KVM console of the virtual image using the ganei node and port from the gnt-instance info ... when you created the VM.

Log in using the user name "canary" and the password from when you downloaded the vmdks from the Canary site.

Deal with set-up of IP addressing etc. using the lovely curses based UI.

Go back to the Canary web site and commission and configure the canary.

And Bob's your uncle.


2023.09.06