Giter VIP home page Giter VIP logo

infrasim-compute's Introduction

Infrasim-compute: bare-metal server simulator

Version Downloads

System Basic Requirements

Infrasim package can be installed in any physical machine or virtual machines hosted by Virtualbox, ESXi, Parallel Desktop or cloud provider like AWS, Linode and etc.

The basic installation system requirements are:

  1. Ubuntu Linux 64bit OS (14.04/15.04/16.04)
  2. at least 4GB memory
  3. at least 16GB disk size

Installation

  1. Ensure sources.list integrity then install dependency:

    sudo apt-get update
    sudo apt-get install python-pip libpython-dev libssl-dev libaio-dev
    
  2. Upgrade pip and install setuptools:

    sudo pip install --upgrade pip
    sudo pip install setuptools
    
  3. Two ways to install infrasim:

    • install infrasim from source code:

      git clone https://github.com/InfraSIM/infrasim-compute.git
      
      cd infrasim-compute
      
      sudo pip install -r requirements.txt
      
      sudo python setup.py install
      
    • install infrasim from python library:

      sudo pip install infrasim-compute
      

Start Infrasim Service

  1. Initialization (you need do it once)

    sudo infrasim init
    

    Optional arguments:

    • -s, --skip-installation Ignore qemu/openipmi package installation
    • -f, --force Destroy existing Nodes
    • -c [CONFIG_FILE], --config-file [CONFIG_FILE] Use customized yaml file for the default node
    • -t [TYPE], --type [TYPE] Render specified node type for the default node
  2. Infrasim Service Version:

    sudo infrasim version
    
  3. Infrasim Node Configuration Management:

    • Add configuration mapping to a node
    sudo infrasim config add <node name> <config path>
    
    • Delete configuration mapping of a node
    sudo infrasim config delete <node name>
    
    • Update configuration mapping of a node
    sudo infrasim config update <node name> <config path>
    
    • Edit configuration mapping with environment editor
    sudo infrasim config edit
    
    • List all configuration mappings
    sudo infrasim config list
    
  4. Infrasim Service Node Commands

    • Start a node
    sudo infrasim node start [node name]
    
    • Check node status
    sudo infrasim node status [node name]
    
    • Stop a node
    sudo infrasim node stop [node name]
    
    • Restart a node
    sudo infrasim node restart [node name]
    
    • Stop a node and detroy its runtime workspace
    sudo infrasim node destroy [node name]
    

    The default node configuration is already added to configuration mapping during infrasim init. In node commands, argument [node name] is optional. If it's not specified, it's treated as node "default".

Notice: You can use VNC to access the emulated legacy hardware, the default VNC port is 5901

infrasim-compute's People

Contributors

bcyan avatar chenc52 avatar chenge3 avatar emcinfrasim avatar heckj avatar helloarys avatar junezhou19 avatar markma001 avatar minweipan avatar non5yi avatar paynepei avatar sharkconi avatar sherysheng avatar turtle-fly avatar wangfanta avatar weia5-emc avatar willwu1 avatar winniexu1 avatar xiaowenjiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infrasim-compute's Issues

How to connect to serial monitor?

Would like to see iPXE happen in text not VNC format. I haven't been able to connect to 9003 and see/do anything useful yet. Any hints you could share on the README?

node-0-node fails to start

[Problem Description]
node-0-node fails to start when i run “sudo infrasim-main start” on Ubuntu 16.04.

[Steps to Reproduce]

  1. Ensure sources.list integrity
$ sudo apt-get update
$ sudo apt-get install python-pip libpython-dev libssl-dev
  1. Upgrade pip and install setuptools:
$ sudo pip install --upgrade pip
$ sudo pip install setuptools
  1. install infrasim:
$ git clone https://github.com/InfraSIM/infrasim-compute.git
$ cd infrasim-compute
$ sudo pip install -r requirements.txt
$ sudo python setup.py install
$ install infrasim from python library:
$ sudo pip install infrasim-compute

4) Start Infrasim Service

$ sudo mkdir /etc/qemu
$ sudo infrasim-init
$ sudo infrasim-main start
-> node-0-node fails to start and tcp 5901 does not listen.

[Actual Results]
Infrasim service starts but node-0-node fails to start and the following messages are displayed.

 [ 17629  ] node-0-socat starts to run.
[ 17630  ] node-0-bmc starts to run.
[ ERROR ] node-0-node fail to start
Infrasim service started.
You can access node node-0 via vnc:192.168.18.2:5901 

And tcp 5901 does not listen

Operation Log:
20161018-01.txt

[Expected Results]
node-0-socat, node-0-bmc and node-0-node starts and tcp 5901 listens.

Looks like Bintray packages need a refresh (probably for ~16.04.1)

root@abc:/usr/local/bin# ldd qemu-system-x86_64
./qemu-system-x86_64: /lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by ./qemu-system-x86_64)
./qemu-system-x86_64: /lib/x86_64-linux-gnu/libncurses.so.5: no version information available (required by ./qemu-system-x86_64)
./qemu-system-x86_64: /lib/x86_64-linux-gnu/libncurses.so.5: no version information available (required by ./qemu-system-x86_64)
        linux-vdso.so.1 (0x00007fff97d6e000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f561b166000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f561af63000)
        libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007f561ad3d000)
        libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f561ab13000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f561a804000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f561a5fb000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f561a2fa000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f561a0e4000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5619ec6000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5619b1b000)
        /lib64/ld-linux-x86-64.so.2 (0x0000563e77d54000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5619917000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f56196a8000)
root@abc:/usr/local/bin# ldd openipmish
./openipmish: /lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by ./openipmish)
        linux-vdso.so.1 (0x00007fff7ebae000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fb0906ba000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb09049d000)
        libOpenIPMIcmdlang.so.0 => /usr/local/lib/libOpenIPMIcmdlang.so.0 (0x00007fb090252000)
        libOpenIPMIutils.so.0 => /usr/local/lib/libOpenIPMIutils.so.0 (0x00007fb090047000)
        libOpenIPMI.so.0 => /usr/local/lib/libOpenIPMI.so.0 (0x00007fb08fd0e000)
        libOpenIPMIposix.so.0 => /usr/local/lib/libOpenIPMIposix.so.0 (0x00007fb08fb06000)
        libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007fb08f8dc000)
        libOpenIPMIglib.so.0 => /usr/local/lib/libOpenIPMIglib.so.0 (0x00007fb08f6d8000)
        libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fb08f4d5000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fb08f1c6000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb08ee1b000)
        /lib64/ld-linux-x86-64.so.2 (0x000055566e844000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb08eb19000)
        libcrypto.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fb08e71d000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fb08e4ae000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb08e2aa000)
root@abc:/usr/local/bin#

"sudo infrasim init -f" reports error on a clean system

Traceback (most recent call last):
File "/usr/local/bin/infrasim", line 6, in
cli.command_handler()
File "/usr/local/lib/python2.7/dist-packages/infrasim/cli.py", line 344, in command_handler
infrasim_init(args.type, args.skip_installation, args.force, args.infrasim_home, args.config_file)
File "/usr/local/lib/python2.7/dist-packages/infrasim/init.py", line 105, in infrasim_init
destroy_existing_nodes()
File "/usr/local/lib/python2.7/dist-packages/infrasim/init.py", line 87, in destroy_existing_nodes
nodes = os.listdir(config.infrasim_home)
OSError: [Errno 2] No such file or directory: '/home/vxrail/.infrasim'

Error while executing "make"

I got the following error when I executed the "make" command when installing valgrind :
--- fatal error: asm/types.h: No such file or directory
--- #include <asm/types.h>

Do you know how to solve this?

Thanks ahead,
Eytan

how to run unit tests for development?

Hey @fub2

Enjoyed the demo and walk through, so I tried to spin up a local environment to poke at things from a unit/functional test level. I'm not entirely clear on how to run the unit tests - was hoping you could point me in the right direction.

Here's what I did:

  • create a Vagrant Ubuntu 16.04 instance to work within
    vagrant init ubuntu/wily64 && vagrant up && vagrant ssh

Within that setup:

sudo apt-get install git
# dependencies per README
sudo apt-get install socat ipmitool qemu openipmi python-pip libssl-dev libssh-dev libpython-dev libffi-dev sgabios
# try starting with virtualenv
sudo apt-get install python-virtualenv

git clone https://github.com/infrasim/infrasim-compute
cd infrasim-compute
virtualenv .venv
source .venv/bin/activate
pip install -r requirements.txt

And from here I wasn't sure - when I tried nosetests test/unit I had some passes, and some failures. Does the development/test setup expect code to be in slightly different positions, or something additionally installed or running?

Would you recommend a different path to set up for basic development?

Wrong hint message

when I ran
sudo infrasim config add node1 ~/node1.yml
it will show hints

Node node1's configuration already in InfraSIM mapping.
If you want to update the configuration, please run this command:
    infrasim **node** update node1 /home/infrasim/node1.yml

But it's wrong.
it should provide hint which
infrasim **config** update node1 /home/infrasim/node1.yml

it should be config instead of node

CentOS installation failure on InfraSIM 3.x - S2600KP/Dell R630

with InfraSIM 3.x, using RackHD, I only install CentOS successfully on Quanta D51/T41.
But both failed on S2600KP & R630, with neither mini payload or full payload.
the failure is :
when OS Installed and system reboot, after 5 sec countdown, the OS will stuck and never go to the user/passwd login promt. then seems InfraSIM node can't be restarted

sudo infrasim node restart node2
sh: 0: getcwd() failed: No such file or directory
[        ] node2-node is stopped
[ 28009  ] node2-bmc stop
[ 27996  ] node2-socat stop
[ 28186  ] node2-socat starts to run
[ 28193  ] node2-bmc starts to run

[ ERROR ] node2-node fail to start
Infrasim service started.
Node node2 graphic interface accessible via:
VNC port: 5901
Either host IP: ['127.0.0.1', '172.31.128.2']
depending on host in which network VNC viewer is running
jenkins@infrasim:~/workspace/All_In_ONE/RackHD/test$
jenkins@infrasim:~/workspace/All_In_ONE/RackHD/test$
jenkins@infrasim:~/workspace/All_In_ONE/RackHD/test$
jenkins@infrasim:~/workspace/All_In_ONE/RackHD/test$ sudo infrasim node status node2
sh: 0: getcwd() failed: No such file or directory
[ 28186  ] node2-socat is running
[ 28193  ] node2-bmc is running
node2-node is stopped

Folders like /usr/local/lib/ and /usr/local/etc/infrasim/lib are removed which is breaking infrasim-init

  1. CommandRunFailed not imported in infrasim-init

  2. Are steps below still required?

    run_command("cp /usr/local/etc/infrasim/lib/* /usr/local/lib/", True, None, None)
    run_command("cd /usr/local/lib && ln -sf libIPMIlanserv.so.0.0.1 liblibIPMIlanserv.so.0")
    run_command("cd /usr/local/lib && ln -sf libIPMIlanserv.so.0.0.1 liblibIPMIlanserv.so")
    run_command("cd /usr/local/lib && ln -sf libOpenIPMIposix.so.0.0.1 libOpenIPMIposix.so.0")
    run_command("cd /usr/local/lib && ln -sf libOpenIPMIposix.so.0.0.1 libOpenIPMIposix.so")
    run_command("cd /usr/local/lib && ln -sf libOpenIPMIutils.so.0.0.1 libOpenIPMIutils.so.0")
    run_command("cd /usr/local/lib && ln -sf libOpenIPMIutils.so.0.0.1 libOpenIPMIutils.so")

VNC port is user configurable?

Is there a stanza I can place in infrasim.yml to configure/de-configure VNC? Starting infrasim compute and I'm not seeing VNC listening on 5901. :(

Ansible playbook help

See below message from help, actually there are 5 commands "node,chassis,config,init,version", why only "init" and "version" have explanation?

$ ansible-playbook -i inventory_example site.yml -t help

PLAY [Install InfraSIM] ********************************************************

TASK [setup] *******************************************************************
ok: [192.168.129.187]

PLAY [Manipulate InfraSIM] *****************************************************

TASK [setup] *******************************************************************
ok: [192.168.129.187]

TASK [commoncmd : Show infrasim CLI help] **************************************
changed: [192.168.129.187]

TASK [commoncmd : debug] *******************************************************
ok: [192.168.129.187] => (item=out.stdout_lines) => {
"item": "out.stdout_lines",
"out.stdout_lines": [
"usage: infrasim [-h] {node,chassis,config,init,version} ...",
"",
"optional arguments:",
" -h, --help show this help message and exit",
"",
"InfraSIM Commands::",
" {node,chassis,config,init,version}",
" init init infrasim environment",
" version check version of infrasim and dependencies"
]
}

License file?

Hi there. Wondering what the license for this repo is. Thanks!

Issues with infrasim-init this morning

~/deb ~ /tmp/src/infrasim-compute
dpkg-deb: error: 'qemu.deb' is not a debian format archive
dpkg: error processing archive qemu.deb (--install):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 qemu.deb
dpkg-deb: error: 'openipmi.deb' is not a debian format archive
dpkg: error processing archive openipmi.deb (--install):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 openipmi.deb

On Ubuntu 16.04.1 running from clone of master branch.

Cannot create more than one storage controller in yml config

I am debugging an issue with @mtannous
We are trying to make a yml configuration that contains the following:

compute:
    boot_order: ncd,reboot-timeout=10000
    cpu:
        quantities: 2
        type: Haswell

    memory:
        size: 1024

    storage_backend:
        #Set drive list and define drive attributes
        -
            controller:
                type: ahci
                max_drive_per_controller: 8
                drives:                
                -
                    size: 100
                -
                    size: 100
                -
                    size: 100
                -
                    size: 100
                -
                    size: 100
                -
                    size: 100
        -
            controller:
                type: ahci
                max_drive_per_controller: 8
                drives:
                -
                    size: 100

With that in the configuration, infrasim node start fails. When we take out the second controller block, we have no issues. It looks like the current implementation does not support multiple controller blocks.

We dug through the source code and found this line, where the drives within the controller are parsed. It looks like it would be possible to parse multiple controllers here by wrapping it around another for loop.

for drive_info in self.__controller_info['controller']['drives']:

infrasim reboot never stop

i want run RackHD , docker-compose install infrasim:cd infrasim , docker-compose up -d。
but vnc connect ,find infrasim always reboot。
can you help me.?

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.