Friday 28 June 2013

image

Ubuntu Cloud Archive

to support new releases of openstack on Ubuntu 12.04 LTS release.

official site from Ubuntu

How to Enable and Use
1, You'll first need to add the cloud archive gpg key into your ubuntu-keyring by running the following command:
sudo apt-get install ubuntu-cloud-keyring

2, Next, to get access to the Ubuntu Cloud archive, please add the following entries to your /etc/apt/sources.list: (Grizzly)
 # The primary updates archive that users should be using
 deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/grizzly main

 # Public -proposed archive mimicking the SRU process for extended testing.
 # Packages should bake here for at least 7 days. 
 #deb  http://ubuntu-cloud.archive.canonical.com/ubuntu precise-proposed/grizzly main
Now run:
sudo apt-get update


to update your package listings and then proceed to install/upgrade your openstack packages.

Storage / Volume / Instance

[two types of storage]
The cinder-volume service which provide persistent block storage vs. the ephemeral storage provided by the instance flavor.

- Ephemeral
   Rebooting the VM or restarting the host server will not destroy ephemeral data. data will be deleted if the instance is terminated;
   In the typical use case an instance's root filesystem is stored on ephemeral storage.
   In addition to the ephemeral root volume all flavors except the smallest, m1.tiny, provide an additional ephemeral block device varying from 20G for the m1.small through 160G for the m1.xlarge by default. 
   This is presented as a raw block device with no partition table or filesystem. Cloud aware operating system images may discover, format, and mount this device. For example the cloud-init package included in Ubuntu's stock cloud images will format this space as an ext3 filesystem and mount it on /mnt. 

- Persistent (Volume)
   Volume storage is independent of any particular instance and is persistent. Volumes are user created and within quota and availability limits may be of any arbitrary size.   
   When first created volumes are raw block devices with no partition table and no filesystem. They must be attached to an instance to be partitioned and/or formatted. Once this is done they may be used much like an external disk drive. 
   It is possible to configure a volume so that it is bootable and provides a persistent virtual instance similar to traditional non-cloud based virtualization systems. In this use case the resulting instance may still have ephemeral storage depending on the flavor selected, but the root filesystem (and possibly others) will be on the persistent volume and thus state will be maintained even if the instance it shutdown. 

   Volumes do not provide concurrent access from multiple instances. For that you need either a traditional network filesystem like NFS or CIFS or a cluster filesystem such as GlusterFS.

Thursday 27 June 2013

OpenStack Operation Guide - Provisioning & Deployment

Automatic Deploylment: two ways.

Way 1 - An automated deployment system installs and configures operating systems on new servers, without intervention, after the absolute minimum amount of manual work (physical racking, MAC to IP assignment, power configuration, and so on).

[Installation]
solutions rely on wrappers around PXE boot and TFTP servers for the basic operating system install, then hand off to an automated configuration management system.
The Preboot eXecution Environment (PXE, also known as Pre-Execution Environment; sometimes pronounced "pixie") is an environment to boot computers using a network interface independently of data storage devices (likehard disks) or installed operating systems.


[configuration]
Ubuntu and Red Hat Linux both include mechanisms for configuring the operating system, including preseed and kickstart, that you can use after a network boot.
Preseeding provides a way to set answers to questions asked during the installation process, without having to manually enter the answers while the installation is running. This makes it possible to fully automate most types of installation and even offers some features not available during normal installations.
Most of the questions asked by DebianInstaller can be preseeded by setting the answers in the debconf database.
The Red Hat Kickstart installation method[1] is used primarily (but not exclusively) by the Red Hat Enterprise Linux operating system to automatically perform unattended operating system installation and configuration. Red Hat publishes Cobbler as a tool to automate the Kickstart configuration process. 

A Kickstart file contains a series of options, to be passed to the Anaconda installer, that describes how to set up the system. It may also include custom scripts to be run before or after the installation.
A Kickstart installation[3] follows these four steps:
  1. The machine is booted from a CD/DVD, a USB device or over a network using PXE and the network protocols Dynamic Host Configuration Protocol and Trivial File Transfer Protocol.
  2. The Kickstart file is downloaded from the boot media or network (most common).
  3. An Anaconda installation is automatically launched and reads the Kickstart file for the location of the Installation Tree. The tree can reside on the boot media or network.
  4. After accessing the Installation Tree, the installer attempts an unattended installation. If any required information is missing from the Kickstart file, or the file is configured incorrectly, the installer may prompt the user for additional information.

Way 2 - Alternatively, you can use an image based approach for deploying the operating system, such as systemimager.

SystemImager is software that automates Linux installs, software distribution, and production deployment.
SystemImager makes it easy to do automated installs (clones), software distribution, content or data distribution, configuration changes, and operating system updates to your network of Linux machines. You can even update from one Linux release version to another!
It can also be used to ensure safe production deployments. By saving your current production image before updating to your new production image, you have a highly reliable contingency mechanism. If the new production enviroment is found to be flawed, simply roll-back to the last production image with a simple update command!
Some typical environments include: Internet server farms, database server farms, high performance clusters, computer labs, and corporate desktop environments.

areas to be careful"
- Disk Partitioning & RIAD
- Network configuration

Automated Configuration
Puppet
It's coming from Puppet Labs.
Puppet is a tool designed to manage the configuration of Unix-like and Microsoft Windows systems declaratively. The user describes system resources and their state, either using Puppet's declarative language or a Ruby DSL (domain-specific language). This information is stored in files called "Puppet manifests". Puppet discovers the system information via a utility called Facter, and compiles the Puppet manifests into a system-specific catalog containing resources and resource dependency, which are applied against the target systems. Any actions taken by Puppet are then reported.

Remote Management

In computingout-of-band management (sometimes called lights-out management or LOM) involves the use of a dedicated management channel for device maintenance. It allows asystem administrator to monitor and manage servers and other network equipment by remote control regardless of whether the machine is powered on, or if an operating system is installed or functional.
By contrast, in-band management like VNC or SSH is based on software that must be installed on the remote system being managed and only works after the operating system has been booted. This solution may be cheaper, but it does not allow access to BIOS settings, or the reinstallation of the operating system and cannot be used to fix problems that prevent the system from booting.
Both in-band and out-of-band management is usually done through the network connection, but an out-of-band management card can use a physically separated network connector if preferred. A remote management card usually has an at least partially independent power supply, and can power the main machine on and off through the network.

- IPMI
The Intelligent Platform Management Interface (IPMI) is a standardized computer system interface used by system administrators for out-of-band management of computer systems and monitoring of their operation.
The development of this interface specification was led by Intel Corporation and is supported by more than two hundred computer systems vendors.[1] CiscoDellHewlett-PackardIntel, and NEC Corporation announced IPMI v1.0 on 1998-09-16, v1.5 on 2001-03-01, and v2.0 on 2004-02-14.


Wednesday 26 June 2013

Curl


use the following one highlighted with red color for Windows:

Win32 - Generic
Win327.30.0binaryDirk Paehl
Win327.30.0binarySSLSSHDirk Paehl
Win32 2000/XP7.31.0binarySSLGünter Knauf2.01 MB
Win32 2000/XP7.31.0binarySSLSSHGünter Knauf2.39 MB
Win32 2000/XP7.31.0libcurlSSLGünter Knauf3.32 MB


Also need download openssl

PlatformVersionURL
Windowsvariousshininglightpro.com


The followin version can be used.

Win32 OpenSSL v1.0.1e16MB InstallerInstalls Win32 OpenSSL v1.0.1e (Recommended for software developers by the creators of OpenSSL). Note that this is a default build of OpenSSL and is subject to local and state laws. More information can be found in the legal agreement of the installation.


if we need proxy, e.g. use it in office. here is the parameters to use:

curl -x proxy[:port ] -I www.baidu.com

OpenStack - session 1

Here are couple of good videos to start with:

OpenStack 101 from Rackspace. 6 mins

   a quick introduction about Openstack. Worth watching if you are not familiar of OpenStack.

- Introduction to OpenStack from Sandy Walsh Nov 2012 32 mins

   Good history overview and concept overview.

OpenStack Grizzly Architecture 101 from Ken Pepple Apr 2013(Summit) 43 mins

  a good explanation of the architecture of Grizzly release of OpenStack.

OpenStack Grizzly Dashboard Demo from Mark Collier 2013 7 mins

 COO of OpenStack Foundation 

OpenStack 101 from Joshua Mckenty Oct 2012 43 mins

  has anology between linux kernel and openstack. quite interesting. advocate guys not download from openstack directly, and should try some distributions from other companies. kind of advertisement. ;)

You can find a good writing about the Grizzly architecture from Ken Pepple:

http://www.solinea.com/2013/06/15/openstack-grizzly-architecture-revisited/


- writen in Python
- deamon/service using WSGI Paste
- Dashboard is a Django app

1, Identity (Keystone) <-> AWS IAM
    includes back-end of identity, catalog, token, policy 
2, Dashboard (Horizon) Django app <-> AWS deployment/Management services like CloudWatch/CloundFormation
3, Object Storage (Swift), object basically is files <-> AWS S3
    not FTP server, not mount as file share, not file server.
    should be accessed (via API or HTTP) through swift-proxy
    account / container implemented on SQLlite;
    object store implemented on disk;
    swift-proxy is the deamon
4, Image service (Glance) <-> no 
    glance-api is the deamon
    upload/download images(VM images), query/assign meta-data to images;
    glance-registry stores only meta-data about images, not images itself;
    actual images have plugable backend to support the images storage, 
    usually via swift(as actual image repository)
    misc: caching images, pre-fetching images;
5, Compute (Nova)
    initiates most of the orchestration activities;
    policy - quota checks;
    nova-compute orchestrate hypervisor;(is a worker deamon that creates and terminates virtual machine instances via hypervisor's API)
   <<openstack is not hypervisor, it's not virtualization, it's a framework to control virtualization>>
   support VMware(VMware API), Hyper-V, KVM(libvirt), Xen(Xen API).
   all below interactions are via queue services(messages)
   nova-api -> nova-scheduler -> nova-compute (->glance-api) -> nova-conductor
   nova-scheduler determine which nova compute server to use;
   nova-compute retrieve image, talk to hypervisor to create the instance;
   nova-conductor mediate the access to database for nova;
   database stores the all of the state of your current running cloud;
   queue can be implemented with different technologies; 
   nova-consoleauth provides console service;
6, Block Storage(Cinder)
   moved out from Nova;
   Cinder-Volume; interacts with a variety of storage providers;
   Cinder-scheduler;
7, networking (quantum)
   allows to create layer2 or layer3 networks;
   plugins & agents from different providers;

DevStack setup

1, if you met the issue/error related to keystone: 

keystone-manage can stopped unexpectedly;


This is due to MySQL root password. If you have MySQL installed before the devstack setup. The root password may not be the same as the ADMIN_PASSWORD in localrc config file.


use the following command to change the root password for MySQL:


$ mysqladmin -u root -p'oldpassword' password newpass



refer to the following article:

http://www.cyberciti.biz/faq/mysql-change-root-password/

2, by default swift and quantum are not installed by the stack.sh.

refer to wiki of QuantumDevstack for installation of Quantum.

disable_service n-net 
enable_service q-svc 
enable_service q-agt 
enable_service q-dhcp 
enable_service q-l3 
enable_service q-meta 
enable_service quantum 
# Optional, to enable tempest configuration as part of devstack 
enable_service tempest

to enable swift, add followings to localrc
enable_service swift

3, if met quantum server can not be started, if may be caused by an old version of oslo.
refer to following bug fixing on launchpad
https://bugs.launchpad.net/neutron/+bug/1194807

openstack/common/db/sqlalchemy/session.py", line 283, in <module>
    deprecated_opts=[cfg.DeprecatedOpt('sql_connection',
AttributeError: 'module' object has no attribute 'DeprecatedOpt'
Seems that something was merged in quantum that depends on trunk unreleased oslo components.
Oslo version I've installed: oslo.config-1.1.1

TODO list

- curl
- git
- GitHub
- MySQL
- lanuchpad
- openstack
- vmware
- hipervisor
- Python
- sed
- Ubuntu

- GAE, HeroKu ,Engine Yard (PaaS)
- Sina SAE: PaaS;
- Ali Cloud: IaaS;
- Salesforce / Workday;
- TechCrunch, Terremark;