Devstack is a great place to start. You can even trick a devstack install into being pretty close to what you want. Here is an example runthrough.
Step 1 - Install devstack
Start with a fresh install of the latest Fedora or Ubuntu release. In my case, I'm using a Fedora 18 virtual machine. It only has one virtual CPU and 2 GB of RAM. Here are the commands I use to run devstack on a fresh VM:
sudo yum update -y
sudo yum install -y git python-netaddr vim-enhanced
git clone https://github.com/openstack-dev/devstack.git
cd devstack/
cat<<EOF | tee localrc
MYSQL_PASSWORD=secret
SERVICE_TOKEN=secret
SERVICE_PASSWORD=secret
ADMIN_PASSWORD=secret
disable_service rabbit
enable_service qpid
EOF
./stack.sh
Once devstack is up and running, proceed ...
Step 2 - Enable the fake compute driver
Edit /etc/nova/nova.conf to use the fake compute driver. Instead of having nova create real VMs, it will just pretend to.
#compute_driver = libvirt.LibvirtDriver
compute_driver = fake.FakeDriver
After changing this setting, you will need to restart the nova-compute
service. Attach to the devstack screen session, screen -x
, switch to the n-cpu
tab, Ctrl-c
to kill the service, hit the up arrow and then run the same command again.
Step 3 - Disable RAM capacity checking
Edit /etc/nova/nova.conf again. This time disable the scheduler's checking of RAM capacity. You don't want the nova-scheduler
service denying new VM requests based on how much RAM your host has. It doesn't matter since you're using the fake compute driver.
#scheduler_default_filters=RetryFilter,AvailabilityZoneFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter
scheduler_default_filters=RetryFilter,AvailabilityZoneFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter
Now restart the nova-scheduler
service using a similar method as was used to restart nova-compute
.
Step 4 - Disable quotas
Disable quotas so they don't get in your way. Specifically, we want to set the quotas for the demo
tenant.
Switch to the admin user
. ~/devstack/openrc admin
Get the ID for the demo tenant
$ keystone tenant-list
+----------------------------------+--------------------+---------+
| id | name | enabled |
+----------------------------------+--------------------+---------+
| 8ea1cfbd7a07441bbbc8528f0d1feccb | admin | True |
| 918a3427695b493a92320b0d1f805a6d | alt_demo | True |
| c77d4e3501f04e3287cfbf769e25814b | demo | True |
| 88738f98e1b848f9a77aa9927719e3c1 | invisible_to_admin | True |
| 604064fc0e3749aaa61401c45d122ccd | service | True |
+----------------------------------+--------------------+---------+
Set whatever quotas you want to set ...
$ nova quota-update --instances -1 --cores -1 --ram -1 --fixed-ips -1 --floating-ips -1 c77d4e3501f04e3287cfbf769e25814b
Switch back to the regular demo user
$ . ~/devstack/openrc
Step 5 - Boot a huge instance
Now that we have nova set up with the fake compute driver, as well as removed some other things that would prevent launching instances in this fake environment, we can launch a fake huge VM. Here is an example of where I was able to "launch" a VM with 8 VCPUs and 16 GB of RAM.
$ nova flavor-list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0 | True | {} |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True | {} |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True | {} |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True | {} |
| 42 | m1.nano | 64 | 0 | 0 | | 1 | 1.0 | True | {} |
| 5 | m1.xlarge | 16384 ...
(more)