Standalone mode (no network)

Asked by Laurent Borensky

Hi,

I search to work with a standalone PC. I just would like validated nova fonctionality with qemu hypervisor.
I installed Nova with HOST_IP=127.0.0.1 & USE_MYSQL=1, but I was connected to internet. After reboot, without network,
I have an error on each service (ie: nova-api, nova-compute, etc.). The error is relative to DNS Internet (8.8.8.8)
with this code (flags.py):
  def _get_my_ip()
    """ returns the actual IP of local machine
    """
    try:
        csock = scocket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 csock.connect(('8.8.8.8'))
 (addr, port) = csock.getsockname()
 return addr
    except socket.gaierror as ex:
 return 127.0.0.1

OK, It is really possible to work in standalone mode ?

Thank's

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Laurent Borensky
Solved:
Last query:
Last reply:
Revision history for this message
Laurent Borensky (laurent-borensky) said :
#1

Hi at all,

OK, I modified (temporaly) the code (see below) to solve my problem to use standalone Nova with my PC. Now, I must confirm that it is possible to run a VM (qemu) with my environment.

source modification: (file: nova/nova/flags.py)
   WAS: line 203

 def _get_my_ip():
  """Returns the actual ip of the local machine."""
  try:
   csock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
   csock = connect(('8.8.8.8', 80))
   (addr, port) = csock.getsockname()
   csock.close
   return addr
  except socket.gaierror as ex:
   return "127.0.0.1"

   NOW IS:

 def _get_my_ip():
  """Returns the actual ip of the local machine."""
  return "127.0.0.1"
  """
  try:
   csock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
   csock = connect(('8.8.8.8', 80))
   (addr, port) = csock.getsockname()
   csock.close
   return addr
  except socket.gaierror as ex:
   return "127.0.0.1"
  """

But why the exception did not return the good value (string "127.0.0.1") ?

Regards,

Revision history for this message
Laurent Borensky (laurent-borensky) said :
#2

OK, it's just a patch personal