set up dev environment and run nova on mac

Asked by Jerry Liu

Hi,

I'm trying to set up a development environment and run nova on my MacBook Pro.

I followed the instructions on http://wiki.openstack.org/HackingNovaMacOSX, and have set up the development environment on my mac.

After that, how do I run nova on my mac? should I follow the instructions on http://nova.openstack.org/quickstart.html in order to run nova on my mac? I followed the instructions on this website and did
./nova.sh branch
./nova.sh install
but it gave me many errors. I'm wondering whether I should do something different, or follow other documents.

Thank you.
Jerry

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Jerry Liu
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Vish Ishaya (vishvananda) said :
#1

Hey Jerry,

Nova doesn't actually run on mac osx. With a bunch of flags, you can get kind of a fake version running, but you will have a lot more luck running it in a virtual machine. I do some basic development and testing on my root osx, but most of my dev work I do in an ubuntu vm running in virtualbox.

Vish

On Sep 26, 2011, at 2:25 PM, Jerry Liu wrote:

> New question #172409 on OpenStack Compute (nova):
> https://answers.launchpad.net/nova/+question/172409
>
> Hi,
>
> I'm trying to set up a development environment and run nova on my MacBook Pro.
>
> I followed the instructions on http://wiki.openstack.org/HackingNovaMacOSX, and have set up the development environment on my mac.
>
> After that, how do I run nova on my mac? should I follow the instructions on http://nova.openstack.org/quickstart.html in order to run nova on my mac? I followed the instructions on this website and did
> ./nova.sh branch
> ./nova.sh install
> but it gave me many errors. I'm wondering whether I should do something different, or follow other documents.
>
> Thank you.
> Jerry
>
> --
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Revision history for this message
Jerry Liu (ykliu711) said :
#2

Hey Vish,

Thank you for your answer. I have VMware Fusion running on my mac, so I can install ubuntu on this vm. Is there any particular version of ubuntu that is best for nova?

jerry

Revision history for this message
Anne Gentle (annegentle) said :
#3

Hi Jerry -
Any version of Ubuntu later than 10.10 will have packages enabled but probably starting with 11.04 Natty will be a good starting point.

Anne

Revision history for this message
Jerry Liu (ykliu711) said :
#4

Great! Thank you, Anne.
Jerry

Revision history for this message
Vish Ishaya (vishvananda) said :
#5

I use maverick, although i think most people have switched over to natty. Lucid will work as well, but it needs a lot of dependencies.

To install nova in development mode, you can use my script here:
http://github.com/vishvananda/novascript/

There is also a lot of effort going into a replacement that installs and runs everything from source here:
http://devstack.org/

I expect that will replace my novascript above in the near future.

Vish

On Sep 26, 2011, at 3:10 PM, Vish Ishaya wrote:

> Question #172409 on OpenStack Compute (nova) changed:
> https://answers.launchpad.net/nova/+question/172409
>
> Status: Open => Answered
>
> Vish Ishaya proposed the following answer:
> Hey Jerry,
>
> Nova doesn't actually run on mac osx. With a bunch of flags, you can
> get kind of a fake version running, but you will have a lot more luck
> running it in a virtual machine. I do some basic development and
> testing on my root osx, but most of my dev work I do in an ubuntu vm
> running in virtualbox.
>
> Vish
>
> On Sep 26, 2011, at 2:25 PM, Jerry Liu wrote:
>
>> New question #172409 on OpenStack Compute (nova):
>> https://answers.launchpad.net/nova/+question/172409
>>
>> Hi,
>>
>> I'm trying to set up a development environment and run nova on my MacBook Pro.
>>
>> I followed the instructions on http://wiki.openstack.org/HackingNovaMacOSX, and have set up the development environment on my mac.
>>
>> After that, how do I run nova on my mac? should I follow the instructions on http://nova.openstack.org/quickstart.html in order to run nova on my mac? I followed the instructions on this website and did
>> ./nova.sh branch
>> ./nova.sh install
>> but it gave me many errors. I'm wondering whether I should do something different, or follow other documents.
>>
>> Thank you.
>> Jerry
>>
>> --
>> You received this question notification because you are a member of Nova
>> Core, which is an answer contact for OpenStack Compute (nova).
>
> --
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Revision history for this message
Jerry Liu (ykliu711) said :
#6

Thank you, Vish, for your message and the script. I've installed ubuntu 11.04 on my vmware fusion.

I then did
curl -OL https://raw.github.com/vishvananda/novascript/master/nova.sh
chmod 755 nova.sh
./nova.sh branch
./nova.sh install

However, when I did
sudo ./nova.sh run
I got

export PATH=/home/jerry/Documents/openstack/nova/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin;. /home/jerry/Documents/openstack/nova/novarc
root@jerry-virtual-machine:~/Documents/openstack# export PATH=/home/jerry/Documents/openstack/nova/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin;. /home/jerry/Documents/openstack/nova/novarc
bash: /home/jerry/Documents/openstack/nova/novarc: No such file or directory
root@jerry-virtual-machine:~/Documents/openstack# echo $PATH
/home/jerry/Documents/openstack/nova/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin

It seems that there is a space between
/usr/X11R6/bin;.
and
 /home/jerry/Documents/openstack/nova/novarc

And there is no novarc file under the nova directory.

Jerry

Revision history for this message
Jerry Liu (ykliu711) said :
#7

I then tried http://devstack.org, and entered
git clone git://github.com/cloudbuilders/devstack.git
cd devstack; ./stack.sh

However, I got the following flags:

Failed to add image. Got error:
Internal Server error: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.7/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.7/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/glance/glance/common/wsgi.py", line 113, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.7/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.7/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.7/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.7/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/glance/glance/common/wsgi.py", line 110, in __call__
    response = self.process_request(req)
  File "/opt/stack/glance/glance/common/context.py", line 111, in process_request
    raise exception.NotAuthorized()
NotAuthorized: None

Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'.

It seems that it uses python 2.7. Should I install and use python 2.6?

Thanks,
Jerry

Revision history for this message
Jerry Liu (ykliu711) said :
#8

I did
apt-get update; apt-get install python2.6
then
sudo ./stack.sh
now the flags are gone, and the problems are solved.

Thank you, anyway.
Jerry

Revision history for this message
Jerry Liu (ykliu711) said :
#9

Hello,

After I did "sudo ./stack.sh", I got the following message at the end:

+ screen -d -m -S nova -t nova
+ sleep 1
+ [[ g-api,g-reg,key,n-api,n-cpu,n-net,n-sch,n-vnc,dash,mysql,rabbit,munin =~ g-reg ]]
+ screen_it g-reg 'cd /opt/stack/glance; bin/glance-registry --config-file=etc/glance-registry.conf'
++ echo -ne '\015'
+ NL=$'\r'
+ [[ g-api,g-reg,key,n-api,n-cpu,n-net,n-sch,n-vnc,dash,mysql,rabbit,munin =~ g-reg ]]
+ screen -S nova -X screen -t g-reg
There are several suitable screens on:
    7286.nova (09/27/2011 04:04:05 PM) (Detached)
    3834.nova (09/27/2011 03:47:14 PM) (Detached)
Use -S to specify a session.

Am I at the point to access dashboard? If so, what port number should I use? I tried http://127.0.0.1:3834 and http://127.0.0.1:7286, but was unable to connect. I also tried "screen -S 7286.nova -X screen -t g-reg", but no screen session was found.

Thank you.
Jerry

Revision history for this message
Jerry Liu (ykliu711) said :
#10

I followed the instructions on http://github.com/vishvananda/novascript/, and it works now.

Thank you.
Jerry