Skip to content

IoT/ARM64 support: allow cloudstack-agent on Raspberry Pi 4 (armv8) to use kvm acceleration - #3644

Merged
yadvr merged 2 commits into
apache:masterfrom
shapeblue:4.13.0.0-arm64-rpi
Nov 11, 2019
Merged

IoT/ARM64 support: allow cloudstack-agent on Raspberry Pi 4 (armv8) to use kvm acceleration#3644
yadvr merged 2 commits into
apache:masterfrom
shapeblue:4.13.0.0-arm64-rpi

Conversation

@yadvr

Copy link
Copy Markdown
Member

KVM is supported on arm64 Linux (https://www.linux-kvm.org/page/Processor_support#ARM:). For a small (IoT) platform such as the new Raspberry Pi 4 that uses armv8 processor (cortex-a72) it's possible to run Linux host with /dev/kvm accleration.

This PR is from a fun weekend project where:

I could finally get a 4.13 CloudStack + Adv zone/networking to run on it and deployed a KVM based Ubuntu 19.10 environment and NFS storage. Deployed a test vm with isolated network, VR works as expected. Console proxy works as well, for this tested against arm64 openstack Debian 9/10 templates.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

Screenshot from 2019-10-18 16-55-23
Screenshot from 2019-10-18 17-20-49
Screenshot from 2019-10-20 01-43-43

KVM is supported on arm64 Linux (https://www.linux-kvm.org/page/Processor_support#ARM:).
For a small (IoT) platform such as the new Raspberry Pi 4 that uses armv8 processor
(cortex-a72) it's possible to run Linux host with `/dev/kvm`
accleration. This adds support for IoT IaaS in CloudStack.
This PR is from a fun weekend project where:
- I set up a Raspberry Pi 4 - 4GB RAM model with 4 CPU cores @ 1.5Ghz, 128GB SD samsung evo plus card
- Installed Ubuntu 19.10 raspi3 base image: http://cdimage.ubuntu.com/releases/19.10/release/ubuntu-19.10-preinstalled-server-arm64+raspi3.img.xz
- Build a custom Linux 5.3 kernel with KVM enabled, deb here: http://dl.rohityadav.cloud/cloudstack-rpi/kernel-19.10/ and install the linux-image and linux-module
- Then install/setup CloudStack on it (fix some issues around jna, by manually installing newer libjna-java to /usr/share/cloudstack-agent/lib)
- Since the host processor is not x86_64, I had to build a new arm64 (or aarch64) systemvmtemplate: http://dl.rohityadav.cloud/cloudstack-rpi/systemvmtemplate/
I could finally get a 4.13 CloudStack + Adv zone/networking to run on it
and deployed a KVM based Ubuntu 19.10 environment and NFS storage.
Deployed a test vm with isolated network, VR works as expected. Console
proxy works as well, for this tested against arm64 openstack Debian 9/10
templates.
Limitation: on my aarch64 env, it did not support IDE, therefore all
default bus type for volumes are SCSI by default. With VIRTIO it fails
sometimes.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr
yadvrforce-pushed the 4.13.0.0-arm64-rpi branch from 4ea5220 to 01b679eCompareOctober 20, 2019 10:00
@apacheapache deleted a comment from blueorangutanOct 20, 2019
@apacheapache deleted a comment from blueorangutanOct 20, 2019
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@apacheapache deleted a comment from blueorangutanOct 20, 2019
@apacheapache deleted a comment from blueorangutanOct 20, 2019
@yadvr

Copy link
Copy Markdown
MemberAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-320

@yadvr

Copy link
Copy Markdown
MemberAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@resmo
resmo removed their request for review October 20, 2019 13:46
@apacheapache deleted a comment from blueorangutanOct 20, 2019
@yadvr

Copy link
Copy Markdown
MemberAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-417)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37651 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3644-t417-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 77 look OK, 0 have error(s)
Only failed tests results shown below:

TestResultTime (s)Test File

@yadvryadvr changed the title [WIP] IoT support: allow cloudstack-agent on Raspberry Pi 3/4 (arm64) to use kvm accelerationIoT/ARM64 support: allow cloudstack-agent on Raspberry Pi 4 (armv8) to use kvm accelerationOct 22, 2019
@yadvryadvr added this to the 4.14.0.0 milestone Oct 22, 2019
@yadvr

Copy link
Copy Markdown
MemberAuthor

Tested with two RPi4, live VM migration works too.

@GabrielBrascherGabrielBrascher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

@DaanHoogland

Copy link
Copy Markdown
Contributor

looks good @rhtyd Jenkins failed so closing to rekick.

@DaanHoogland

DaanHoogland commented Nov 7, 2019

Copy link
Copy Markdown
Contributor

go jenkins go

@yadvr

Copy link
Copy Markdown
MemberAuthor

Thanks @DaanHoogland@GabrielBrascher Travis is green and trillian smoke tests is all pass, I'll merge this.

@yadvr
yadvr merged commit 524b995 into apache:masterNov 11, 2019
@yadvr

Copy link
Copy Markdown
MemberAuthor

Update note: Ubuntu kernel linux-raspi2 - 5.3.0-1012.14 will now ship with KVM enabled for arm64 by default: https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1783961

ustcweizhou pushed a commit to ustcweizhou/cloudstack that referenced this pull request Feb 28, 2020
…o use kvm acceleration (apache#3644)
KVM is supported on arm64 Linux (https://www.linux-kvm.org/page/Processor_support#ARM:).
For a small (IoT) platform such as the new Raspberry Pi 4 that uses armv8 processor
(cortex-a72) it's possible to run Linux host with `/dev/kvm`
accleration. This adds support for IoT IaaS in CloudStack.
This PR is from a fun weekend project where:
- I set up a Raspberry Pi 4 - 4GB RAM model with 4 CPU cores @ 1.5Ghz, 128GB SD samsung evo plus card
- Installed Ubuntu 19.10 raspi3 base image: http://cdimage.ubuntu.com/releases/19.10/release/ubuntu-19.10-preinstalled-server-arm64+raspi3.img.xz
- Build a custom Linux 5.3 kernel with KVM enabled, deb here: http://dl.rohityadav.cloud/cloudstack-rpi/kernel-19.10/ and install the linux-image and linux-module
- Then install/setup CloudStack on it (fix some issues around jna, by manually installing newer libjna-java to /usr/share/cloudstack-agent/lib)
- Since the host processor is not x86_64, I had to build a new arm64 (or aarch64) systemvmtemplate: http://dl.rohityadav.cloud/cloudstack-rpi/systemvmtemplate/
I could finally get a 4.13 CloudStack + Adv zone/networking to run on it
and deployed a KVM based Ubuntu 19.10 environment and NFS storage.
Deployed a test vm with isolated network, VR works as expected. Console
proxy works as well, for this tested against arm64 openstack Debian 9/10
templates.
I raised the issue of enabling KVM in upstream Ubuntu arm64 build: https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1783961
Ubuntu kernel team has come back and future arm64 releases may have KVM enabled by default.
Limitation: on my aarch64 env, it did not support IDE, therefore all
default bus type for volumes are SCSI by default. With VIRTIO it fails
sometimes.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@yadvr@blueorangutan@DaanHoogland@GabrielBrascher