Page MenuHomeVyOS Platform

Alibaba Cloud image
Closed, ResolvedPublicFEATURE REQUEST

Description

I have been working on creating a VyOS 1.1.8 image on Alibaba Cloud.

I have been successful in getting it working, so I will go over my methods/tricks for you guys to reference for creating an official one there.

  1. Convert the vmdk virtualbox image to vhd. I found "StarWind V2V Image Converter" worked perfectly for this.
  1. Alibaba places os.conf in 'aliyun_custom_image' directory you need to add to the default root parition.

The root partition is mounted in /live/image, so mkdir /live/image/aliyum_custom_image
chmod the directory 777, so the setup script can delete the os.conf afterward

  1. Setup sshd to listen on port 22 (set service ssh port 22)
  1. Make sure there are no ethernet interfaces (delete interfaces ethernet eth0)

If you leave anything in eth0, then the network interface Alibaba adds will end up being called eth1, despite the os.conf saying eth0

  1. Place custom init scripts in /config/scripts (will attach)

alibaba-init.sh - parses the os.conf file, sets the settings, and then deletes the os.conf file
vyos-command.sh - The first script calls this script multiple times. I couldn't get the bash scripting to work right after sourcing in the script-template, so I have this simple wrapper to run vyos commands.

  1. Finally, have /etc/rc.local call the alibaba-init.sh script on boot

ALIBABACONFIG=/opt/vyatta/etc/config/scripts/alibaba-init.sh
[ -x $ALIBABACONFIG ] && $ALIBABACONFIG

  1. So again verify that there is nothing in config.boot for eth0, and power off the virtualbox/vmware image.
  1. Upload this vhd file to a OSS box on Alibaba
  1. Under "images", go to "import image". Select your OSS file, and set the type to "Customized Linux". I think it requires a 40G minimum size, but I didn't test it with others.
  1. Once the image is ready, you can create an instance with it. For the bit about setting up access, click on the "Password" tab, and put in what you would like your default password to be. Even though it says the user is 'root', it will actually be setting it into the 'vyos' user. The ssh key login bit can't be configured by the initial setup, but you can always add a key afterward, of course.

That should be all.

Unfortunately my Alibaba account isn't letting me create new instances anymore for some reason, so I haven't been able to test these final versions of my scripts. In a previous version, a final reboot was required for configurations to work afterward, but I think the attached one will fix that (Thanks @syncer for that help)

I may share out my image to the public once I get it finally tested and perfect, but I'm not sure.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close

Event Timeline

ethomas created this object in space S1 VyOS Public.
ethomas created this object with visibility "All Users".

I finally got to test my final script, and it worked perfectly.

I did this all with VyOS 1.1.8.
I'm about to redo it all with 1.1.7 (because I can't get my openvpn client to connect to 1.1.8, and I think it might be the OpenVPN version difference in versions).

Edit: Turns out if was the Great Firewall of China preventing the OpenVPN connection

If you want me to share my final image, let me know.

@ethomas

I am interesting to install and test image in Alibaba cloud.

syncer reassigned this task from ethomas to Unknown Object (User).Oct 13 2018, 6:53 PM
syncer changed the visibility from "All Users" to "Public (No Login Required)".
syncer reassigned this task from Unknown Object (User) to UnicronNL.Oct 13 2018, 7:07 PM
syncer added a subscriber: Unknown Object (User).
syncer renamed this task from Alibaba Cloud image to .Oct 18 2018, 6:05 AM
syncer changed the subtype of this task from "Task" to "Feature Request".Oct 19 2018, 9:27 AM
syncer moved this task from Needs Triage to Finished on the VyOS 1.2 Crux (VyOS 1.2.0-EPA3) board.

@UnicronNL also need document this one