Operation System: Ubuntu 20.04 in WSL2 on win11 pro
OpenStack version: Yoga
Hardware : 4 cores, 24GB memory, 250GB disk
all component work and healthy
create server with openstack server create --image cirrors test, that always get ERROR instance status, snip logs:
2022-07-13 15:08:01.406 6 INFO nova.compute.manager [req-536a44d6-fab0-4ea9-9b87-8c3c245dcfdf 269860065881439faa4bcdbfb4dd574d 0fafc85310b8499a90483db239a4b5cf - default default] [instance: 32***1d] Took 0.08 seconds to destroy the instance on the hypervisor.
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [req-536a44d6-fab0-4ea9-9b87-8c3c245dcfdf 269860065881439faa4bcdbfb4dd574d 0fafc85310b8499a90483db239a4b5cf - default default] [instance: 32***1d] Failed to allocate network(s): nova.exception.VirtualInterfaceCreateException: Virtual Interface creation failed
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] Traceback (most recent call last):
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] File "/var/lib/kolla/venv/lib/python3.8/site-packages/nova/virt/libvirt/driver.py", line 7499, in _create_guest_with_network
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] guest = self._create_guest(
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] File "/usr/lib/python3.8/contextlib.py", line 120, in __exit__
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] next(self.gen)
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] File "/var/lib/kolla/venv/lib/python3.8/site-packages/nova/compute/manager.py", line 557, in wait_for_instance_event
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] self._wait_for_instance_events(
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] File "/var/lib/kolla/venv/lib/python3.8/site-packages/nova/compute/manager.py", line 469, in _wait_for_instance_events
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] actual_event = event.wait()
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] File "/var/lib/kolla/venv/lib/python3.8/site-packages/nova/compute/manager.py", line 434, in wait
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] instance_event = self.event.wait()
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] File "/var/lib/kolla/venv/lib/python3.8/site-packages/eventlet/event.py", line 125, in wait
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] result = hub.switch()
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] File "/var/lib/kolla/venv/lib/python3.8/site-packages/eventlet/hubs/hub.py", line 313, in switch
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] return self.greenlet.switch()
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] eventlet.timeout.Timeout: 300 seconds
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d]
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] During handling of the above exception, another exception occurred:
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d]
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] Traceback (most recent call last):
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] File "/var/lib/kolla/venv/lib/python3.8/site-packages/nova/compute/manager.py", line 2489, in _build_and_run_instance
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] self.driver.spawn(context, instance, image_meta,
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] File "/var/lib/kolla/venv/lib/python3.8/site-packages/nova/virt/libvirt/driver.py", line 4333, in spawn
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] self._create_guest_with_network(
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] File "/var/lib/kolla/venv/lib/python3.8/site-packages/nova/virt/libvirt/driver.py", line 7517, in _create_guest_with_network
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] raise exception.VirtualInterfaceCreateException()
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d] nova.exception.VirtualInterfaceCreateException: Virtual Interface creation failed
2022-07-13 15:08:01.576 6 ERROR nova.compute.manager [instance: 32***1d]
2022-07-13 15:08:01.587 6 ERROR nova.compute.manager [req-536a44d6-fab0-4ea9-9b87-8c3c245dcfdf 269860065881439faa4bcdbfb4dd574d 0fafc85310b8499a90483db239a4b5cf - default default] [instance: 32***1d] Build of instance 32***1d aborted: Failed to allocate the network(s), not rescheduling.: nova.exception.BuildAbortException: Build of instance 32***1d aborted: Failed to allocate the network(s), not rescheduling.
2022-07-13 15:08:01.589 6 INFO os_vif [req-536a44d6-fab0-4ea9-9b87-8c3c245dcfdf 269860065881439faa4bcdbfb4dd574d 0fafc85310b8499a90483db239a4b5cf - default default] Successfully unplugged vif VIFBridge(active=False,address=fa:16:3e:cb:ee:68,bridge_name='brqa4af79db-4c',has_traffic_filtering=True,id=d636427c-998f-42f3-986b-b32a5fcde06d,network=Network(a4af79db-4c64-4b8e-8747-27e38f1296db),plugin='linux_bridge',port_profile=<?>,preserve_on_delete=False,vif_name='tapd636427c-99')
2022-07-13 15:08:02.375 6 INFO nova.compute.manager [req-536a44d6-fab0-4ea9-9b87-8c3c245dcfdf 269860065881439faa4bcdbfb4dd574d 0fafc85310b8499a90483db239a4b5cf - default default] [instance: 32***1d] Took 0.79 seconds to deallocate network for instance.
But while use port create and server create without port(openstack server create --image cirrors --flavor 4C2G --os-compute-api-version 2.90 --nic none test) independently, then exec server add port attach the port to the instance, the network interface in instance works and could be connected by that port's IP, although port list show the port always DOWN status.
Question:
1, what's wrong with the nova-compute while create server?
2, how could I solve this problem VirtualInterfaceCreateException?
I tried to install MQSeries 1.34 from CPAN, and I was getting an error, which I found a fix for on the CPAN bug tracking website. So I applied the fix and still got a few test errors, but the build seemed okay. Installing it with a force install MQSeries worked. Once I had installed it, I can construct objects and reference the libraries in my other perl scripts, but when I try to connect to the queue manager or queue, I get an error back.
Any advice on what is wrong with the setup or how to fix this and get my connection back up and running would be much appreciated.
Here are specifics about my configuration:
$ uname -srvpio
Linux 2.6.32-573.22.1.el6.x86_64 #1 SMP Thu Mar 17 03:23:39 EDT 2016 x86_64 x86_64 GNU/Linux
$ /opt/mqm/bin/dspmqsver
Name: WebSphere MQ Advanced Message Security
Version: 7.5.0.0
Level: p000-L120604
BuildType: IKAP - (Production)
$ rpm -qa |grep 'MQ' |sort
MQSeriesAMS-7.5.0-0.x86_64
MQSeriesClient-7.5.0-0.x86_64
MQSeriesExplorer-7.5.0-0.x86_64
MQSeriesFTAgent-7.5.0-0.x86_64
MQSeriesFTBase-7.5.0-0.x86_64
MQSeriesFTLogger-7.5.0-0.x86_64
MQSeriesFTService-7.5.0-0.x86_64
MQSeriesFTTools-7.5.0-0.x86_64
MQSeriesGSKit-7.5.0-0.x86_64
MQSeriesJava-7.5.0-0.x86_64
MQSeriesJRE-7.5.0-0.x86_64
MQSeriesMan-7.5.0-0.x86_64
MQSeriesMsg_cs-7.5.0-0.x86_64
MQSeriesMsg_de-7.5.0-0.x86_64
MQSeriesMsg_es-7.5.0-0.x86_64
MQSeriesMsg_fr-7.5.0-0.x86_64
MQSeriesMsg_hu-7.5.0-0.x86_64
MQSeriesMsg_it-7.5.0-0.x86_64
MQSeriesMsg_ja-7.5.0-0.x86_64
MQSeriesMsg_ko-7.5.0-0.x86_64
MQSeriesMsg_pl-7.5.0-0.x86_64
MQSeriesMsg_pt-7.5.0-0.x86_64
MQSeriesMsg_ru-7.5.0-0.x86_64
MQSeriesMsg_Zh_CN-7.5.0-0.x86_64
MQSeriesMsg_Zh_TW-7.5.0-0.x86_64
MQSeriesRuntime-7.5.0-0.x86_64
MQSeriesSamples-7.5.0-0.x86_64
MQSeriesSDK-7.5.0-0.x86_64
MQSeriesServer-7.5.0-0.x86_64
MQSeriesXRClients-7.5.0-0.x86_64
MQSeriesXRService-7.5.0-0.x86_64
$ ./dispModVersion.pl MQSeries
Module Installed CPAN
MQSeries 1.34 1.34
$ perl -v
This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux
Copyright 1987-2015, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.
$ perl -V
Summary of my perl5 (revision 5 version 22 subversion 1) configuration:
Platform:
osname=linux, osvers=2.6.32-573.22.1.el6.x86_64, archname=x86_64-linux
uname='linux ******* 2.6.32-573.22.1.el6.x86_64 #1 smp thu mar 17 03:23:39 edt 2016 x86_64 x86_64 x86_64 gnulinux '
config_args='-des -Dprefix=******'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2',
optimize='-O2',
cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.4.7 20120313 (Red Hat 4.4.7-16)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64
libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=libc-2.12.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.12'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES
USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO
USE_PERL_ATOF
Built under linux
Compiled at Apr 18 2016 15:46:59
%ENV:
PERL5BIN="*******/bin"
PERL5HOME="*******"
PERL5SITE="*******/lib/site_perl/5.22.1"
#INC:
*******/lib/site_perl/5.22.1/x86_64-linux
*******/lib/site_perl/5.22.1
*******/lib/5.22.1/x86_64-linux
*******/lib/5.22.1
When I first tried to install MQSeries, I got the following error:
t/99-pod.t .. 2/63
# Failed test 'POD test for MQSeries/Message/IIH.pm'
# at Test/Pod.pm line 187.
# MQSeries/Message/IIH.pm (415): Non-ASCII character seen before =encoding in 'Villagâ–’mez'. Assuming CP1252
# Looks like you failed 1 test of 63.
t/99-pod.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/63 subtests
Test Summary Report
-------------------
t/99-pod.t (Wstat: 256 Tests: 63 Failed: 1)
Failed test: 61
Non-zero exit status: 1
Files=1, Tests=63, 1 wallclock secs ( 0.02 usr 0.01 sys + 0.34 cusr 0.00 csys = 0.37 CPU)
Result: FAIL
Failed 1/1 test programs. 1/63 subtests failed.
Then, I modified the file MQSeries/Message/IIH.pm to add =encoding ISO-8859-1 at the start of the file, per bug report on CPAN, I ran the install again and got the following:
t/99-pod.t .. ok
All tests successful.
Files=1, Tests=63, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.34 cusr 0.01 csys = 0.39 CPU)
Result: PASS
make[1]: Entering directory `build/MQSeries-1.34-SLJq6K/MQClient'
PERL_DL_NONLAZY=1 "perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, '../blib/lib', '../blib/arch')" t/*.t
t/10constants.t ........... ok
t/20convert.t ............. Failed 5/6 subtests
t/30basic.t ............... ok
t/31properties.t .......... ok
t/32async_put.t ........... ok
t/40oo-qmgr.t ............. 3/14 MQCONN failed (Reason = 2059) (Queue manager not available for connection.) at t/40oo-qmgr.t line 38.
# Failed test 'MQSeries::QueueManager - constructor'
# at t/40oo-qmgr.t line 39.
t/40oo-qmgr.t ............. 5/14 MQCONN failed (Reason = 2059) (Queue manager not available for connection.) at t/40oo-qmgr.t line 52.
# Failed test 'MQSeries::QueueManager - Connect'
# at t/40oo-qmgr.t line 58.
t/40oo-qmgr.t ............. 7/14 MQCONN failed (Reason = 2059) (Queue manager not available for connection.) at t/40oo-qmgr.t line 73.
# Failed test 'MQSeries::QueueManager - constructor'
# at t/40oo-qmgr.t line 74.
Can't call method "Open" on an undefined value at t/40oo-qmgr.t line 77.
# Looks like you planned 14 tests but ran 7.
# Looks like you failed 3 tests of 7 run.
# Looks like your test exited with 13 just after 7.
t/40oo-qmgr.t ............. Dubious, test returned 13 (wstat 3328, 0xd00)
Failed 10/14 subtests
t/50oo-command.t .......... ok
t/51oo-command-changes.t .. ok
t/52oo-command-filter.t ... ok
t/60-logs.t ............... ok
t/70-config.t ............. ok
Test Summary Report
-------------------
t/20convert.t (Wstat: 0 Tests: 2 Failed: 1)
Failed test: 2
Parse errors: Bad plan. You planned 6 tests but ran 2.
t/40oo-qmgr.t (Wstat: 3328 Tests: 7 Failed: 3)
Failed tests: 3, 5, 7
Non-zero exit status: 13
Parse errors: Bad plan. You planned 14 tests but ran 7.
Files=11, Tests=5334, 1264 wallclock secs ( 0.96 usr 0.02 sys + 1.56 cusr 0.18 csys = 2.72 CPU)
Result: FAIL
Failed 2/11 test programs. 4/5334 subtests failed.
If I force the install, I can get it to finish the install after everything is said and done, but then I get the following error when trying to connect:
MQCONN failed (Reason = 2059) (Queue manager not available for connection.) at testMQConnectivity.pl line 16.
MQCONN failed (Reason = 2059) (Queue manager not available for connection.) at testMQConnectivity.pl line 16.
at MQSeries/QueueManager.pm line 809.
MQSeries::QueueManager::Connect(MQSeries::QueueManager=HASH(0x24a7180)) called at MQSeries/QueueManager.pm line 155
MQSeries::QueueManager::new(undef, "QueueManager", "*******", "Reason", SCALAR(0x151d4f0), "CompCode", SCALAR(0x151d610), "ClientConn", ...) called at testMQConnectivity.pl line 16
I edited the CONFIG file after pulling the data from CPAN to reference my remote MQ Queues that I can connect to using /opt/mqm/samp/bin/amqsputc or /opt/mqm/samp/bin/amqsgetc, after setting export MQSERVER=..., if I run make test TEST_VERBOSE=1 from the working CPAN directory, I see the following output:
t/20convert.t:
t/20convert.t .............
1..6
ok 1
ok 2
ok 3
ok 4
MQGET failed: CompCode => 2, Reason => 2033
not ok 5
Message conversion failed.
Should be: 'This msg is in EBCDIC'
Is: ''
not ok 6
Failed 2/6 subtests
t/31properties.t:
t/31properties.t ..........
1..22
ok 1 - use MQClient::MQSeries;
Connecting to queue manager '*******' (MQCONN)
ok 2 - MQCONN
Opening queue manager for inquire
ok 3 - MQOPEN - queue manager
Querying queue manager attributes (MQINQ)
ok 4 - MQINQ
Closing queue manager object handle (MQCLOSE)
ok 5 - MQCLOSE - queue manager
Create message handle object (MQCRTMH)
ok 6 - MQCRTMH
Set message property (MQSETMP - string)
ok 7 - MQSETMP - string
Set message property (MQSETMP - float)
ok 8 - MQSETMP - float
Set message property (MQSETMP - int)
ok 9 - MQSETMP - int
Inquire message property (MQINQMP - float)
ok 10 - MQINQMP - float
ok 11 - MQINQMP - float value okay (3.14164996147156)
Delete float property
ok 12 - MQDLTMP - float
Opening queue '*******' (MQOPEN)
ok 13 - MQOPEN - queue
Putting message with properties (MQPUT)
ok 14 - MQPUT
Create message handle object (MQCRTMH #2)
ok 15 - MQCRTMH \#2
Getting message (MQGET)
not ok 16 - MQGET
# Failed test 'MQGET'
# at t/31properties.t line 146.
Inquire message property (MQINQMP - int)
not ok 17 - MQINQMP - int
# Failed test 'MQINQMP - int'
# at t/31properties.t line 156.
Use of uninitialized value $prop in concatenation (.) or string at t/31properties.t line 157.
not ok 18 - MQINQMP - int value okay ()
# Failed test 'MQINQMP - int value okay ()'
# at t/31properties.t line 157.
# got: undef
# expected: '42'
Delete message handle (MQDLTMH)
ok 19 - MQDLTMH
Delete message handle (MQDLTMH #2)
ok 20 - MQDLTMH \#2
Closing queue (MQCLOSE)
ok 21 - MQCLOSE
Disconnecting (MQDISC)
ok 22 - MQDISC
# Looks like you failed 3 tests of 22.
Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/22 subtests
t/32async_put.t:
t/32async_put.t ...........
1..25
ok 1 - use MQClient::MQSeries;
Connecting to queue manager '*******' (MQCONN)
ok 2 - MQCONN
Opening queue manager for inquire
ok 3 - MQOPEN - queue manager
Querying queue manager attributes (MQINQ)
MQINQ returned: CompCode => 0, Reason => 0
ok 4 - MQINQ
Closing queue manager object handle (MQCLOSE)
ok 5 - MQCLOSE - queue manager
Opening queue '*******' (MQOPEN)
ok 6 - MQOPEN - queue
Putting message #1 (async MQPUT)
ok 7 - MQPUT - 1
Putting message #2 (async MQPUT)
ok 8 - MQPUT - 2
Putting message #3 (async MQPUT)
ok 9 - MQPUT - 3
Putting message #4 (async MQPUT)
ok 10 - MQPUT - 4
Putting message #5 (async MQPUT)
ok 11 - MQPUT - 5
Getting status info (MQSTAT)
ok 12 - MQSTAT
not ok 13 - MQSTAT result
# Failed test 'MQSTAT result'
# at t/32async_put.t line 120.
# Structures begin differing at:
# $got->{PutSuccessCount} = '5'
# $expected->{PutSuccessCount} = '0'
Getting message #1 (MQGET)
ok 14 - MQGET - 1
ok 15 - MQGET message content - 1
Getting message #2 (MQGET)
ok 16 - MQGET - 2
ok 17 - MQGET message content - 2
Getting message #3 (MQGET)
ok 18 - MQGET - 3
ok 19 - MQGET message content - 3
Getting message #4 (MQGET)
ok 20 - MQGET - 4
ok 21 - MQGET message content - 4
Getting message #5 (MQGET)
ok 22 - MQGET - 5
ok 23 - MQGET message content - 5
Closing queue (MQCLOSE)
ok 24 - MQCLOSE
Disconnecting (MQDISC)
ok 25 - MQDISC
# Looks like you failed 1 test of 25.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/25 subtests
And t/40oo-qmgr.t, which was previously failing now executes successfully:
t/40oo-qmgr.t:
t/40oo-qmgr.t .............
1..14
ok 1 - use MQClient::MQSeries;
ok 2 - use MQSeries::QueueManager;
ok 3 - MQSeries::QueueManager - constructor
ok 4 - MQSeries::QueueManager - constructor - AutoConnect=0
ok 5 - MQSeries::QueueManager - Connect
ok 6 - MQSeries::QueueManager - Disconnect
ok 7 - MQSeries::QueueManager - constructor
ok 8 - MQSeries::QueueManager - Open
ok 9 - MQSeries::QueueManager - Inquire
ok 10 - MQSeries::QueueManager - Inquire - Platform
ok 11 - MQSeries::QueueManager - Inquire - CodedCharSetId
ok 12 - MQSeries::QueueManager - Inquire - CommandLevel
ok 13 - MQSeries::QueueManager - Inquire - DeadLetterQName
ok 14 - MQSeries::QueueManager - Close
ok
Yielding the final results:
Test Summary Report
-------------------
t/20convert.t (Wstat: 0 Tests: 6 Failed: 2)
Failed tests: 5-6
t/31properties.t (Wstat: 768 Tests: 22 Failed: 3)
Failed tests: 16-18
Non-zero exit status: 3
t/32async_put.t (Wstat: 256 Tests: 25 Failed: 1)
Failed test: 13
Non-zero exit status: 1
Files=11, Tests=5345, 183 wallclock secs ( 1.02 usr 0.08 sys + 1.48 cusr 0.18 csys = 2.76 CPU)
Result: FAIL
Failed 3/11 test programs. 6/5345 subtests failed.
Any ideas on how to get this resolved and get the package up and running?
If I run /opt/mqm/samp/bin/amqsputc or /opt/mqm/samp/bin/amqsgetc, I can connect to the same host, port, channel, queue manager, and queue from this host.
Thanks!
I have a following coupled, first order differential equations:
dB(t)/dt=-a*A(t);
dA(t)/dt=b*B(t);
dJ(t)/dt=cA(t)-dB(t)
Solve the system using paramenters a = 0.05, b = 0.02, c = 0.03 and d = 0.04 of your own choice over a time interval from 0 to 200.
Here is my code:
a=0.05
b=0.02
c=0.03
d=0.04
def function(x,t):
x1, x2, x3 = x[0], x[1], x[2]
#x1, x2, x3 = A, B, J
dx1=b*x1
dx2=-a*x0
dx3=c*x0-d*x1
return [dx1, dx2, dx3]
x0 = [100,100, 1]
t = linspace(0, 200, 200)
x = odeint(function, x0, t)
The output I got is:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-f8f398346307> in function(x, t)
8 #x1, x2, x3 = A, B, J
9 dx1=b*x1
---> 10 dx2=-a*x0
11 dx3=c*x0-d*x1
12 return [dx1, dx2, dx3]
TypeError: can't multiply sequence by non-int of type 'float'
Repeated convergence failures (perhaps bad Jacobian or tolerances).
Run with full_output = 1 to get quantitative information.
what is the problem of my code?
You have three first-order equations, not second order. (Or did you mean to write second order derivatives in your equations 1, 2, and 3?)
deriv should return the three values dA/dt, dB/dt and dJ/dt, but currently it returns an array of length 5.
zinit should contain three values: A(0), B(0) and J(0).
I think i have fixed it.
a=0.05
b=0.02
c=0.03
d=0.04
def function(x,t):
x1, x2, x3 = x[0], x[1], x[2]
#x1, x2, x3 = A, B, J
dx1=b*x2
dx2=-a*x1
dx3=c*x1-d*x2
return [dx1, dx2, dx3]
x0 = [100,100, 1]
t = linspace(0, 200, 200)
x = odeint(function, x0, t)