Giter VIP home page Giter VIP logo

jujubundles's Introduction

Basic OpenStack Cloud

This example bundle deploys a basic OpenStack Cloud (Queens with Ceph Luminous) on Ubuntu 16.04 LTS (Xenial), providing Dashboard, Compute, Network, Block Storage, Object Storage, Identity and Im age services.

Requirements

This example bundle is designed to run on bare metal using Juju 2.x with MAAS (Metal-as-a-Service); you will need to have setup a MAAS deployment with a minimum of 4 physical servers prior to using this bundle.

Certain configuration options within the bundle may need to be adjusted prior to deployment to fit your particular set of hardware. For example, network device names and block device names can vary, and passwords should be yours.

Servers should have:

  • A minimum of 8GB of physical RAM.
  • Enough CPU cores to support your capacity requirements.
  • Two disks (identified by /dev/sda and /dev/sdb); the first is used by MAAS for the OS install, the second for Ceph storage.
  • Two cabled network ports on eno1 and eno2 (see below).

Servers should have two physical network ports cabled; the first is used for general communication between services in the Cloud, the second is used for 'public' network traffic to and from instances (North/South traffic) running within the Cloud.

Components

  • 1 Node for Neutron Gateway and Ceph with RabbitMQ and MySQL under LXC containers.
  • 3 Nodes for Nova Compute and Ceph, with Keystone, Glance, Neutron, Nova Cloud Controller, Ceph RADOS Gateway, Cinder and Horizon under LXC containers.

All physical servers (not LXC containers) will also have NTP installed and configured to keep time in sync.

Neutron Gateway, Nova Compute and Ceph services are designed to be horizontally scalable.

To horizontally scale Nova Compute:

juju add-unit nova-compute # Add one more unit
juju add-unit -n5 nova-compute # Add 5 more units

To horizontally scale Neutron Gateway:

juju add-unit neutron-gateway # Add one more unit
juju add-unit -n2 neutron-gateway # Add 2 more unitsa

To horizontally scale Ceph:

juju add-unit ceph-osd # Add one more unit
juju add-unit -n50 ceph-osd # add 50 more units

Note: Ceph can be scaled alongside Nova Compute or Neutron Gateway by adding units using the --to option:

juju add-unit --to <machine-id-of-compute-service> ceph-osd

Note: Other services in this bundle can be scaled in-conjunction with the hacluster charm to produce scalable, highly avaliable services - that will be covered in a different bundle.

Ensuring it's working

To ensure your cloud is functioning correctly, download this bundle and then run through the following sections.

All commands are executed from within the expanded bundle.

Install OpenStack client tools

In order to configure and use your cloud, you'll need to install the appropriate client tools:

sudo add-apt-repository cloud-archive:queens -y
sudo apt update
sudo apt install python-novaclient python-keystoneclient python-glanceclient \
    python-neutronclient python-openstackclient -y

Accessing the cloud

Check that you can access your cloud from the command line:

source novarc_auto
openstack catalog list

You should get a full listing of all services registered in the cloud which should include identity, compute, image and network.

Configuring an image

In order to run instances on your cloud, you'll need to upload an image to boot instances:

curl http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img | \
    openstack image create --public --container-format=bare --disk-format=qcow2 xenial

Images for other architectures can be obtained from Ubuntu Cloud Images. Be sure to use the appropriate image for the cpu architecture.

Note: for ARM 64-bit (arm64) guests, you will also need to configure the image to boot in UEFI mode:

curl http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img | \
    openstack image create --public --container-format=bare --disk-format=qcow2 --property hw_firmware_type=uefi xenial

Configure networking

For the purposes of a quick test, we'll setup an 'external' network and shared router ('provider-router') which will be used by all tenants for public access to instances:

./neutron-ext-net-ksv3 --network-type flat \
    -g <gateway-ip> -c <network-cidr> \
    -f <pool-start>:<pool-end> ext_net

for example (for a private cloud):

./neutron-ext-net-ksv3 --network-type flat
    -g 10.230.168.1 -c 10.230.168.0/21 \
    -f 10.230.168.10:10.230.175.254 ext_net

You'll need to adapt the parameters for the network configuration that eno2 on all the servers is connected to; in a public cloud deployment these ports would be connected to a publicly addressable part of the Internet.

We'll also need an 'internal' network for the admin user which instances are actually connected to:

./neutron-tenant-net-ksv3 -p admin -r provider-router \
    [-N <dns-server>] internal 10.5.5.0/24

Neutron provides a wide range of configuration options; see the OpenStack Neutron documentation for more details.

Configuring a flavor

Starting with the OpenStack Newton release, default flavors are no longer created at install time. You therefore need to create at least one machine type before you can boot an instance:

openstack flavor create --ram 2048 --disk 20 --ephemeral 20 m1.small

Booting an instance

First generate a SSH keypair so that you can access your instances once you've booted them:

mkdir -p ~/.ssh
touch ~/.ssh/id_rsa_cloud
chmod 600 ~/.ssh/id_rsa_cloud
nova keypair-add mykey > ~/.ssh/id_rsa_cloud

Note: you can also upload an existing public key to the cloud rather than generating a new one:

openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey

You can now boot an instance on your cloud:

openstack server create --image xenial --flavor m1.small --key-name mykey \
    --nic net-id=$(openstack network list | grep internal | awk '{ print $2 }') \
    xenial-test

Attaching a volume

First, create a 10G volume in cinder:

openstack volume create --size=10 <name-of-volume>

then attach it to the instance we just booted:

openstack server add volume xenial-test <name-of-volume>

The attached volume will be accessible once you login to the instance (see below). It will need to be formatted and mounted!

Accessing your instance

In order to access the instance you just booted on the cloud, you'll need to assign a floating IP address to the instance:

openstack floating ip create ext_net
openstack server add floating ip xenial-test <new-floating-ip>

and then allow access via SSH (and ping) - you only need to do these steps once:

openstack security group list

For each security group in the list, identify the UUID and run:

openstack security group rule create <uuid> \
    --protocol icmp --remote-ip 0.0.0.0/0

openstack security group rule create <security-group-name> \
    --protocol tcp --remote-ip 0.0.0.0/0 --dst-port 22

After running these commands you should be able to access the instance:

ssh ubuntu@<new-floating-ip>

What next?

Configuring and managing services on an OpenStack cloud is complex; take a look a the OpenStack Admin Guide for a complete reference on how to configure an OpenStack cloud for your requirements.

Useful Cloud URLs

  • OpenStack Dashboard: http://openstack-dashboard_ip/horizon

jujubundles's People

Contributors

sabbio93 avatar

Watchers

James Cloos avatar  avatar

jujubundles's Issues

Errore aggiunta openstack come cloud di juju

18:23:44 INFO juju.cmd supercommand.go:56 running juju [2.3.4 gc go1.9.2]
18:23:44 DEBUG juju.cmd supercommand.go:57 args: []string{"/snap/juju/3591/bin/juju", "bootstrap", "mystack", "--debug"}
18:23:44 DEBUG juju.cmd.juju.commands bootstrap.go:835 authenticating with region "RegionOne" and credential "admin" ()
18:23:44 DEBUG juju.cmd.juju.commands bootstrap.go:963 provider attrs: map[external-network: use-openstack-gbp:false policy-target-group: use-floating-ip:false use-default-secgroup:false network:]
18:23:45 INFO cmd authkeys.go:114 Adding contents of "/home/ubuntu/.local/share/juju/ssh/juju_id_rsa.pub" to authorized-keys
18:23:45 INFO cmd authkeys.go:114 Adding contents of "/home/ubuntu/.ssh/id_rsa.pub" to authorized-keys
18:23:45 DEBUG juju.cmd.juju.commands bootstrap.go:1019 preparing controller with config: map[use-default-secgroup:false image-metadata-url: transmit-vendor-metrics:true apt-https-proxy: max-action-results-size:5G use-openstack-gbp:false max-status-history-size:5G default-series:xenial container-inherit-properties: agent-metadata-url: test-mode:false max-action-results-age:336h uuid:bb737caa-9b7d-45bf-8d29-4b0ea93a1083 external-network: provisioner-harvest-mode:destroyed enable-os-refresh-update:true name:controller http-proxy: disable-network-management:false ignore-machine-addresses:false no-proxy:127.0.0.1,localhost,::1 cloudinit-userdata: fan-config: max-status-history-age:336h development:false egress-subnets: update-status-hook-interval:5m type:openstack ssl-hostname-verification:true apt-http-proxy: apt-no-proxy: ftp-proxy: policy-target-group: logforward-enabled:false https-proxy: container-networking-method: apt-mirror: firewall-mode:instance net-bond-reconfigure-delay:17 apt-ftp-proxy: resource-tags: automatically-retry-hooks:true network: proxy-ssh:false agent-stream:released image-stream:released logging-config: use-floating-ip:false enable-os-upgrade:true authorized-keys:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtK6GY6FPgvIM6JJB6/Xw7ZPgBUCSL/G7UaJqMPZKto8KW96FvezT5nEjrb/xK/j/hkb/pDBS2E6cHluLRzeu8aqPIGREBW7TtxeNWI6CTVPT4Dp3LzTcS+KjFXQxOt6oHG/mutn+ll/s4L3ra/fufWu4wfLlgRSxNQm/Dwplo0ymI1Pjr09GR5oozyLTDnp+wRVs0Ef5CAHd6VHwyLJD7V5nPTKIa1GJBuvhL7kA/PcvPfupjUi7Hm+KdMgDXxBM2Rd1CG14SW3f1VnvUDQ+b7SWLV5XM705uzN8OGFr//ybahhLHjmIwI3eAnpFTyihbHJpTDMSPSdXVq52wVXbF juju-client-key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDR/I7sEly7QHvqmvWVk8TSDUyL2NCSorh0O+gbCv2AyzFDiWQQiZ7WirH4KlQC7bW8Vy6EI9U/EWdvz4XmnK7AIb8q8U2evhOWuobf4zRfFg9yNQK/LhupB7PhBHSjV1tXR72vVUG2I/9mZGzqYDZpUbd2rjwW5FtruQl4KtBooT/zOWeyHOLSxkvwtI8QflzsdRSTiqcW8Q5yd0s0BtAri0D+m1XblZ/mdY3CMG3RK45zeoQM9NP4+xGrs/aPz91Rivwf8B67biOo6Nys44m+uHdOzMXnF9EOxpSwrt1q70YnAyrO/Sfzzx6+42k3TU4vk+tQoxyzLHqnDrMmhG/f ubuntu@ubuntu
]
18:23:45 INFO juju.provider.openstack provider.go:144 opening model "controller"
18:23:46 DEBUG goose :1 auth details: &{Token:2f91b19f35684020a38206c30b7f29e5 TenantId: UserId:fe00c841cf5e41648247511035e92c75 Domain:admin_domain RegionServiceURLs:map[RegionOne:map[metric:http://192.168.211.215:8041 image:http://192.168.211.213:9292 network:http://192.168.211.212:9696 cloudformation:http://192.168.211.216:8000/v1 alarming:http://192.168.211.8:8042 object-store:http://192.168.211.204:80/swift/v1 identity:http://192.168.211.205:5000/v3 placement:http://192.168.211.207:8778]]}
18:23:46 DEBUG juju.provider.openstack provider.go:803 authentication failed: cannot create service URLs
caused by: the configured region "RegionOne" does not allow access to all required services, namely: compute
access to these services is missing: compute
ERROR authentication failed.

Please ensure the credentials are correct. A common mistake is
to specify the wrong tenant. Use the OpenStack "project" name
for tenant-name in your model configuration.
18:23:46 DEBUG cmd supercommand.go:459 error stack:
github.com/juju/juju/provider/openstack/provider.go:804: authentication failed.

Please ensure the credentials are correct. A common mistake is
to specify the wrong tenant. Use the OpenStack "project" name
for tenant-name in your model configuration.
github.com/juju/juju/environs/bootstrap/prepare.go:163:
github.com/juju/juju/environs/bootstrap/prepare.go:99:
github.com/juju/juju/cmd/juju/commands/bootstrap.go:480:

passi per riprodurlo:
Cloud Types
maas
manual
openstack
oracle
vsphere

Select cloud type: openstack

Enter a name for your openstack cloud: mystack

A cloud named "mystack" already exists. Do you want to replace that definition? (y/N): y

Enter the API endpoint url for the cloud: http://192.168.211.205:5000/v3

Auth Types
access-key
userpass

Select one or more auth types separated by commas: access-key, userpass

Enter region name: RegionOne

Enter the API endpoint url for the region [use cloud api url]:

Enter another region? (Y/n): n

Cloud "mystack" successfully added
You may bootstrap with 'juju bootstrap mystack'
ubuntu@ubuntu:~$ juju bootstrap mystack --debug

ceph backup

La scheda è attivata ma la funzione sembra di no infatti restituisce errore.
Possibile causa mancanza del charm cinder-backup

errore avvio istanza con immagine pesante

Impossibile eseguire l'operazione richiesta sull'istanza "cloudy", l'istanza è nello stato di errore: Riprovare più tardi [Errore: Build of instance 22feac82-efd3-4579-990e-89269e708733 aborted: Volume 5a56c3b7-652d-4fb8-9856-c8445c68787b did not finish being created even after we waited 196 seconds or 61 attempts. And its status is downloading.].

step per riprodurre

  • login dentro la pagina di gestione openstack http://192.168.211.210/horizon
    -Progetto=>Istanze
    -click menu crea nuova istanza
    -origine selezionare cloudify
    -flavor selezionare medium
    -avvia istanza

Dopo qualche minuti (circa 4) compare l'errore sulla dashboard

no ping per cph osd

Mar 17 22:26:02 hardy-snake ceph-osd[115922]: 2018-03-17 22:26:02.782509 7fe5fc864700 -1 osd.0 61 heartbeat_check: no reply from 192.168.210.5:6806 osd.1 ever on either front or back, first ping sent 2018-03-17 18:24:48.474270 (cutoff 2018-03-17 22:25:42.782507)
Probabile risultato non riesco a memorizzare le immagini

no ping macchine

impossibile raggiungere le macchine anche dal router con netns

la vm non parte

#1 semra risolto con l'ip su eno2 presente solo su neutron-gateway.
funziona:

-caricamento immagini

  • creazione volumi

  • creazione liste
    non funziona lo startup delle VM
    Nota: la vm prende due indirizzi sulla rete privata :-o

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.