SlideShare a Scribd company logo
Copyright © 2015 Mirantis, Inc. All rights reserved
www.mirantis.com
Moving AWS
Workloads to OpenStack
You're not trapped, honest.
Copyright © 2015 Mirantis, Inc. All rights reserved
Who am I?
● Nicholas Chase
● Long-time programmer
● Author of a bunch of books
● Head of technical content at
Mirantis
● Editor-in-Chief, OpenStack:Now
Copyright © 2015 Mirantis, Inc. All rights reserved
Special thanks to...
Darin Sorrentino
Cloud Solutions Architect
Darin@Vion.com
Copyright © 2015 Mirantis, Inc. All rights reserved
What we're going to talk about
● OpenStack for AWS users -- an overview
● The easiest way to move a workload
● Using orchestration tools
● Giving your pet a new home (or, Doing it the hard way)
Copyright © 2015 Mirantis, Inc. All rights reserved
OpenStack for AWS users
A quick introduction
Copyright © 2015 Mirantis, Inc. All rights reserved
OpenStack for AWS users
● An open source cloud platform
● An open source version of AWS -- sort of
● No one-to-one correspondence for everything
● Different API
Copyright © 2015 Mirantis, Inc. All rights reserved
OpenStack for AWS users
Components
● EC2 = Nova
● EC2 container service = Magnum, Kubernetes (via
Murano)
● S3 = Swift
● RDS = Trove
● Identity and Access Management = Keystone
● CloudWatch = Ceilometer
● CloudFormation = Heat
Copyright © 2015 Mirantis, Inc. All rights reserved
OpenStack for AWS users
Components (con't)
● SQS = Zaqar
● SWF = Mistral
● DyamoDB = MagnetoDB
● VPC = VPN as a Service (in Neutron)
● AWS management console = Horizon
Copyright © 2015 Mirantis, Inc. All rights reserved
OpenStack for AWS users
Copyright © 2015 Mirantis, Inc. All rights reserved
The easiest way to move a
workload
Copyright © 2015 Mirantis, Inc. All rights reserved
The easiest way to move a workload
Don't move it at all.
Copyright © 2015 Mirantis, Inc. All rights reserved
The easiest way to move a workload
Aspects of a cloud application architecture
● Horizontally scalable
● Inherently stateless
● Microservices-based
● Fault-tolerant
Copyright © 2015 Mirantis, Inc. All rights reserved
The easiest way to move a workload
● [[DIAGRAM SHOWING MOVING FROM ONE CLOUD
TO ANOTHER.]]
Copyright © 2015 Mirantis, Inc. All rights reserved
Using orchestration tools
Copyright © 2015 Mirantis, Inc. All rights reserved
Using orchestration tools
Orchestration is...
● The layer of your application that deals with the cloud
itself, as opposed to the actual workload
● Sharable/versionable as code
● Often targeted at hybrid cloud environments
You've got multiple options here.
Copyright © 2015 Mirantis, Inc. All rights reserved
Using orchestration tools
Cloud-specific orchestration tools:
● AWS -> CloudFormation
● OpenStack -> Heat (originally based on CloudFormation
& retains some backwards compatibility with
CloudFormation templates)
Copyright © 2015 Mirantis, Inc. All rights reserved
Using orchestration tools
Hybrid cloud orchestration tools:
● StackStorm
● Cloudify
● Ericsson
● Apcera
● More every day, it seems...
Copyright © 2015 Mirantis, Inc. All rights reserved
Using orchestration tools
StackStorm
● Workflow engine in OpenStack (Mistral)
● Open source (https://github.com/StackStorm)
Copyright © 2015 Mirantis, Inc. All rights reserved
Using orchestration tools
StackStorm
Copyright © 2015 Mirantis, Inc. All rights reserved
Using orchestration tools
Cloudify (by Gigaspaces)
● Workflow engine in OpenStack (Mistral)
● Open source (https://github.com/StackStorm)
Copyright © 2015 Mirantis, Inc. All rights reserved
Using orchestration tools
Cloudify
Copyright © 2015 Mirantis, Inc. All rights reserved
Using orchestration tools
Apcera
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home
Doing it the hard way
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
The general procedure
● Install VirtIO drivers in the AWS VM
● Prepare the registry on the VM
● Create a VMDK image
● Convert the VMDK to qcow2
● Upload it to OpenStack
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
● Open the firewall for ICMP
netsh advfirewall firewall add rule name="All ICMP V4"
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
● Enable Remote Desktop access (on by default)
● Allow Remote Desktop access through the firewall
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
Install VirtIO drivers
● You have Administrator Privileges
● In this case, you can install the VirtIO drivers and make the
registry changes in the Windows VM while it is running on AWS
● You don’t have Administrator Privileges
● If you don’t have administrator rights, you will need to leverage
something like guestfish to inject the drivers and registry
settings into the image after converting it to QCOW2
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
Obtain the latest VirtIO drivers:
● Download the ISO from
http://alt.fedoraproject.org/pub/alt/virtio-
win/latest/images/bin/
If you have Administrator privileges:
● Install Daemon Tools (or some other emulator) to mount
the ISO
● Make sure to install SPTD
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
Installation with Administrative Privileges
● Install the drivers according to directions at
https://access.redhat.com/documentation/en-
US/Red_Hat_Enterprise_Linux/7/html/Virtualization_De
ployment_and_Administration_Guide/sect-
KVM_Para_virtualized_virtio_Drivers-
Installing_the_drivers_on_an_installed_Windows_guest
_virtual_machine.html
● Driver type is viostor
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
Administrative Privileges cont’d
● Import the registry configuration
● Full instructions at
https://docs.mirantis.com/openstack/express/latest/pdf/Applicati
onOnBoardingGuideMirantisOpenStackExpress.pdf
● Add a second Administrators account
● Add user
● Add to Administrator's group
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
● Attach a new volume to the VM
● Use the AWS console
● Download the VMware vCenter Converter from
https://my.vmware.com/group/vmware/evalcenter?p=co
nverter
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
Using the converter
● Download the VMware vCenter Converter from
https://my.vmware.com/group/vmware/evalcenter?p=co
nverter
● Create a new image using the "Powered On Machine"
as the source
● Choose VMware Workstation as the product
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
● SAVE THE IMAGE TO THE NEWLY ATTACHED
VOLUME.
DO NOT USE THE SYSTEM DISK.
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
Convert the resulting VMDK
● Copy the file to a Linux box
● Install qemu-img
● Convert the VMDK to a qcow2 image:
qemu-img convert -f vmdk -O qcow2 VM.vmdk VM.qcow2
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
If you did NOT have Administrator privileges to install
VirtIO, you will need to do so now utilizing guestfish:
● Tell guestfish where to find the qemu-kvm library:
export LIBGUESTFS_QEMU=$(rpm -ql qemu-kvm | grep qemu-kvm$)
● Copy the VirtIO files to the linux machine (see the guide
for full details)
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
VirtIO installation (without Administrator Privileges)
● Create a script to inject the files into the image:
#!/bin/bash guestfish --rw -a $1 -i <<_EOF_ upload
Drivers/Inf/BALLOON.CAT 'win:windowsinfBALLOON.CAT'
...
_EOF_
● Run the script:
./inject.sh ./vm.qcow2
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
VirtIO installation (without Administrator Privileges)
● Create a file for registry injection:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESYSTEMControlSet001ControlCriticalDevi
ceDataba sepci#ven_1af4&dev_1001&subsys_00000000]
...
● Inject the file:
virt-win-reg --merge {Disk name}.qcow2 {file name} Example:
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Windows
● Upload the image to OpenStack
● Use Horizon or the CLI
● For large images, utilize the CLI to avoid browser timeout
frustrations
● Launch a VM based on that image
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Linux
The general procedure
● Note the existing packages and startup services/scripts
● Create a new VM
● Install what's missing
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Linux
● Get the installed package list
rpm -qa --queryformat "%{NAME}n" > /tmp/packages.txt
● Copy /tmp/packages.txt off of the AWS instance to a
local machine
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Linux
● Get a list of filesystems and their utilization:
df -h >/tmp/filesystems.txt
● Copy /tmp/filesystems.txt off of the AWS instance to a
local machine
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Linux
● Get a list of services started at boot time:
chkconfig --list | grep :on | awk '{print $1}'
>/tmp/chkconfig.txt
● Copy /tmp/chkconfig.txt off of the AWS instance to a
local machine
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Linux
● Backup the startup scripts in case you have any auto-
start services that are not installed via packages, such
as Weblogic
tar -zcvf /tmp/init.tgz /etc/init.d/*
● Copy /tmp/init.tgz off of the AWS instance to a local
machine
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Linux
● Create a new linux image (we’ll use CentOS as our
example distro to migrate)
● Create new ssh key and change permission:
nova keypair-add centos > centos.pem
chmod 600 centos.pem
● Boot centos instance via command:
nova boot --name centos-6.5 --image centos-6.5_64 --flavor
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Linux
● Get the IP address:
nova list
● Login to instance via command:
Copyright © 2015 Mirantis, Inc. All rights reserved
Giving your pet a new home -- Linux
● Copy files package.txt and chkconfig.txt from your PC to
the /tmp directory on the new instance in OpenStack.
● Install missing packages and autorun services
sudo -s
yum update -y
while read line; do yum -y install "$line"; done <
/tmp/package.txt
while read line; do chkconfig "$line" on; done <
/tmp/chkconfig.txt
Copyright © 2015 Mirantis, Inc. All rights reserved
Q&A
Download the slides from http://openstacknow.com/aws-to-openstack/
Copyright © 2015 Mirantis, Inc. All rights reserved
Thank you
for your time

More Related Content

Moving AWS workloads to OpenStack

  • 1. Copyright © 2015 Mirantis, Inc. All rights reserved www.mirantis.com Moving AWS Workloads to OpenStack You're not trapped, honest.
  • 2. Copyright © 2015 Mirantis, Inc. All rights reserved Who am I? ● Nicholas Chase ● Long-time programmer ● Author of a bunch of books ● Head of technical content at Mirantis ● Editor-in-Chief, OpenStack:Now
  • 3. Copyright © 2015 Mirantis, Inc. All rights reserved Special thanks to... Darin Sorrentino Cloud Solutions Architect Darin@Vion.com
  • 4. Copyright © 2015 Mirantis, Inc. All rights reserved What we're going to talk about ● OpenStack for AWS users -- an overview ● The easiest way to move a workload ● Using orchestration tools ● Giving your pet a new home (or, Doing it the hard way)
  • 5. Copyright © 2015 Mirantis, Inc. All rights reserved OpenStack for AWS users A quick introduction
  • 6. Copyright © 2015 Mirantis, Inc. All rights reserved OpenStack for AWS users ● An open source cloud platform ● An open source version of AWS -- sort of ● No one-to-one correspondence for everything ● Different API
  • 7. Copyright © 2015 Mirantis, Inc. All rights reserved OpenStack for AWS users Components ● EC2 = Nova ● EC2 container service = Magnum, Kubernetes (via Murano) ● S3 = Swift ● RDS = Trove ● Identity and Access Management = Keystone ● CloudWatch = Ceilometer ● CloudFormation = Heat
  • 8. Copyright © 2015 Mirantis, Inc. All rights reserved OpenStack for AWS users Components (con't) ● SQS = Zaqar ● SWF = Mistral ● DyamoDB = MagnetoDB ● VPC = VPN as a Service (in Neutron) ● AWS management console = Horizon
  • 9. Copyright © 2015 Mirantis, Inc. All rights reserved OpenStack for AWS users
  • 10. Copyright © 2015 Mirantis, Inc. All rights reserved The easiest way to move a workload
  • 11. Copyright © 2015 Mirantis, Inc. All rights reserved The easiest way to move a workload Don't move it at all.
  • 12. Copyright © 2015 Mirantis, Inc. All rights reserved The easiest way to move a workload Aspects of a cloud application architecture ● Horizontally scalable ● Inherently stateless ● Microservices-based ● Fault-tolerant
  • 13. Copyright © 2015 Mirantis, Inc. All rights reserved The easiest way to move a workload ● [[DIAGRAM SHOWING MOVING FROM ONE CLOUD TO ANOTHER.]]
  • 14. Copyright © 2015 Mirantis, Inc. All rights reserved Using orchestration tools
  • 15. Copyright © 2015 Mirantis, Inc. All rights reserved Using orchestration tools Orchestration is... ● The layer of your application that deals with the cloud itself, as opposed to the actual workload ● Sharable/versionable as code ● Often targeted at hybrid cloud environments You've got multiple options here.
  • 16. Copyright © 2015 Mirantis, Inc. All rights reserved Using orchestration tools Cloud-specific orchestration tools: ● AWS -> CloudFormation ● OpenStack -> Heat (originally based on CloudFormation & retains some backwards compatibility with CloudFormation templates)
  • 17. Copyright © 2015 Mirantis, Inc. All rights reserved Using orchestration tools Hybrid cloud orchestration tools: ● StackStorm ● Cloudify ● Ericsson ● Apcera ● More every day, it seems...
  • 18. Copyright © 2015 Mirantis, Inc. All rights reserved Using orchestration tools StackStorm ● Workflow engine in OpenStack (Mistral) ● Open source (https://github.com/StackStorm)
  • 19. Copyright © 2015 Mirantis, Inc. All rights reserved Using orchestration tools StackStorm
  • 20. Copyright © 2015 Mirantis, Inc. All rights reserved Using orchestration tools Cloudify (by Gigaspaces) ● Workflow engine in OpenStack (Mistral) ● Open source (https://github.com/StackStorm)
  • 21. Copyright © 2015 Mirantis, Inc. All rights reserved Using orchestration tools Cloudify
  • 22. Copyright © 2015 Mirantis, Inc. All rights reserved Using orchestration tools Apcera
  • 23. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home Doing it the hard way
  • 24. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows The general procedure ● Install VirtIO drivers in the AWS VM ● Prepare the registry on the VM ● Create a VMDK image ● Convert the VMDK to qcow2 ● Upload it to OpenStack
  • 25. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows ● Open the firewall for ICMP netsh advfirewall firewall add rule name="All ICMP V4"
  • 26. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows ● Enable Remote Desktop access (on by default) ● Allow Remote Desktop access through the firewall
  • 27. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows Install VirtIO drivers ● You have Administrator Privileges ● In this case, you can install the VirtIO drivers and make the registry changes in the Windows VM while it is running on AWS ● You don���t have Administrator Privileges ● If you don’t have administrator rights, you will need to leverage something like guestfish to inject the drivers and registry settings into the image after converting it to QCOW2
  • 28. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows Obtain the latest VirtIO drivers: ● Download the ISO from http://alt.fedoraproject.org/pub/alt/virtio- win/latest/images/bin/ If you have Administrator privileges: ● Install Daemon Tools (or some other emulator) to mount the ISO ● Make sure to install SPTD
  • 29. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows Installation with Administrative Privileges ● Install the drivers according to directions at https://access.redhat.com/documentation/en- US/Red_Hat_Enterprise_Linux/7/html/Virtualization_De ployment_and_Administration_Guide/sect- KVM_Para_virtualized_virtio_Drivers- Installing_the_drivers_on_an_installed_Windows_guest _virtual_machine.html ● Driver type is viostor
  • 30. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows Administrative Privileges cont’d ● Import the registry configuration ● Full instructions at https://docs.mirantis.com/openstack/express/latest/pdf/Applicati onOnBoardingGuideMirantisOpenStackExpress.pdf ● Add a second Administrators account ● Add user ● Add to Administrator's group
  • 31. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows ● Attach a new volume to the VM ● Use the AWS console ● Download the VMware vCenter Converter from https://my.vmware.com/group/vmware/evalcenter?p=co nverter
  • 32. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows Using the converter ● Download the VMware vCenter Converter from https://my.vmware.com/group/vmware/evalcenter?p=co nverter ● Create a new image using the "Powered On Machine" as the source ● Choose VMware Workstation as the product
  • 33. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows ● SAVE THE IMAGE TO THE NEWLY ATTACHED VOLUME. DO NOT USE THE SYSTEM DISK.
  • 34. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows Convert the resulting VMDK ● Copy the file to a Linux box ● Install qemu-img ● Convert the VMDK to a qcow2 image: qemu-img convert -f vmdk -O qcow2 VM.vmdk VM.qcow2
  • 35. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows If you did NOT have Administrator privileges to install VirtIO, you will need to do so now utilizing guestfish: ● Tell guestfish where to find the qemu-kvm library: export LIBGUESTFS_QEMU=$(rpm -ql qemu-kvm | grep qemu-kvm$) ● Copy the VirtIO files to the linux machine (see the guide for full details)
  • 36. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows VirtIO installation (without Administrator Privileges) ● Create a script to inject the files into the image: #!/bin/bash guestfish --rw -a $1 -i <<_EOF_ upload Drivers/Inf/BALLOON.CAT 'win:windowsinfBALLOON.CAT' ... _EOF_ ● Run the script: ./inject.sh ./vm.qcow2
  • 37. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows VirtIO installation (without Administrator Privileges) ● Create a file for registry injection: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINESYSTEMControlSet001ControlCriticalDevi ceDataba sepci#ven_1af4&dev_1001&subsys_00000000] ... ● Inject the file: virt-win-reg --merge {Disk name}.qcow2 {file name} Example:
  • 38. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Windows ● Upload the image to OpenStack ● Use Horizon or the CLI ● For large images, utilize the CLI to avoid browser timeout frustrations ● Launch a VM based on that image
  • 39. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Linux The general procedure ● Note the existing packages and startup services/scripts ● Create a new VM ● Install what's missing
  • 40. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Linux ● Get the installed package list rpm -qa --queryformat "%{NAME}n" > /tmp/packages.txt ● Copy /tmp/packages.txt off of the AWS instance to a local machine
  • 41. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Linux ● Get a list of filesystems and their utilization: df -h >/tmp/filesystems.txt ● Copy /tmp/filesystems.txt off of the AWS instance to a local machine
  • 42. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Linux ● Get a list of services started at boot time: chkconfig --list | grep :on | awk '{print $1}' >/tmp/chkconfig.txt ● Copy /tmp/chkconfig.txt off of the AWS instance to a local machine
  • 43. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Linux ● Backup the startup scripts in case you have any auto- start services that are not installed via packages, such as Weblogic tar -zcvf /tmp/init.tgz /etc/init.d/* ● Copy /tmp/init.tgz off of the AWS instance to a local machine
  • 44. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Linux ● Create a new linux image (we’ll use CentOS as our example distro to migrate) ● Create new ssh key and change permission: nova keypair-add centos > centos.pem chmod 600 centos.pem ● Boot centos instance via command: nova boot --name centos-6.5 --image centos-6.5_64 --flavor
  • 45. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Linux ● Get the IP address: nova list ● Login to instance via command:
  • 46. Copyright © 2015 Mirantis, Inc. All rights reserved Giving your pet a new home -- Linux ● Copy files package.txt and chkconfig.txt from your PC to the /tmp directory on the new instance in OpenStack. ● Install missing packages and autorun services sudo -s yum update -y while read line; do yum -y install "$line"; done < /tmp/package.txt while read line; do chkconfig "$line" on; done < /tmp/chkconfig.txt
  • 47. Copyright © 2015 Mirantis, Inc. All rights reserved Q&A Download the slides from http://openstacknow.com/aws-to-openstack/
  • 48. Copyright © 2015 Mirantis, Inc. All rights reserved Thank you for your time