HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_reset_rmc.cpython-36.pyc
3

\�me��	@s�UdZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZd	Zd
ddee
geggd
�ZedZdZdZdZeje�ZdZee	eedd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Z dS)zReset RMC: Reset rsct node id�N)�subp�util)�Cloud)�Config)�
MetaSchema)�ALL_DISTROS)�PER_INSTANCEa|Reset RMC module is IBM PowerVM Hypervisor specific

Reliable Scalable Cluster Technology (RSCT) is a set of software components,
that  together provide a comprehensive clustering environment (RAS features)
for IBM PowerVM based virtual machines. RSCT includes the Resource monitoring
and control (RMC) subsystem. RMC is a generalized framework used for managing,
monitoring, and manipulating resources. RMC runs as a daemon process on
individual machines and needs creation of unique node id and restarts
during VM boot.
More details refer
https://www.ibm.com/support/knowledgecenter/en/SGVKBA_3.2/admin/bl503_ovrv.htm

This module handles
- creation of the unique RSCT node id to every instance/virtual machine
  and ensure once set, it isn't changed subsequently by cloud-init.
  In order to do so, it restarts RSCT service.

Prerequisite of using this module is to install RSCT packages.
Zcc_reset_rmcz	Reset RMCzreset rsct node id)�id�name�title�descriptionZdistrosZ	frequencyZexamplesZactivate_by_schema_keys�z/opt/rsct/install/bin�rmcctrlZrecfgctz/etc/ct_node_id)r
�cfg�cloud�args�returncCsr|jjdkrtjd�dStjjt�s4tjd�dStjj	d�}zt
|�t�Wd|rd|tjd<ntjd=XdS)NZnonez(Skipping creation of new ct_node_id nodez&module disabled, RSCT_PATH not present�PATH)Z
datasourceZ
platform_type�LOG�debug�os�path�isdir�	RSCT_PATH�environ�get�add_path�	reset_rmc)r
rrr�	orig_path�r�"/usr/lib/python3.6/cc_reset_rmc.py�handleAs


r!cCsLy"tjtg�d}tj|j��|Stjk
rFtjtd��YnXdS)Nrz*Failed to reconfigure the RSCT subsystems.)r�RECFGCTrr�stripZProcessExecutionErrorr�logexc)�outrrr �reconfigure_rsct_subsystemsVsr&cCsHytjt�}|jd�d}|Stk
rBtjtdt��YnXdS)N�
rz#Failed to get node ID from file %s.)rZ	load_file�NODE_ID_FILE�split�	Exceptionr$r)�fpZnode_idrrr �get_node_idcs
r,cCs(|rd|nd}t|tjd<tjdS)N�:r
r)rrr)rZsuffrrr rmsrcCs6ytjtdg�Stk
r0tjtd��YnXdS)Nz-zz!Failed to stop the RMC subsystem.)r�RMCCTRLr*rr$rrrrr rvs
cCs\tjd�t�}tjd|�t�t�t�}tjd|�||krXd}tj|�t|��dS)NzAttempting to reset RMC.z"Node ID at beginning of module: %szNode ID at end of module: %sz"New node ID did not get generated.)rrr,rr&�error�RuntimeError)Znode_id_beforeZ
node_id_after�msgrrr r�s

r)!�__doc__ZloggingrZ	cloudinitrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarZcloudinit.distrosrZcloudinit.settingsrZMODULE_DESCRIPTION�metarr.r"Z	getLogger�__name__rr(�str�listr!r&r,rrrrrrr �<module>s: