Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
howtos:cloud:aws_ec2 [2015/01/18 10:55 (UTC)]
denydias Properly finish a phrase.
howtos:cloud:aws_ec2 [2015/02/22 10:30 (UTC)]
turtleli Typos, grug->grub
Line 1: Line 1:
 ====== Slackware on AWS EC2 ====== ====== Slackware on AWS EC2 ======
-Slackware ​is around since the first half of the last decade of XX century. It's the elder son still alive of the Linux distributions heritage. It's here years before personal computers get enough horse power so they become subject to fraction its resources into something called virtualization. FurthermoreSlackware ​is here for almost 13 years before the first widely accessible cloud computing infrastructure service becomes operational: ​Amazon Web Services Elastic Compute Cloud, or just AWS EC2.+Despite the fact that Slackware Linux predates virtualization and 'Cloud Computing'​ by many years, ​it is not normally considered ​for Amazon Web Services Elastic Compute Cloud (AWS EC2). A possible reason could be the lack of updated and comprehensive documentation on how this can be implemented.
  
-Even so Slackware is nowadays - with some rare exceptions - not a subject when people talk about cloud computing. In this departmentUbuntu (ouch!), Red Hat (yugh!), SuSE (blargh!), even Amazon Linux - the official Linux distribution from AWS - rules the block. Why is that?, one can ask. +After some research, the author managed ​to identify ​the following sources:
- +
-Lack of documentation,​ imho. Slackware is pretty capable of cloud computing too. What is very difficult ​to find is a set of well documented, comprehensive procedures on how to deploy Slackware images in that sky of clouds out there. +
- +
-But let's be fair here. There are some documentation and those were highly valuable resources for this how to author. The main articles in the matter out there are:+
  
   * [[http://​kahverengi.com/​EN/​article/​amazon-ec22/​slackware-custom-amazon-ami-from-scratch.html|Slackware custom amazon AMI from scratch 16-06-2014]],​ by Soydaner Ulker.   * [[http://​kahverengi.com/​EN/​article/​amazon-ec22/​slackware-custom-amazon-ami-from-scratch.html|Slackware custom amazon AMI from scratch 16-06-2014]],​ by Soydaner Ulker.
Line 12: Line 8:
   * [[http://​www.linuxquestions.org/​questions/​slackware-14/​running-slackware64-current-on-aws-cloud-4175423435/​|Running Slackware64-current on AWS cloud]], a post in LinuxQuestions.org by Skaperen.   * [[http://​www.linuxquestions.org/​questions/​slackware-14/​running-slackware64-current-on-aws-cloud-4175423435/​|Running Slackware64-current on AWS cloud]], a post in LinuxQuestions.org by Skaperen.
  
-There are two problems with those sources: some are old, some are incomplete. Both problems leaves to many tinkering for the user figure out by her or himself. +This wiki is an attempt to provide a comprehensive tutorial on how Slackware may be built and deployed on AWS EC2.
- +
-So, this is an attempt to fill in this blank.+
  
 ====== Overview ====== ====== Overview ======
-What are gonna do now? The steps bellow ​gives us a good overview of the whole process:+The steps bellow ​give you a good overview of the whole process:
  
-  - To get knowledge about some core concepts that apply to OS deployment in a particular Infrastructure as a Service (IaaS), namely, AWS EC2;+  - To get knowledge about some core concepts that apply to an OS deployment in a particular Infrastructure as a Service (IaaS), namely, AWS EC2;
   - To check the requirements for the whole thing;   - To check the requirements for the whole thing;
   - To create a virtualized machine so we can rely to build our kernels;   - To create a virtualized machine so we can rely to build our kernels;
Line 26: Line 20:
   - To launch our first Slackware in the cloud, made out of the blue!   - To launch our first Slackware in the cloud, made out of the blue!
  
-The 4th and 5th nodes requires ​some expansion. We're living in times where human rights and individual freedoms are faced like threats to the State and governments around the world. As our Slackware is going to live in the cloud, which are all private business, we'll never know what practices those businesses ​sticks ​with. As such, our premise is: **do not trust anyone**.+The 4th and 5th nodes require ​some expansion. We're living in times where human rights and individual freedoms are considered ​threats to the State and governments around the world. As our Slackware is going to live in the cloud, which are all private business, we'll never know what practices those businesses ​stick with. As such, our premise is: **do not trust anyone**.
  
-This fact of life will lead to a set of configuration files and a ready to deploy Slackware image that's not a standard Slackware setup as you might have in your notebook/​desktop. All those steps are optional and are going to be properly ​indicated with the **[OPTIONAL]** prefix. They are documented here so you can at least know how to stay in the brightest side of the cloud.+This fact of life will lead to a set of configuration files and a ready to deploy Slackware image that's not a standard Slackware setup as you might have in your notebook/​desktop. All those steps are optional and are going to be appropriately ​indicated with the **[OPTIONAL]** prefix. They are documented here so you can at least know how to stay in the brightest side of the cloud.
  
-Before we get into the real thing, ​it'​s ​mandatory a word of advice: **this is going to take a looong time.**+Before we get into the real thing, ​mandatory a word of advice ​is as follows: **this is going to take a looong time.**
  
-No kidding! It's boring and it's going to be an endurance to your patience. There are many multiple hours steps and a mistake in the wrong place could cost you many hours and lots of frustration. Don't be worried if it takes a couple of days so you can SSH into your first Slackware instance that have booted just fine. Things can go a little bit faster with enough computing power and bandwidth, but do not expect that much. Grab yourself a bottle ​of hot coffee, sit yourself comfortably and let it go.+No kidding! It's boring and your patience ​will be tested. There are many multiple hours steps and a mistake in the wrong place could cost you many hours and lots of frustration. Don't be worried if it takes a couple of days so you can SSH into your first Slackware instance that have booted just fine. Things can go a little bit faster with enough computing power and bandwidth, but do not expect that much. Grab yourself a mug of hot coffee, sit yourself comfortably and let it go.
  
 The good news is: once you have mastered the process, you are going to deploy as many Slackware instances as you wish in a snap. The good news is: once you have mastered the process, you are going to deploy as many Slackware instances as you wish in a snap.
Line 42: Line 36:
  
   * **Hypervisor:​** as stated in [[https://​en.wikipedia.org/​wiki/​Hypervisor|Wikipedia]],​ 'a hypervisor or virtual machine monitor (VMM) is a piece of computer software, firmware or hardware that creates and runs virtual machines.'​ AWS EC2 uses [[http://​www.xenproject.org/​|Xen]] to implement its hypervisor and is on top of it that your Slackware instances is going to live.   * **Hypervisor:​** as stated in [[https://​en.wikipedia.org/​wiki/​Hypervisor|Wikipedia]],​ 'a hypervisor or virtual machine monitor (VMM) is a piece of computer software, firmware or hardware that creates and runs virtual machines.'​ AWS EC2 uses [[http://​www.xenproject.org/​|Xen]] to implement its hypervisor and is on top of it that your Slackware instances is going to live.
-  * **Virtualization Spectrum:** there'​s no easy explanation to this one, but in simple terms it refers to the way that hypervisors ​exposes machine features to the virtual machine. For an in-depth explanation of this concept, please read this [[http://​www.brendangregg.com/​blog/​2014-05-07/​what-color-is-your-xen.html|article]] by Brendan Gregg. At the time of this writing, the only know way to make Slackware work in AWS EC2 is by using PV kernels.+  * **Virtualization Spectrum:** there'​s no easy explanation to this one, but in simple terms it refers to the way that a hypervisor ​exposes machine features to the virtual machine. For an in-depth explanation of this concept, please read this [[http://​www.brendangregg.com/​blog/​2014-05-07/​what-color-is-your-xen.html|article]] by Brendan Gregg. At the time of this writing, the only know way to make Slackware work in AWS EC2 is by using PV kernels.
   * **PV-GRUB:​** packaged as AKI (Amazon Kernel Images), these little piece of software acts as a grub bootloader. This allows you to boot your own kernel inside your Slackware image. For more information about PV-GRUB AKIs, please read this [[http://​docs.aws.amazon.com/​AWSEC2/​latest/​UserGuide/​UserProvidedKernels.html|article]].   * **PV-GRUB:​** packaged as AKI (Amazon Kernel Images), these little piece of software acts as a grub bootloader. This allows you to boot your own kernel inside your Slackware image. For more information about PV-GRUB AKIs, please read this [[http://​docs.aws.amazon.com/​AWSEC2/​latest/​UserGuide/​UserProvidedKernels.html|article]].
   * **dom0 Kernel:** Xen Wiki's [[http://​wiki.xenproject.org/​wiki/​Dom0|states]] that a 'Dom0, or domain zero to expand the abbreviation,​ is the initial domain started by the Xen hypervisor on boot. The Xen hypervisor is not usable without Domain-0 ("​dom0"​).'​ This is true, but specifically at AWS EC2 our Slackware image is also going to have a dom0 kernel to boot (called by PV-GRUB), in oppose to [[http://​wiki.xenproject.org/​wiki/​DomU|domU]] kernels. Even so, you can't use your instance to virtualize something on top of it.   * **dom0 Kernel:** Xen Wiki's [[http://​wiki.xenproject.org/​wiki/​Dom0|states]] that a 'Dom0, or domain zero to expand the abbreviation,​ is the initial domain started by the Xen hypervisor on boot. The Xen hypervisor is not usable without Domain-0 ("​dom0"​).'​ This is true, but specifically at AWS EC2 our Slackware image is also going to have a dom0 kernel to boot (called by PV-GRUB), in oppose to [[http://​wiki.xenproject.org/​wiki/​DomU|domU]] kernels. Even so, you can't use your instance to virtualize something on top of it.
   * **Image:** as per [[http://​rackspace-core-infra-user-guide.readthedocs.org/​en/​latest/​cloud_images/​important_concepts.html|Rackspace]] definition, 'is a single file that contains a virtual disk that has a bootable operating system on it.' This is the file that is going to hold your ready for deploy Slackware. In the AWS EC2 domain, this is called AMI.   * **Image:** as per [[http://​rackspace-core-infra-user-guide.readthedocs.org/​en/​latest/​cloud_images/​important_concepts.html|Rackspace]] definition, 'is a single file that contains a virtual disk that has a bootable operating system on it.' This is the file that is going to hold your ready for deploy Slackware. In the AWS EC2 domain, this is called AMI.
   * **Volume:** it's a block level storage volume, just like your HDD or SSD. You count on volumes to hold your data, OS included. AWS service for volumes is [[https://​aws.amazon.com/​ebs/?​nc2=h_ls|EBS]] (Elastic Block Store).   * **Volume:** it's a block level storage volume, just like your HDD or SSD. You count on volumes to hold your data, OS included. AWS service for volumes is [[https://​aws.amazon.com/​ebs/?​nc2=h_ls|EBS]] (Elastic Block Store).
-  * **Snapshot:​** as most of you must already know, a snapshot is kinda of an '​immutable picture'​ of a storage volume in a certain point in time. This is not different here, but it's worth to mention as this is a core concept in the process. The final, ready to deploy Slackware image is going to born from a snapshot and will only exists ​while this snapshot also exists, even that the volume that originated this snapshot ​has been vanished already.+  * **Snapshot:​** as most of you must already know, a snapshot is a kind of an '​immutable picture'​ of a storage volume in a certain point in time. This is not different here, but it's worth to mention as this is a core concept in the process. The final, ready to deploy Slackware imageis going to be created ​from a snapshot and will only exist while this snapshot also exists, even if the volume that had originated this snapshot ​had been removed.
  
-We're going to get pretty used to those terms in the course of our learning here, so don worry if you don't got the big picture by now.+We're going to get pretty used to those terms in the course of our learning here, so don'​t ​worry if you haven't got the big picture by now.
  
 ====== Requirements ====== ====== Requirements ======
Line 83: Line 77:
 </​code>​ </​code>​
  
-Now let's configure it before the first boot. Select your ''​%%slackfactory%%''​ VM and hit Settings. Only things that needs changes are described.+Now let's configure it before the first boot. Select your ''​%%slackfactory%%''​ VM and hit Settings. Only things that need changes are described.
  
 <​code>​ <​code>​
Line 104: Line 98:
 Hit enter to the boot prompt, wait for the kernel loads, enter again to select a keyboard map message and type ''​%%root%%''​ to login. Hit enter to the boot prompt, wait for the kernel loads, enter again to select a keyboard map message and type ''​%%root%%''​ to login.
  
-Lets create one partition with the entire virtual disk volume. **Do not create a swap partition.** This is a different step of a standard Slackware install, where swap partition is recommended.+Let us create one partition with the entire virtual disk volume. **Do not create a swap partition.** This is a different step of a standard Slackware install, where swap partition is recommended.
  
 <​code>​ <​code>​
Line 121: Line 115:
 </​code>​ </​code>​
  
-Then type ''​%%setup%%''​ and hit enter. As we do not have a swap partition, we can start at ''​%%TARGET%%''​ option. Highlight it and press enter to begin installation.+Then type ''​%%setup%%''​ and hit enter. As we do not have a swap partition, we can start at ''​%%TARGET%%''​ option. Highlight it and press ''​Enter'' ​to begin installation.
  
 Select ''​%%/​dev/​sda1%%''​ as the installation partition, ''​%%Format%%''​ to quick format the partition, ''​%%ext4%%''​ as the filesystem type, ''​%%OK%%''​. Select ''​%%/​dev/​sda1%%''​ as the installation partition, ''​%%Format%%''​ to quick format the partition, ''​%%ext4%%''​ as the filesystem type, ''​%%OK%%''​.
  
-As the source media, we'​ll ​chose our NFS server, option 4 and hit ''​%%OK%%''​. You may change this if you are using another kind of installation media.+As the source media, we'​ll ​choose ​our NFS server, option 4 and hit ''​%%OK%%''​. You may change this if you are using another kind of installation media.
  
 Setup will ask you to enable DHCP, so say ''​%%Yes%%''​. Next it'll ask you for the NFS server IP. Let's assume ours is ''​%%192.168.0.1%%'',​ so type this and continue. Setup will ask you to enable DHCP, so say ''​%%Yes%%''​. Next it'll ask you for the NFS server IP. Let's assume ours is ''​%%192.168.0.1%%'',​ so type this and continue.
Line 135: Line 129:
 Now it's time to select the packages we need. Remember we are going to need Xen, compile the kernel and other stuff in this virtual machine. This impose some package series requirements. You must install series A, AP, D, F, K, L, N, T, TCL and X. Select those series and **deselect** all others, namely E, KDE, KDEI, XAP and Y. Hit ''​%%OK%%''​ when done. Now it's time to select the packages we need. Remember we are going to need Xen, compile the kernel and other stuff in this virtual machine. This impose some package series requirements. You must install series A, AP, D, F, K, L, N, T, TCL and X. Select those series and **deselect** all others, namely E, KDE, KDEI, XAP and Y. Hit ''​%%OK%%''​ when done.
  
-Then select ''​%%full%%'',​ go grab a mug of coffee, sit back and relax til while the packages are installed. This is going to take take about 17 minutes.+Then select ''​%%full%%'',​ go grab a mug of coffee, sit back and relax while the packages are being installed. This is going to take about 17 minutes.
  
-While you wait, it's worth to mention that all the waiting ​forecast ​are approximate measures taken from the reference bare metal system where this how to was written: Intel Core i3 2365M 1,4GHz, 10GB RAM 1333MHz, SSD SATA III, Gigabit Ethernet and a NFS server capable to deliver about 90MB/sec of reading throughput. This how to will provide some time expectation for the long run tasks based on that system.+While you wait, it's worth to mention that all the time waiting ​forecasts ​are approximate measures taken from the reference bare metal system where this how to was written: Intel Core i3 2365M 1,4GHz, 10GB RAM 1333MHz, SSD SATA III, Gigabit Ethernet and a NFS server capable to deliver about 90MB/sec of reading throughput. This ''​how to'' ​will provide some time expectation for the long run tasks based on that system.
  
-Not that packages series are installed, choose ''​%%Skip%%''​ at both USB flash boot install LILO dialogs. Select ''​%%ps2%%''​ mouse, say ''​%%No%%''​ to GPM configuration and ''​%%Yes%%''​ to configure network.+Now that packages series are installed, choose ''​%%Skip%%''​ at both USB flash boot install LILO dialogs. Select ''​%%ps2%%''​ mouse, say ''​%%No%%''​ to GPM configuration and ''​%%Yes%%''​ to configure network.
  
 Setup will then ask for a hostname. Type ''​%%slackfactory%%''​ and for the domain, ''​%%local%%''​. Just accept DHCP, wich is the default, nothing at set DHCP hostname then ''​%%Yes%%''​ to confirm everything. Setup will then ask for a hostname. Type ''​%%slackfactory%%''​ and for the domain, ''​%%local%%''​. Just accept DHCP, wich is the default, nothing at set DHCP hostname then ''​%%Yes%%''​ to confirm everything.
Line 147: Line 141:
 Say ''​%%No%%''​ to console font dialog and ''​%%YES%%''​ to UTC hardware clock (VirtualBox'​s default). Now we hit an important configuration:​ timezone. Say ''​%%No%%''​ to console font dialog and ''​%%YES%%''​ to UTC hardware clock (VirtualBox'​s default). Now we hit an important configuration:​ timezone.
  
-The important here is to configure it to the timezone of where you live, even for the machines that are not going to be deployed in the same country (and timezone) that you live at. Stick always with only one timezone on all server you administer. You can even set straight to UTC if you feel adventurous,​ but do not mix timezones.+The important ​thing here is to configure it to the timezone of where you live, even for the machines that are not going to be deployed in the same country (and timezone) that you live at. Stick always with only one timezone on all server you administer. You can even set straight to UTC if you feel adventurous,​ but do not mix timezones.
  
 So, as the reference system is at Sao Paulo, Brazil, we're going to set the timezone in this how to to America/​Sao_Paulo. So, as the reference system is at Sao Paulo, Brazil, we're going to set the timezone in this how to to America/​Sao_Paulo.
Line 155: Line 149:
 Then say ''​%%OK%%'',​ select ''​%%EXIT%%''​ in the main menu and **STOP**! Then say ''​%%OK%%'',​ select ''​%%EXIT%%''​ in the main menu and **STOP**!
  
-Did you remember that we don't have LILO, right? If we reboot now, we'll not be able to boot straight into that machine anymore (at least not easily). When the dialog ​ask you if 'Would you like to reboot your system?',​ say a loud ''​%%No%%''​.+Did you remember that we don't have LILO, right? If we reboot now, we'll not be able to boot straight into that machine anymore (at least not easily). When the dialog ​asks you 'Would you like to reboot your system?',​ say a loud ''​%%No%%''​.
  
 We're back in the warm prompt. Now we're going to take another non standard setup method: [[howtos:​slackware_admin:​grub_on_first_install|install grub]]. We're back in the warm prompt. Now we're going to take another non standard setup method: [[howtos:​slackware_admin:​grub_on_first_install|install grub]].
Line 172: Line 166:
 </​code>​ </​code>​
  
-If you never have tried to boot into Slackware by any other means but LILO, well, you just did it.+If you have never tried to boot into Slackware by any other means but LILO, well, you just did it.
  
 Now our brand new Slackware can boot, but not by rebooting. Did you remember that we've set VirtualBox to boot via network (PXE) in the first place? So, if you just reboot now, your PXE boot will take precedence and you are going to see the regular Slackware setup boot prompt. We need to change that. Now our brand new Slackware can boot, but not by rebooting. Did you remember that we've set VirtualBox to boot via network (PXE) in the first place? So, if you just reboot now, your PXE boot will take precedence and you are going to see the regular Slackware setup boot prompt. We need to change that.
Line 219: Line 213:
 Now let's dive into the serious stuff. You can move all your open VirtualBox windows away. We're not going to need them for a while. Now let's dive into the serious stuff. You can move all your open VirtualBox windows away. We're not going to need them for a while.
  
-Oh, from now on, this how to not provide the full server command prompt or command outputs anymore, unless they'​re extremely necessary to understand the underlying context. All commands in the virtual machines must run as root, so there will be no ''#''​ (root) or ''​$''​ (user) prefix either. This will make things easier so you can copy and paste, although you're strongly encouraged to type them for yourself so you can learn what you're doing.+Oh, from now on, this ''​how to''​ will not provide the full server command prompt or command outputs anymore, unless they'​re extremely necessary to understand the underlying context. All commands in the virtual machines must run as root, so there will be no ''#''​ (root) or ''​$''​ (user) prefix either. This will make things easier so you can copy and paste, although you're strongly encouraged to type them for yourself so you can learn what you're doing.
  
 ===== Add a Swap File ===== ===== Add a Swap File =====
Line 703: Line 697:
  
 <​code>​ <​code>​
-removepkg httpd kernel-generic kernel-huge kernel-modules ​kernel-headers ​+removepkg httpd kernel-generic kernel-huge kernel-modules ​mariadb ​
-  ​mariadb ​mozilla-nss openvpn samba seamonkey-solibs wpa_supplicant+  mozilla-nss openvpn samba seamonkey-solibs wpa_supplicant
 </​code>​ </​code>​
  
-'HEY! ARE YOU NUTS?',​ we hear you screaming! This is really going to remove Apache and MariaDB. Yes, indeed! Remember: less software, less bugs.+'HEY! ARE YOU NUTS?',​ we hear you screaming! This is really going to remove ​standard Slackware kernel, ​Apache and MariaDB. Yes, indeed! Remember: less software, less bugs.
  
-If you need them later, you can easily install again by the role that your instance plays. You don't need them on every instance you have, even that those services are not enabled by default by Slackware. Chances are you might use AWS RDS for the database or nginx for your webserver. So, why to keep these bloating packages? Just get rid of'em in your base image. As a bonus, this will free you up some space in your tiny 8GB filesystem.+As for Slackware kernels, except for ''​%%kernel-headers%%''​ package that is required to compile other software, they have no use at AWS EC2 instances. You can't boot with them. That's the precise reason we built a dom0 Xen kernel for. 
 + 
 +As for Apache, MariaDB and others, if you need them later, you can easily install again by the role that your instance plays. You don't need them on every instance you have, even that those services are not enabled by default by Slackware. Chances are you might use AWS RDS for the database or nginx for your webserver. So, why to keep these bloating packages? Just get rid of'em in your base image. As a bonus, this will free you up some space in your tiny 8GB filesystem.
  
 Ok, we have no kernel anymore. **DO NOT REBOOT YOUR SLACKAMI MACHINE FROM THIS POINT ON.** The Xen kernel is a no go here because we have no boot grub configuration to load it. Ok, we have no kernel anymore. **DO NOT REBOOT YOUR SLACKAMI MACHINE FROM THIS POINT ON.** The Xen kernel is a no go here because we have no boot grub configuration to load it.
Line 856: Line 852:
 </​code>​ </​code>​
  
-We need to clean up all the mess. We don need that ''​%%/​boot/​grug/​grub.cfg%%''​ from the installation anymore, so let's get rid of it too. AWS EC2 will use ''​%%/​boot/​grug/​menu.lst%%''​ instead, which is part of our configuration payload.+We need to clean up all the mess. We don need that ''​%%/​boot/​grub/​grub.cfg%%''​ from the installation anymore, so let's get rid of it too. AWS EC2 will use ''​%%/​boot/​grub/​menu.lst%%''​ instead, which is part of our configuration payload.
  
 <​code>​ <​code>​
Line 1185: Line 1181:
   * **Wagner Hiendlmayer**,​ who gave me the opportunity to run a shitty business made out of an even more shitty software. This forced me to come out of the comfort zone I was and to learn many new stuff up to a point that, with his valuable help, the business came to be cool (at least I think it is) and may even become profitable in the near future.   * **Wagner Hiendlmayer**,​ who gave me the opportunity to run a shitty business made out of an even more shitty software. This forced me to come out of the comfort zone I was and to learn many new stuff up to a point that, with his valuable help, the business came to be cool (at least I think it is) and may even become profitable in the near future.
  
 +====== Sources ======
 +
 +  * Originally written by [[wiki:​user:​denydias|denydias]]
 +<!-- Authors are allowed to give credit to themselves! -->
 +<!-- * Contributions by [[wiki:​user:​yyy | User Y]] -->
 +
 +<!-- Please do not modify anything below, except adding new tags.-->
 +{{tag>​howtos cloud author_denydias }}

In Other Languages
QR Code
QR Code howtos:cloud:aws_ec2 (generated for current page)