4 # Copyright 2016 RIFT.IO Inc
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
30 from rift
.rwlib
.util
import certs
31 import rift
.rwcal
.cloudsim
32 import rift
.rwcal
.cloudsim
.net
34 import rift
.vcs
.core
as core
38 import rift
.rwcal
.cloudsim
39 import rift
.rwcal
.cloudsim
.net
41 from rift
.vcs
.ext
import ClassProperty
44 logger
= logging
.getLogger(__name__
)
46 IDP_PORT_NUMBER
= "8009"
48 def get_launchpad_address():
49 # Search for externally accessible IP address with netifaces
50 gateways
= netifaces
.gateways()
51 # Check for default route facing interface and then get its ip address
52 if 'default' in gateways
:
53 interface
= gateways
['default'][netifaces
.AF_INET
][1]
54 launchpad_ip_address
= netifaces
.ifaddresses(interface
)[netifaces
.AF_INET
][0]['addr']
56 # no default gateway. Revert to 127.0.0.1
57 launchpad_ip_address
= "127.0.0.1"
59 return launchpad_ip_address
61 class NsmTasklet(rift
.vcs
.core
.Tasklet
):
63 This class represents a network services manager tasklet.
66 def __init__(self
, name
='network-services-manager', uid
=None,
68 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
69 data_storetype
=core
.DataStore
.NOSTORE
.value
,
70 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
73 Creates a NsmTasklet object.
76 name - the name of the tasklet
77 uid - a unique identifier
79 super(NsmTasklet
, self
).__init
__(name
=name
, uid
=uid
,
80 config_ready
=config_ready
,
81 recovery_action
=recovery_action
,
82 data_storetype
=data_storetype
,
83 ha_startup_mode
=ha_startup_mode
,
86 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwnsmtasklet')
87 plugin_name
= ClassProperty('rwnsmtasklet')
90 class VnsTasklet(rift
.vcs
.core
.Tasklet
):
92 This class represents a network services manager tasklet.
95 def __init__(self
, name
='virtual-network-service', uid
=None,
97 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
98 data_storetype
=core
.DataStore
.NOSTORE
.value
,
99 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
102 Creates a VnsTasklet object.
105 name - the name of the tasklet
106 uid - a unique identifier
108 super(VnsTasklet
, self
).__init
__(name
=name
, uid
=uid
,
109 config_ready
=config_ready
,
110 recovery_action
=recovery_action
,
111 data_storetype
=data_storetype
,
112 ha_startup_mode
=ha_startup_mode
,
115 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwvnstasklet')
116 plugin_name
= ClassProperty('rwvnstasklet')
119 class VnfmTasklet(rift
.vcs
.core
.Tasklet
):
121 This class represents a virtual network function manager tasklet.
124 def __init__(self
, name
='virtual-network-function-manager', uid
=None,
126 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
127 data_storetype
=core
.DataStore
.NOSTORE
.value
,
128 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
131 Creates a VnfmTasklet object.
134 name - the name of the tasklet
135 uid - a unique identifier
137 super(VnfmTasklet
, self
).__init
__(name
=name
, uid
=uid
,
138 config_ready
=config_ready
,
139 recovery_action
=recovery_action
,
140 data_storetype
=data_storetype
,
141 ha_startup_mode
=ha_startup_mode
,
144 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwvnfmtasklet')
145 plugin_name
= ClassProperty('rwvnfmtasklet')
148 class ResMgrTasklet(rift
.vcs
.core
.Tasklet
):
150 This class represents a Resource Manager tasklet.
153 def __init__(self
, name
='Resource-Manager', uid
=None,
155 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
156 data_storetype
=core
.DataStore
.NOSTORE
.value
,
157 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
160 Creates a ResMgrTasklet object.
163 name - the name of the tasklet
164 uid - a unique identifier
166 super(ResMgrTasklet
, self
).__init
__(name
=name
, uid
=uid
,
167 config_ready
=config_ready
,
168 recovery_action
=recovery_action
,
169 data_storetype
=data_storetype
,
170 ha_startup_mode
=ha_startup_mode
,
173 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwresmgrtasklet')
174 plugin_name
= ClassProperty('rwresmgrtasklet')
177 class ImageMgrTasklet(rift
.vcs
.core
.Tasklet
):
179 This class represents a Image Manager tasklet.
182 def __init__(self
, name
='Image-Manager', uid
=None,
184 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
185 data_storetype
=core
.DataStore
.NOSTORE
.value
,
186 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
189 Creates a Image Manager Tasklet object.
192 name - the name of the tasklet
193 uid - a unique identifier
195 super(ImageMgrTasklet
, self
).__init
__(
197 config_ready
=config_ready
,
198 recovery_action
=recovery_action
,
199 data_storetype
=data_storetype
,
200 ha_startup_mode
=ha_startup_mode
,
203 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwimagemgrtasklet')
204 plugin_name
= ClassProperty('rwimagemgrtasklet')
207 class MonitorTasklet(rift
.vcs
.core
.Tasklet
):
209 This class represents a tasklet that is used to monitor NFVI metrics.
212 def __init__(self
, name
='nfvi-metrics-monitor', uid
=None,
214 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
215 data_storetype
=core
.DataStore
.NOSTORE
.value
,
216 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
219 Creates a MonitorTasklet object.
222 name - the name of the tasklet
223 uid - a unique identifier
226 super(MonitorTasklet
, self
).__init
__(name
=name
, uid
=uid
,
227 config_ready
=config_ready
,
228 recovery_action
=recovery_action
,
229 data_storetype
=data_storetype
,
230 ha_startup_mode
=ha_startup_mode
,
233 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwmonitor')
234 plugin_name
= ClassProperty('rwmonitor')
236 class RedisServer(rift
.vcs
.NativeProcess
):
237 def __init__(self
, name
="RW.Redis.Server",
239 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
240 data_storetype
=core
.DataStore
.NOSTORE
.value
,
241 ha_startup_mode
=core
.HaStartup
.ANY_VM
.value
,
243 super(RedisServer
, self
).__init
__(
245 exe
="/usr/bin/redis-server",
246 config_ready
=config_ready
,
247 recovery_action
=recovery_action
,
248 data_storetype
=data_storetype
,
249 ha_startup_mode
=ha_startup_mode
,
254 return "./usr/bin/active_redis.conf --port 9999"
257 class MonitoringParameterTasklet(rift
.vcs
.core
.Tasklet
):
259 This class represents a tasklet that is used to generate monitoring
263 def __init__(self
, name
='Monitoring-Parameter', uid
=None,
265 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
266 data_storetype
=core
.DataStore
.NOSTORE
.value
,
267 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
270 Creates a MonitoringParameterTasklet object.
273 name - the name of the tasklet
274 uid - a unique identifier
277 super(MonitoringParameterTasklet
, self
).__init
__(name
=name
, uid
=uid
,
278 config_ready
=config_ready
,
279 recovery_action
=recovery_action
,
280 data_storetype
=data_storetype
,
281 ha_startup_mode
=ha_startup_mode
,
284 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwmonparam')
285 plugin_name
= ClassProperty('rwmonparam')
288 class AutoscalerTasklet(rift
.vcs
.core
.Tasklet
):
290 This class represents a tasklet that is used to generate monitoring
294 def __init__(self
, name
='Autoscaler', uid
=None,
296 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
297 data_storetype
=core
.DataStore
.NOSTORE
.value
,
298 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
301 Creates a MonitoringParameterTasklet object.
304 name - the name of the tasklet
305 uid - a unique identifier
308 super(AutoscalerTasklet
, self
).__init
__(name
=name
, uid
=uid
,
309 config_ready
=config_ready
,
310 recovery_action
=recovery_action
,
311 data_storetype
=data_storetype
,
312 ha_startup_mode
=ha_startup_mode
,
315 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwautoscaler')
316 plugin_name
= ClassProperty('rwautoscaler')
318 class StagingManagerTasklet(rift
.vcs
.core
.Tasklet
):
320 A class that provide a simple staging area for all tasklets
323 def __init__(self
, name
='StagingManager', uid
=None,
325 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
326 data_storetype
=core
.DataStore
.NOSTORE
.value
,
327 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
330 Creates a StagingMangerTasklet object.
333 name - the name of the tasklet
334 uid - a unique identifier
337 super(StagingManagerTasklet
, self
).__init
__(name
=name
, uid
=uid
,
338 config_ready
=config_ready
,
339 recovery_action
=recovery_action
,
340 data_storetype
=data_storetype
,
341 ha_startup_mode
=ha_startup_mode
,
344 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwstagingmgr')
345 plugin_name
= ClassProperty('rwstagingmgr')
348 class UIServer(rift
.vcs
.NativeProcess
):
349 def __init__(self
, name
="RW.MC.UI",
351 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
352 data_storetype
=core
.DataStore
.NOSTORE
.value
,
353 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
354 external_address
=None,
356 super(UIServer
, self
).__init
__(
358 exe
="./usr/share/rw.ui/skyquake/scripts/launch_ui.sh",
359 config_ready
=config_ready
,
360 recovery_action
=recovery_action
,
361 data_storetype
=data_storetype
,
362 ha_startup_mode
=ha_startup_mode
,
364 self
._external
_address
= external_address
368 return self
._get
_ui
_args
()
370 def _get_ui_args(self
):
371 """Returns the SSL parameter string for launchpad UI processes"""
374 use_ssl
, certfile_path
, keyfile_path
= certs
.get_bootstrap_cert_and_key()
375 except certs
.BootstrapSslMissingException
:
376 logger
.error('No bootstrap certificates found. Disabling UI SSL')
379 # If we're not using SSL, no SSL arguments are necessary
383 # If an external address is set, take that value for launchpad IP
384 # address, else use the internal IP address used for default route
385 launchpad_ip_address
= self
._external
_address
386 if not launchpad_ip_address
:
387 launchpad_ip_address
= get_launchpad_address()
389 return "--enable-https" +\
390 " --keyfile-path={}".format(keyfile_path
) +\
391 " --certfile-path={}".format(certfile_path
) +\
392 " --launchpad-address={}".format(launchpad_ip_address
) +\
393 " --idp-port-number={}".format(IDP_PORT_NUMBER
) +\
394 " --callback-address={}".format(launchpad_ip_address
)
397 class ConfigManagerTasklet(rift
.vcs
.core
.Tasklet
):
399 This class represents a Resource Manager tasklet.
402 def __init__(self
, name
='Configuration-Manager', uid
=None,
404 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
405 data_storetype
=core
.DataStore
.NOSTORE
.value
,
406 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
409 Creates a ConfigManagerTasklet object.
412 name - the name of the tasklet
413 uid - a unique identifier
415 super(ConfigManagerTasklet
, self
).__init
__(name
=name
, uid
=uid
,
416 config_ready
=config_ready
,
417 recovery_action
=recovery_action
,
418 data_storetype
=data_storetype
,
419 ha_startup_mode
=ha_startup_mode
,
422 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwconmantasklet')
423 plugin_name
= ClassProperty('rwconmantasklet')
426 class ProjectMgrManoTasklet(rift
.vcs
.core
.Tasklet
):
428 This class represents a Resource Manager tasklet.
431 def __init__(self
, name
='Project-Manager-Mano', uid
=None,
433 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
434 data_storetype
=core
.DataStore
.NOSTORE
.value
,
435 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
438 Creates a ProjectMgrManoTasklet object.
441 name - the name of the tasklet
442 uid - a unique identifier
444 super(ProjectMgrManoTasklet
, self
).__init
__(name
=name
, uid
=uid
,
445 config_ready
=config_ready
,
446 recovery_action
=recovery_action
,
447 data_storetype
=data_storetype
,
448 ha_startup_mode
=ha_startup_mode
,
451 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwprojectmano')
452 plugin_name
= ClassProperty('rwprojectmano')
455 class PackageManagerTasklet(rift
.vcs
.core
.Tasklet
):
457 This class represents a Resource Manager tasklet.
460 def __init__(self
, name
='Package-Manager', uid
=None,
462 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
463 data_storetype
=core
.DataStore
.NOSTORE
.value
,
464 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
467 Creates a PackageManager object.
470 name - the name of the tasklet
471 uid - a unique identifier
473 super(PackageManagerTasklet
, self
).__init
__(name
=name
, uid
=uid
,
474 config_ready
=config_ready
,
475 recovery_action
=recovery_action
,
476 data_storetype
=data_storetype
,
477 ha_startup_mode
=ha_startup_mode
,
480 plugin_directory
= ClassProperty('./usr/lib/rift/plugins/rwpkgmgr')
481 plugin_name
= ClassProperty('rwpkgmgr')
483 class GlanceServer(rift
.vcs
.NativeProcess
):
484 def __init__(self
, name
="glance-image-catalog",
486 recovery_action
=core
.RecoveryType
.FAILCRITICAL
.value
,
487 data_storetype
=core
.DataStore
.NOSTORE
.value
,
488 ha_startup_mode
=core
.HaStartup
.ONLY_ACTIVE
.value
,
490 super(GlanceServer
, self
).__init
__(
492 exe
="./usr/bin/glance_start_wrapper",
493 config_ready
=config_ready
,
494 recovery_action
=recovery_action
,
495 data_storetype
=data_storetype
,
496 ha_startup_mode
=ha_startup_mode
,
501 return "./etc/glance"
504 class Demo(rift
.vcs
.demo
.Demo
):
505 def __init__(self
, no_ui
=False,
511 external_address
=None):
513 datastore
= core
.DataStore
.BDB
.value
514 if data_store
== "Redis":
515 datastore
= core
.DataStore
.REDIS
.value
516 elif data_store
== "None":
517 datastore
= core
.DataStore
.NOSTORE
.value
519 restart_db_active
= {"recovery_action" : core
.RecoveryType
.RESTART
.value
, \
520 "data_storetype" : datastore
, \
521 "ha_startup_mode" : core
.HaStartup
.ONLY_ACTIVE
.value
}
523 failcrit_db_active
= {"recovery_action" : core
.RecoveryType
.FAILCRITICAL
.value
, \
524 "data_storetype" : datastore
, \
525 "ha_startup_mode" : core
.HaStartup
.ONLY_ACTIVE
.value
}
527 failcrit_db_any
= {"recovery_action" : core
.RecoveryType
.FAILCRITICAL
.value
, \
528 "data_storetype" : datastore
, \
529 "ha_startup_mode" : core
.HaStartup
.ANY_VM
.value
}
532 ConfigManagerTasklet(**failcrit_db_active
),
533 GlanceServer(**failcrit_db_active
),
534 rift
.vcs
.DtsRouterTasklet(**failcrit_db_any
),
535 rift
.vcs
.MsgBrokerTasklet(**failcrit_db_any
),
536 rift
.vcs
.RestconfTasklet(**failcrit_db_active
),
537 rift
.vcs
.RiftCli(**failcrit_db_active
, as_console
=True),
538 rift
.vcs
.uAgentTasklet(**failcrit_db_any
),
539 rift
.vcs
.Launchpad(**failcrit_db_active
),
540 rift
.vcs
.IdentityManagerTasklet(**failcrit_db_active
),
541 rift
.vcs
.ProjectManagerTasklet(**failcrit_db_active
),
542 rift
.vcs
.HAManager(**failcrit_db_any
),
543 rift
.vcs
.OpenIDCProviderTasklet(**failcrit_db_active
),
544 rift
.vcs
.AuthExtUserTasklet(**failcrit_db_active
),
545 rift
.vcs
.OTTAuthTasklet(**failcrit_db_active
),
546 NsmTasklet(**failcrit_db_active
),
547 VnfmTasklet(**failcrit_db_active
),
548 VnsTasklet(**failcrit_db_active
),
549 ResMgrTasklet(**failcrit_db_active
),
550 ImageMgrTasklet(**failcrit_db_active
),
551 AutoscalerTasklet(**failcrit_db_active
),
552 StagingManagerTasklet(**failcrit_db_active
),
553 PackageManagerTasklet(**failcrit_db_active
),
554 MonitoringParameterTasklet(**failcrit_db_active
),
555 ProjectMgrManoTasklet(**failcrit_db_active
)
558 if datastore
== core
.DataStore
.REDIS
.value
:
559 procs
.append(RedisServer(**failcrit_db_any
))
562 procs
.append(UIServer(external_address
=external_address
))
565 procs
.append(rift
.vcs
.WebAuthSvcTasklet(**failcrit_db_active
))
568 procs
.append(rift
.vcs
.PAMAuthTasklet())
572 if not mgmt_ip_list
or len(mgmt_ip_list
) == 0:
573 mgmt_ip_list
.append(get_launchpad_address())
575 colony
= rift
.vcs
.core
.Colony(name
='top', uid
=1)
577 for mgmt_ip
in mgmt_ip_list
:
578 vm
= rift
.vcs
.VirtualMachine(name
='mgmt-vm-lp',
581 restart_procs
=restart_procs
,start
=False,)
587 sysinfo
= rift
.vcs
.SystemInfo(
589 zookeeper
=rift
.vcs
.manifest
.RaZookeeper(master_ip
=mgmt_ip_list
[0]),
592 multi_dtsrouter
=True,
593 mgmt_ip_list
=mgmt_ip_list
,
597 super(Demo
, self
).__init
__(
598 # Construct the system. This system consists of 1 cluster in 1
599 # colony. The master cluster houses CLI and management VMs
602 # Define the generic portmap.
605 # Define a mapping from the placeholder logical names to the real
606 # port names for each of the different modes supported by this demo.
614 # Define the connectivity between logical port names.
619 def main(argv
=sys
.argv
[1:]):
620 logging
.basicConfig(format
='%(asctime)-15s %(levelname)s %(message)s')
622 # Create a parser which includes all generic demo arguments
623 parser
= rift
.vcs
.demo
.DemoArgParser()
624 parser
.add_argument("--no-ui", action
='store_true')
625 parser
.add_argument("--start-auth-svc",
627 help="Start the Web Based Authentication service simualtor.")
628 parser
.add_argument("--start-pam-svc",
630 help="Start the PAM Authentication service.")
631 parser
.add_argument("--external-address",
633 help="External IP address or hostname using which the host can "+
635 if rift
.vcs
.mgmt
.default_agent_mode() == 'CONFD':
636 parser
.add_argument("--use-osm-model",
638 help="Load only OSM specific models and hide the Rift Specific Augments")
640 args
= parser
.parse_args(argv
)
642 # Disable loading any kernel modules for the launchpad VM
643 # since it doesn't need it and it will fail within containers
644 os
.environ
["NO_KERNEL_MODS"] = "1"
646 # Get external_address from env if args not set
647 if args
.external_address
is None:
648 args
.external_address
= os
.getenv("RIFT_EXTERNAL_ADDRESS")
650 os
.environ
["RIFT_EXTERNAL_ADDRESS"] = \
651 args
.external_address
if args
.external_address
else get_launchpad_address()
653 cleanup_dir_name
= None
654 if os
.environ
["INSTALLDIR"] in ["/usr/rift",
655 "/usr/rift/build/ub16_debug/install/usr/rift",
656 "/usr/rift/build/fc20_debug/install/usr/rift"]:
657 cleanup_dir_name
= os
.environ
["INSTALLDIR"] + "/var/rift/"
659 if args
.test_name
and not cleanup_dir_name
:
660 cleanup_dir_name
= "find {rift_install}/var/rift -name '*{pattern}*' -type d".format( \
661 rift_install
=os
.environ
['RIFT_INSTALL'],
662 pattern
= args
.test_name
)
664 cleanup_dir_name
= subprocess
.check_output(cleanup_dir_name
, shell
=True)
665 cleanup_dir_name
= cleanup_dir_name
[:-1].decode("utf-8") + "/"
666 except Exception as e
:
667 print ("Directory not found exception occurred. Probably running for first time")
668 print ("Zookeper cleanup cmd = {}".format(cleanup_dir_name
))
670 if not cleanup_dir_name
:
671 cleanup_dir_name
= os
.environ
["INSTALLDIR"] + "/"
673 # Remove the persistent Redis data
675 for f
in os
.listdir(cleanup_dir_name
):
676 if f
.endswith(".aof") or f
.endswith(".rdb"):
677 os
.remove(os
.path
.join(cleanup_dir_name
, f
))
679 # Remove the persistant DTS recovery files
680 for f
in os
.listdir(cleanup_dir_name
):
681 if f
.endswith(".db"):
682 os
.remove(os
.path
.join(cleanup_dir_name
, f
))
684 shutil
.rmtree(os
.path
.join(cleanup_dir_name
, "zk/server-1"))
685 shutil
.rmtree(os
.path
.join(os
.environ
["INSTALLDIR"], "var/rift/tmp*"))
686 except FileNotFoundError
as e
:
688 except Exception as e
:
689 print ("Error while cleanup: {}".format(str(e
)))
691 datastore
= args
.datastore
692 mgmt_ip_list
= [] if not args
.mgmt_ip_list
else args
.mgmt_ip_list
694 #load demo info and create Demo object
695 demo
= Demo(args
.no_ui
,
701 args
.external_address
)
703 if 'use_osm_model' in args
and args
.use_osm_model
:
704 northbound_listing
= ["platform_schema_listing.txt",
705 "platform_mgmt_schema_listing.txt",
706 "cli_launchpad_schema_listing.txt"]
707 args
.use_xml_mode
= True
710 northbound_listing
= ["platform_schema_listing.txt",
711 "platform_mgmt_schema_listing.txt",
712 "cli_launchpad_schema_listing.txt",
713 "cli_launchpad_rift_specific_schema_listing.txt"]
715 # Create the prepared system from the demo
716 system
= rift
.vcs
.demo
.prepared_system_from_demo_and_args(
718 northbound_listing
=northbound_listing
,
719 netconf_trace_override
=True)
721 confd_ip
= get_launchpad_address()
722 # TODO: This need to be changed when launchpad starts running on multiple VMs
723 rift
.vcs
.logger
.configure_sink(config_file
=None, confd_ip
=confd_ip
)
725 # Start the prepared system
728 if __name__
== "__main__":
729 resource
.setrlimit(resource
.RLIMIT_CORE
, (resource
.RLIM_INFINITY
, resource
.RLIM_INFINITY
) )
730 os
.system('/usr/rift/bin/UpdateHostsFile')
733 except rift
.vcs
.demo
.ReservationError
:
734 print("ERROR: unable to retrieve a list of IP addresses from the reservation system")
736 except rift
.vcs
.demo
.MissingModeError
:
737 print("ERROR: you need to provide a mode to run the script")
740 os
.system("stty sane")