Difference between revisions of "Infrastructure Virtualization Project"

From Amahi Wiki
Jump to: navigation, search
Line 83: Line 83:
 
*# Log into Proxmox VE via SSH and execute the following from command line
 
*# Log into Proxmox VE via SSH and execute the following from command line
 
*#* Navigate to <code>/var/lib/vz/###</code> (number of VM)
 
*#* Navigate to <code>/var/lib/vz/###</code> (number of VM)
*#* Rename <code>.qcow2</code> image to <code>.backup</code>
+
*#* <code>mv original_image.qcow2 original_image.qcow2_backup</code> (rename image)
*#* <code>mv original_image.qcow2 original_image.qcow2_backup</code>
 
 
*#* <code>qemu-img convert -O qcow2 original_image.qcow2_backup original_image.qcow2</code>
 
*#* <code>qemu-img convert -O qcow2 original_image.qcow2_backup original_image.qcow2</code>
 
*#* Copy new <code>.qcow2</code> image to a safe location for uploading into OpenStack
 
*#* Copy new <code>.qcow2</code> image to a safe location for uploading into OpenStack

Revision as of 02:24, 24 November 2014

Msgbox-WOPr.png Work In Progress
This article is currently undergoing major expansion or restructuring. You are welcome to assist by editing it as well. If this article has not been edited in several days, please remove this template.


Objective

This is a project to update and modernize the infrastructure that keeps the Amahi web sites and services running.

The idea is to provide easier and more sustainable management of the infrastructure to leave more time for the team to devote to moving the project forward.

Note: this project is not about running Amahi platform software on virtual servers, etc. For that there is a separate page on Virtualization.

Goals

We have multiple goals:

  • run some of internal build machines in a reliable, efficient way, so that we have consistent and updated builds/releases
  • have consistent and recent backups making things recoverable
  • run some testing of Amahi apps more easily and efficiently
  • test new features in an isolated manner

...

Known Issues

  • Image resizing does not work
  • Controller node is memory intensive

Pending Actions

  • Set up floating IP address range
  • Create automated VM backup routine

Hardware

Dell Rack Server

  • Dual Xeon E5450 3.0 GHz Processors
  • 8GB PC2-5300 RAM (8x1)
  • Two Gigabit Network Interfaces
  • KVM Network Interface
  • RAID Controller
  • Four Quick Swap Drive Bays
    • 1 - 1 TB (OS and Backup)
    • 2 - 120GB SSD (VMs)
    • 3 - Empty
    • 4 - Empty

Software

  • CentOS 7 x86_64 (Minimal)
  • OpenStack Juno Release

Setup

  • Download and install CentOS 7 x86_64 minimal image
  • Configure FQDN (/etc/hosts and /etc/hostname)
  • Manually configure networking (set static IP address)
  • Add users and private keys for SSH login
  • Disable SSH password and root login
  • Enable EPEL Repo
   yum install epel-release
or
   rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
  • Perform OS update
   yum -y update
  • Install OpenStack following RDO Quickstart instructions (run packstack --allinone as root)
  • Configure network bridging (refer to RDO Reference)
    • Set CONFIG_PROVISION_ALL_IN_ONE_OVS_BRIDGE=n in packstack-answers-20141028-205455.txt
    • Executed packstack --answer-file=packstack-answers-20141028-205455.txt (as root)
    • Created /etc/sysconfig/network-scripts/ifcfg-br-ex
    • Revised /etc/sysconfig/network-scripts/ifcfg-enp9s0f0
    • Appended lines to /etc/neutron/plugin.ini
    • Restarted the network service
    • Removed router and subnet (ALL instances must be terminated to remove subnet)
    • Recreated subnet with IP address allocation range (set floating IP addresses)
    • Recreated router to match gateway
  • Configure DNS to access internet
    • Edit /etc/neutron/dhcp_agent.ini and uncomment the line below:
# Comma-separated list of DNS servers which will be used by dnsmasq
# as forwarders.
# dnsmasq_dns_servers = 
and add 8.8.8.8,8.8.4.4 after equal (=), then reboot as I could not determine what service to restart.

Build Images

This will outline how to build OpenStack images using Proxmox VE.

  • Log into Proxmox VE web UI
  • Create a VM or clone an existing one
    1. If creating a VM, install the OS
    2. If using a clone, start the VM
  • Open a console window for the VM
    1. Log in and as root do the following
      • dd if=/dev/zero of=/mytempfile (zero out any unused space)
      • rm -f /mytempfile
    2. Shutdown VM
    3. Log into Proxmox VE via SSH and execute the following from command line
      • Navigate to /var/lib/vz/### (number of VM)
      • mv original_image.qcow2 original_image.qcow2_backup (rename image)
      • qemu-img convert -O qcow2 original_image.qcow2_backup original_image.qcow2
      • Copy new .qcow2 image to a safe location for uploading into OpenStack
      • Remove .backup file
      • Delete the VM from Proxmox VE web UI
  • Use WINScp or similar program to copy the .qcow2 image to client machine
  • Upload into OpenStack via the web UI


REF: Reclaim disk space from .qcow2 or .vmdk image

Notes

  • the floating IPs situation may not work on non-externally routed IPs. this may be why they set up a 179. "public" network by detafult in the RDO setup. i deleted that network
  • the external network needs to be "flagged" as external. this cannot be done with the UI, but i am told the juno release has a feature where attribute editing. so that the external attribute can be set to Yes. once that is done, MAYBE the system allows floating IPs in that network even if the IP range is not externally routable
  • basically understand what it takes to get an image created, seasoned, and how we need to maintain these over long periods. i think the main workhorse is qcow2 tools.
  • these images are like "snapshots" in some way, but a snapshot is frozen and cannot be tweaked.
  • long term we want to make images like this for testing, e.g. and amahi 7 image that is bootable and it's plain instal. another example is a fully up to date amahi 7 image, etc.
  • so they are alive in that these images are frozen in time, but one takes a copy and can then evolve it into a new version of the image.