Procedure to setup DevStack in a guest ====================================== Setup KVM nested virtualization on your host -------------------------------------------- On your This assumes an Intel machine: $ cat /sys/module/kvm_intel/parameters/nested N $ rmmod kvm-intel $ echo "options kvm-amd nested=1" > /etc/modprobe.d/dist.conf $ modprobe kvm-intel $ cat /sys/module/kvm_intel/parameters/nested Y (More details: http://kashyapc.fedorapeople.org/virt/procedure-to-enable-nested-virt-on-intel-machines.txt) Create the DevStack disk image ------------------------------ 1. Create a new Fedora-21 disk image that will be our DevStack virtual machine: $ virt-builder fedora-21 -o devstack-advent --update \ --format qcow2 --selinux-relabel --size 8G 2. Import the disk image into libvirt (and getaccess to a serial console): $ virt-install --name devstack-advent --ram 4096 \ --disk path=/home/kashyapc/devstack-advent,format=qcow2 --import \ --os-variant=fedora21 $ virsh console devstack-advent Expose KVM extensions in DevStack VM ------------------------------------ Set this on the DevStack VM: $ virt-xml devstack --edit --cpu host-passthrough,clearxml=yes Reboot the VM, so that the KVM (/dev/kvm character device) is now available in DevStack. Setting up DevStack environment ------------------------------- (1) We'll install DevStack under: $HOME/src/cloud, create that env: $ mkdir -p $HOME/src/cloud $ cd $HOME/src/cloud $ chmod go+rx $HOME Install git: $ yum install git -y (2) Create a user, and give sudo permissions: $ useradd tuser1 $ passwd (#secret) $ visudo [. . .] $ grep tuser /etc/sudoers tuser1 ALL=(ALL) NOPASSWD: ALL (3) Clone DevStack project, create a local.conf file and invoke the install script: $ git clone https://git.openstack.org/openstack-dev/devstack $ cd devstack # The local.conf file is provided in the root directory $ wget https://kashyapc.fedorapeople.org/virt/openstack/minimal_devstack_localrc.conf $ cp ../local.conf . $ ./stack.sh A successful run of ./stack.sh will end up with a message like this: . . . Keystone is serving at http://127.0.0.1:5000/v2.0/ Examples on using novaclient command line is in exercise.sh The default users are: admin and demo The password: secret This is your host ip: 192.169.142.109 real 4m55.141s user 2m21.688s sys 0m37.797s Try a few things ---------------- (1) Source the Keystone authentication credentials $ source accrc/admin/admin (2) List images in Glance $ glance image-list +--------------------------------------+--------------------------+-------------+------------------+----------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +--------------------------------------+--------------------------+-------------+------------------+----------+--------+ | f7575faa-bbb1-4749-8ec5-7f76179722df | cirros-0.3.3-x86_64-disk | qcow2 | bare | 13200896 | active | +--------------------------------------+--------------------------+-------------+------------------+----------+--------+ (3) List different flavors (virtual hardware templates) available in Nova: $ nova flavor-list (4) Boot a 'tiny' flavored Nova instance (i.e. a nested KVM guest) -- a CirrOS disk image: $ nova boot --image cirros-0.3.3-x86_64-disk --flavor m1.tiny cirrosvm1 On reboot --------- To start the OpenStack services again: $ cd /home/tuser1/src/cloud/devstack $ ./rejoin-stack.sh