Difference between revisions of "SimEngine"

From AN!Wiki
Jump to: navigation, search
(Building)
 
Line 7: Line 7:
  
 
= Building =
 
= Building =
 +
 +
EL 7 dependencies;
 +
 +
<syntaxhighlight lang="bash">
 +
yum install rpmdevtools python-devel python-setuptools python2-sphinx
 +
</syntaxhighlight>
 +
  
 
== neo4j ==
 
== neo4j ==

Latest revision as of 13:59, 13 August 2019

 AN!Wiki :: SimEngine

Key links;

Contents

[edit] Building

EL 7 dependencies;

yum install rpmdevtools python-devel python-setuptools python2-sphinx


[edit] neo4j

For now, neo4j needs to be installed from source.

Setup the repo;

cd /tmp
wget http://debian.neo4j.org/neotechnology.gpg.key
rpm --import neotechnology.gpg.key

Add the repo;

cat <<EOF>  /etc/yum.repos.d/neo4j.repo
[neo4j]
name=Neo4j Yum Repo
baseurl=http://yum.neo4j.org/stable
enabled=1
gpgcheck=1
EOF

Install;

dnf install neo4j

[edit] Github

Clone:

cd ~/anvil
git clone git@github.com:Seneca-CDOT/simengine.git
cd ~/anvil/simengine

or

cd ~/anvil/simengine
git pull

[edit] RPMs

cd ~/anvil/simengine/rpm/specfiles/
sudo ./buildall
dnf install /home/digimer/rpmbuild/RPMS/noarch/simengine-database-3.24-1.fc29.noarch.rpm \
            /home/digimer/rpmbuild/RPMS/noarch/python2-snmpsim-0.4.4-2.fc29.noarch.rpm \
            /home/digimer/rpmbuild/RPMS/noarch/python3-circuits-3.2-2.fc29.noarch.rpm \
            /home/digimer/rpmbuild/RPMS/noarch/python-snmpsim-doc-0.4.4-2.fc29.noarch.rpm \
            /home/digimer/rpmbuild/RPMS/x86_64/simengine-* \
            /home/digimer/rpmbuild/RPMS/x86_64/python3-neo4j-driver-1.6.1-2.fc29.x86_64.rpm

[edit] Configure

Edit each VM's definition. Exactly how depends on the target.

[edit] Foundation Pack

Device IPs;

ups01	ups	SNMP → reachable at 192.168.122.3
ups02	ups	SNMP → reachable at 192.168.122.4
pdu01	pdu	SNMP → reachable at 192.168.122.5
pdu02	pdu	SNMP → reachable at 192.168.122.6

Add these to the host machine;

ip addr add dev ifn_bridge1 192.168.122.3/24 # UPS 1
ip addr add dev ifn_bridge1 192.168.122.4/24 # UPS 2
ip addr add dev ifn_bridge1 192.168.122.5/24 # PDU 1
ip addr add dev ifn_bridge1 192.168.122.6/24 # PDU 2

[edit] Update VM Definitions

NOTE: You can dumpxml, edit the dumped file, and define to get the same effect programmatically.

Edit the VM's XML;

virsh edit an-a03n01

Change;

<domain type='kvm'>

to:

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>

then append after </devices>;

  <qemu:commandline>
    <qemu:arg value='-chardev'/>
    <qemu:arg value='socket,id=ipmi0,host=localhost,port=9002,reconnect=10'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='ipmi-bmc-extern,id=bmc0,chardev=ipmi0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='isa-ipmi-bt,bmc=bmc0'/>
    <qemu:arg value='-serial'/>
    <qemu:arg value='mon:tcp::9012,server,telnet,nowait'/>
    <qemu:arg value='-chardev'/>
    <qemu:arg value='socket,id=simengine-storage-tcp,host=localhost,port=50000,reconnect=2'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-serial'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtserialport,chardev=simengine-storage-tcp,name=systems.cdot.simengine.storage.net'/>
  </qemu:commandline>

Now Node 2;

virsh edit an-a03n02

Change;

<domain type='kvm'>

to:

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>

then append after </devices>;

  <qemu:commandline>
    <qemu:arg value='-chardev'/>
    <qemu:arg value='socket,id=ipmi0,host=localhost,port=9102,reconnect=10'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='ipmi-bmc-extern,id=bmc0,chardev=ipmi0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='isa-ipmi-bt,bmc=bmc0'/>
    <qemu:arg value='-serial'/>
    <qemu:arg value='mon:tcp::9013,server,telnet,nowait'/>
    <qemu:arg value='-chardev'/>
    <qemu:arg value='socket,id=simengine-storage-tcp,host=localhost,port=50001,reconnect=2'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-serial'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtserialport,chardev=simengine-storage-tcp,name=systems.cdot.simengine.storage.net'/>
  </qemu:commandline>

[edit] Setup System Model

Fresh start;

simengine-cli model drop

Pick up new mode;

systemctl stop simengine-core
# Create 2 outlets, one powers 'an-ups01' another one powers 'an-ups02'
simengine-cli model create outlet --asset-key=1 -x=-861 -y=-171
simengine-cli model create outlet -k2 -x=-861 -y=351
 
# Add 2 UPSs
simengine-cli model create ups -k=3 --name=an-ups01 --host=192.168.122.3 --port=161 -x=-895 -y=-182
simengine-cli model create ups -k=4 --name=an-ups02 --host=192.168.122.4 --port=161 -x=-895 -y=347
 
# Create 2 PDUs
simengine-cli model create pdu -k=5 -n=an-pdu01 --host=192.168.122.5 --port=161 -x=-36 -y=-161
simengine-cli model create pdu -k=6 -n=an-pdu02 --host=192.168.122.6 --port=161 -x=-36 -y=567
 
# Add 2 Servers
simengine-cli model create server-bmc -k=7 --domain-name=an-a03n01 --power-consumption=360 -x=-162 -y=320
simengine-cli model create server-bmc -k=8 --domain-name=an-a03n02 --power-consumption=360 --port=9101 --vmport=9102 --storcli-port=50001 -x=-171 -y=86
 
# Add 2 Striker Servers
simengine-cli model create server -k=9 --domain-name=an-striker01 --power-consumption=240 --psu-num=1 -x=738 -y=101
simengine-cli model create server -k=10 --domain-name=an-striker02 --power-consumption=240 --psu-num=1 -x=734 -y=326
 
### Power Components
# connect outlets & UPSs
simengine-cli model power-link -s1 -d3   # {_Mains_}==>[an-ups01]
simengine-cli model power-link -s2 -d4   # {_Mains_}==>[an-ups02]
 
# connect ups & pdus
simengine-cli model power-link -s31 -d5  # [an-ups01]==>[an-pdu01]
simengine-cli model power-link -s41 -d6  # [an-ups02]==>[an-pdu02]
 
# Power up servers
simengine-cli model power-link -s51 -d72 # [an-pdu01]={port-1}=>{psu-2}=>[an-a03n01]
simengine-cli model power-link -s52 -d82 # [an-pdu01]={port-2}=>{psu-2}=>[an-a03n02]
 
simengine-cli model power-link -s61 -d71 # [an-pdu02]={port-1}=>{psu-1}=>[an-a03n01]
simengine-cli model power-link -s62 -d81 # [an-pdu02]={port-2}=>{psu-1}=>[an-a03n02]
 
# Power Up Striker Servers
simengine-cli model power-link -s58 -d91 # [an-pdu01]={port-1}=>{psu-2}=>[an-a03n01]
simengine-cli model power-link -s68 -d101 # [an-pdu02]={port-1}=>{psu-1}=>[an-a03n01]

Start again;

systemctl start simengine-core



 

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Us: Alteeve's Niche! Support: Mailing List IRC: #clusterlabs on Freenode   © Alteeve's Niche! Inc. 1997-2018
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.
Personal tools
Namespaces

Variants
Actions
Navigation
projects
Toolbox