Compare commits
969 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 19a14d711d | |||
| 45d05d26f0 | |||
| 3bb52d4109 | |||
| 86d2a14472 | |||
| 9567b80174 | |||
| cd660ad538 | |||
| 7d38486a08 | |||
| ebe0f60795 | |||
| d4c6c267e8 | |||
| 8235d4ac43 | |||
| abdf84c60f | |||
| e4f555bd71 | |||
| 2f3e76593e | |||
| 64a9d71a53 | |||
| 63b0515072 | |||
| 0b639cb5c2 | |||
| 61ef293909 | |||
| a6590b61bc | |||
| 7d0067c948 | |||
| e4b2e44c1c | |||
| af7a55499c | |||
| a21b141bbd | |||
| 5c784e7b76 | |||
| d6cef63a03 | |||
| a8c7dca997 | |||
| 7d5f94dd29 | |||
| f7896eab97 | |||
| 0e8eb99410 | |||
| 6f8f7c3f52 | |||
| 7a27003c93 | |||
| f92c9e52c2 | |||
| 80785946c3 | |||
| f98eee4e27 | |||
| 2773b2cb0a | |||
| f9790ea536 | |||
| 25203ea1b5 | |||
| bd4d78da84 | |||
| ac3c7fe28c | |||
| ed88f05e47 | |||
| fc7822f93e | |||
| 46ea594db7 | |||
| 43e89b90a2 | |||
| 309bc5cc48 | |||
| 5311349afa | |||
| 4a2fc2bc31 | |||
| e98678711b | |||
| e0e6874bb5 | |||
| 8e3d1735a6 | |||
| a5362a40a0 | |||
| f8b6035f94 | |||
| 32b8f7363e | |||
| 9925cb7099 | |||
| 468d01294a | |||
| 380928afe2 | |||
| fbb5188133 | |||
| 796a855e9f | |||
| 318c8a95b5 | |||
| d366c51298 | |||
| ab402d90a0 | |||
| 44c9aea4e2 | |||
| 312aec61c5 | |||
| 6a11d0230f | |||
| eacf7bb705 | |||
| 66990705cf | |||
| e78a1a792a | |||
| a0348fa10b | |||
| 3593f5c5f6 | |||
| 0aa1bb69f8 | |||
| 24daaf4167 | |||
| e3e3950755 | |||
| 36bc7c7ef7 | |||
| eac2017ebe | |||
| ba6db26013 | |||
| be6c764c15 | |||
| afb39ee9f6 | |||
| 29af239759 | |||
| 1789b73dc7 | |||
| 7e88064d17 | |||
| 8745f3716a | |||
| 31f33bdc6e | |||
| 1800b644a4 | |||
| 83c7a6c518 | |||
| 136a29d4cc | |||
| 760f6bba6e | |||
| 4fd19c1cb3 | |||
| 2fc43ee369 | |||
| db9f372318 | |||
| 2579006170 | |||
| 2e08e93f6a | |||
| ef3f6264a1 | |||
| 4d822dc512 | |||
| 365e767cee | |||
| 6b85f59313 | |||
| d6ac310ac4 | |||
| 94790e7adb | |||
| db4608c4f4 | |||
| c8c259b87d | |||
| c52d9e4173 | |||
| d9f1cddbe2 | |||
| efc0943a60 | |||
| 08e280ab0d | |||
| e5f6a985ee | |||
| b09d4b62d0 | |||
| 3237dc7029 | |||
| 5ad03e3ea3 | |||
| 6ce7c4a5ed | |||
| 028c57b77f | |||
| e39dd3b483 | |||
| 50d9b30366 | |||
| d147b6fab4 | |||
| e55ac17bbf | |||
| 94feb79653 | |||
| d0d7d0fca7 | |||
| c07e084196 | |||
| f0e1f5fd21 | |||
| b1d7fe518d | |||
| aadf88afd8 | |||
| c0a425a610 | |||
| 64edcd07cd | |||
| db9d0474a1 | |||
| c88186c3b2 | |||
| 2679d81c3e | |||
| a72ebc81ed | |||
| cd82e2ed40 | |||
| 0124789e7c | |||
| d709219803 | |||
| 3c3612546a | |||
| 5baf467a50 | |||
| b1634bdf06 | |||
| 1a844bae71 | |||
| 253a919d38 | |||
| 3217183ffb | |||
| 46d9b6345c | |||
| 7ca468b29b | |||
| 0638e0cf77 | |||
| 80f583859f | |||
| a1e9904375 | |||
| 2732e1f90d | |||
| 7c624d9026 | |||
| 9aaae028f2 | |||
| 441261bb2f | |||
| 80dbeffa85 | |||
| 39123d48ac | |||
| b8c42d07ae | |||
| 7368174669 | |||
| 3b64245ca6 | |||
| 8311f248fb | |||
| 82b0440a02 | |||
| e889ef17b1 | |||
| a815abaaed | |||
| ec266f7000 | |||
| 4633498a4b | |||
| 0a521cb31a | |||
| 31323d58fa | |||
| a1e1afdb9e | |||
| b0a21076e9 | |||
| 4b5a7005b1 | |||
| 3860a56041 | |||
| 7f5e911c2a | |||
| 180ba59b72 | |||
| 5e5710ad4e | |||
| 79deb0acf5 | |||
| 42cb10b6aa | |||
| 4b8ed14152 | |||
| 4854e5ca69 | |||
| 7f0e7d53ef | |||
| ac5654aae4 | |||
| 1a5bb68586 | |||
| d65d73f9e4 | |||
| fa973b8fd1 | |||
| 2d3d927056 | |||
| d82ee6e7f2 | |||
| e63d9a9967 | |||
| a0bd8f6a46 | |||
| 9d55a3b3c1 | |||
| 34f16337a1 | |||
| 6521a0df7e | |||
| 9af37d48bb | |||
| 7bb0967496 | |||
| 3f8c9bced2 | |||
| 21d1017f86 | |||
| 08a7dc5c78 | |||
| bf2247a181 | |||
| 52e71591be | |||
| b3c477dd6f | |||
| c7cae12392 | |||
| f8c5b0c53b | |||
| 72cbbc912d | |||
| d2f0431829 | |||
| d18d235f1d | |||
| aa1fcd2493 | |||
| ac28aa7e16 | |||
| b8b4c75c39 | |||
| d31122325b | |||
| bc7491ebde | |||
| 3e3eb858e5 | |||
| 55b09cf8b5 | |||
| 15316700a9 | |||
| be879dd88e | |||
| 8c19948f3b | |||
| 4106dec47e | |||
| 7c7b6330ed | |||
| 72c0326c2e | |||
| c1bf69de94 | |||
| 8935e432a2 | |||
| 95cb15d18e | |||
| d1c2a26b2b | |||
| eedb72cac5 | |||
| ae81e14bed | |||
| 1dab5cbb5b | |||
| a10635241e | |||
| fd8ebe93b8 | |||
| 45a2783186 | |||
| 0b1751059b | |||
| 5d5bc70fe8 | |||
| 083154650c | |||
| 44060947cc | |||
| 731a2b9a9d | |||
| 544cabd915 | |||
| 9f8c5f7998 | |||
| 9f20565957 | |||
| bf91d7e939 | |||
| 3af54f8e00 | |||
| 82a094b753 | |||
| b6e445e1f6 | |||
| fb97c85957 | |||
| 4d5c361055 | |||
| f3fce3cbd7 | |||
| f9decc9b87 | |||
| c101ca6858 | |||
| fbd56c732b | |||
| 602f8beb52 | |||
| 734b00e875 | |||
| 2f2a72e90c | |||
| de82de8d87 | |||
| dd87d634e5 | |||
| a2a76f23c6 | |||
| 2f39a9182c | |||
| c94740deb4 | |||
| 5a7e50c1fe | |||
| dab3cf53b0 | |||
| 0857cb241a | |||
| 27085c3af0 | |||
| 1664ed82d8 | |||
| 6ee370cfbe | |||
| 4488357171 | |||
| b99460f24f | |||
| 7d9a0ad0ed | |||
| 3c84558504 | |||
| f891cc995b | |||
| 46c40ab353 | |||
| a2656b7645 | |||
| ba94317016 | |||
| f8f797bc57 | |||
| 08bfa000a6 | |||
| 980c22d787 | |||
| e83a221388 | |||
| 209b9202b7 | |||
| 7640137f02 | |||
| 11c7894e6f | |||
| 70cf9e5790 | |||
| b549c9b8e4 | |||
| e51af68867 | |||
| 254643a5c7 | |||
| 84b1fb6a79 | |||
| 68d2993a78 | |||
| 8b4c3c074b | |||
| 086c91877e | |||
| 259767a305 | |||
| c4331e85c6 | |||
| a585170667 | |||
| ba244e8841 | |||
| 1dac16d2ce | |||
| 2a241d4e64 | |||
| 5b3f372056 | |||
| 1dd54b108d | |||
| 94511e23c0 | |||
| 8947e743a1 | |||
| da0a0d9555 | |||
| 273bac6e72 | |||
| e680150395 | |||
| df3f6b7ffb | |||
| d7051e1bde | |||
| b44c562e4e | |||
| 4018deb485 | |||
| c4e78295ff | |||
| d37b7dd8f4 | |||
| 8f4cb07057 | |||
| 4ba6342bc7 | |||
| 451d63d075 | |||
| ba23720d6f | |||
| b733ed7993 | |||
| ab8527103f | |||
| 2c76dc1011 | |||
| d38374d1c2 | |||
| fd9e4f96ce | |||
| b8f5208ef0 | |||
| 108d40c7dc | |||
| ccf619ce12 | |||
| b390df9313 | |||
| ce8f2e5282 | |||
| ba38665c4e | |||
| b6629f4e61 | |||
| 2220d60168 | |||
| 2165956209 | |||
| 32a15b987a | |||
| 406346f2a6 | |||
| 7317419c92 | |||
| 98f2a6dd5b | |||
| a000d5f80b | |||
| 94e3862219 | |||
| 19b413af7f | |||
| c418b962ba | |||
| 20140c5c8f | |||
| 13016f8817 | |||
| a3476dd281 | |||
| a270d82762 | |||
| 63c773dd53 | |||
| 1254f86a45 | |||
| d8442c35e2 | |||
| 29e60c243e | |||
| 70c5242f77 | |||
| 71062b78d9 | |||
| 5a10afcb2d | |||
| 056f824b02 | |||
| 0d46150fcc | |||
| 664a1e0f74 | |||
| 405ad47b44 | |||
| a4119f52a2 | |||
| 9a014e31c3 | |||
| 88d34addd0 | |||
| ede6f9a65a | |||
| 901e60d507 | |||
| d14d92acf0 | |||
| c7dcb9160c | |||
| b7e4a65913 | |||
| 468644eee4 | |||
| 207fafea58 | |||
| 49787e5842 | |||
| 1e09d79d7f | |||
| d837e1fea0 | |||
| e31e02650d | |||
| b2c1c84696 | |||
| f2744659a7 | |||
| e925929f1a | |||
| 8c5ed18ffe | |||
| fd83987b66 | |||
| a55f3461d5 | |||
| f5f4e1117d | |||
| 895f3c7673 | |||
| 9122b91ca2 | |||
| 1ad82ecc82 | |||
| af69e64ca5 | |||
| affe91b7d3 | |||
| e7f3c4dcfe | |||
| d9af0e6c67 | |||
| af74d4fa22 | |||
| 0dc7190796 | |||
| 759cea4c03 | |||
| 7250b6595a | |||
| 65e870c0e8 | |||
| f94475e615 | |||
| 83e88eac4b | |||
| acaefeedda | |||
| d3b955caed | |||
| a5b5cc1c8b | |||
| 632e27647c | |||
| 434a530bbb | |||
| 6378d1ecbb | |||
| 5fd9e8448f | |||
| f528c39823 | |||
| 9742daa508 | |||
| 9f6f9c9ba1 | |||
| 9718f7161e | |||
| d7ff87a006 | |||
| 4e0224fc07 | |||
| c508d0bbbd | |||
| d2044c61f2 | |||
| 77ff664eb0 | |||
| a2b505be1c | |||
| 7cd9df23fb | |||
| 5bc4867f00 | |||
| 5f576615a1 | |||
| bbcf107b6a | |||
| 59a83730a4 | |||
| 036533351b | |||
| 477d41591e | |||
| c027734b2c | |||
| dd5b8103d7 | |||
| 4522feaa4f | |||
| 41fbf85cb8 | |||
| 1a0f0a90b0 | |||
| 41d0e37a84 | |||
| 5f58bb8dc8 | |||
| c45549830f | |||
| 881c1daa47 | |||
| 0bfe50eaa2 | |||
| 581a5d3757 | |||
| f914f11de9 | |||
| b3b3d3401c | |||
| 8509f7af39 | |||
| 91ae5f3edd | |||
| 50feb83e56 | |||
| 2d49286342 | |||
| ed6dfea685 | |||
| 70786f3d53 | |||
| e475a8b693 | |||
| 7442dd8413 | |||
| 31c60fc35f | |||
| 230625f4f6 | |||
| b021dee141 | |||
| b3bf58c236 | |||
| ada63f1faf | |||
| 14e605511d | |||
| 5bd77c3382 | |||
| c518a61f69 | |||
| 7fb96a1b9f | |||
| 7c0744d25a | |||
| 8e08d966ee | |||
| 2fdf9dc8c7 | |||
| 5cc6c961e5 | |||
| ece4a78fe4 | |||
| 49d8bf9f15 | |||
| 614b0bc0a9 | |||
| 1ab0ea3f0e | |||
| 8a13ae9151 | |||
| f3cc830095 | |||
| d6372084a7 | |||
| 3d8d27f48b | |||
| 78133aa3bb | |||
| 81dbcb740b | |||
| 7fb346f9ae | |||
| 8587a835fd | |||
| 6a1c104f66 | |||
| 7e34083819 | |||
| c454f53c75 | |||
| f5c785ba23 | |||
| bdd737a482 | |||
| 67ac470c5a | |||
| 6adb4327a0 | |||
| c1863f23e1 | |||
| 3ab8f9db04 | |||
| 9e72871b81 | |||
| d2dc594434 | |||
| 08919eda58 | |||
| 1c9a36d74c | |||
| d6e8424836 | |||
| af362d39fa | |||
| 5af109fed3 | |||
| dd943d36b3 | |||
| fb20194388 | |||
| 321db70ad1 | |||
| 09938be4d8 | |||
| 0a83ee6596 | |||
| 0317dd05bf | |||
| 1e4d543cf7 | |||
| f0e3791a45 | |||
| ae1df250b2 | |||
| 901468467d | |||
| c67d271b75 | |||
| af638cb809 | |||
| e9dd327f23 | |||
| fa02a0dd58 | |||
| f897724e5c | |||
| 975d448244 | |||
| c6e7fb8ce8 | |||
| 927df81422 | |||
| 4d95ec7969 | |||
| 0ee40f1aa5 | |||
| d373e3f456 | |||
| a150ad3ee2 | |||
| 6df7a8ce12 | |||
| 46d4c8fb45 | |||
| fb045361a5 | |||
| 206746b6c1 | |||
| 1115edcc77 | |||
| b403f7310c | |||
| acf129beaa | |||
| 24a20072ff | |||
| 71add678c3 | |||
| 1184212598 | |||
| 4505e8a91e | |||
| 0a3b830c83 | |||
| 76cc48da87 | |||
| 756378c0c3 | |||
| e89b79bcac | |||
| ff4c96376c | |||
| c7caefc2be | |||
| de6c531090 | |||
| ec2e1f2e5f | |||
| c79bcd7061 | |||
| 7586f27191 | |||
| 931e3e2059 | |||
| aacb5278c7 | |||
| c12c811738 | |||
| 7d3d5f6e83 | |||
| 61001a5e40 | |||
| e7fb61e2ba | |||
| 0436357081 | |||
| b6369a7638 | |||
| 1dc4df9e61 | |||
| 832571e724 | |||
| 00b344d8d0 | |||
| 1d76faed56 | |||
| 88281e0558 | |||
| 070e8975b2 | |||
| f17eed25e4 | |||
| 2f18ec4f7f | |||
| 5a0b29f758 | |||
| e4196ab2cb | |||
| ecde4d3f0b | |||
| 74166dae00 | |||
| 029623589a | |||
| e2e71fe5a5 | |||
| cd9a117e07 | |||
| f344b40856 | |||
| 6b2e3bafa8 | |||
| 89a9713be3 | |||
| f84952c674 | |||
| d79a8413f2 | |||
| af880698b3 | |||
| b06ae22ded | |||
| 5579e698ee | |||
| d0d9e7562d | |||
| 167238f43c | |||
| ce07ccbbcc | |||
| 86acca4d8a | |||
| e0c412f1e0 | |||
| 264e65ad20 | |||
| 319fc2df0f | |||
| 5b91dd6dbe | |||
| 8d68b26c80 | |||
| 63428c2c34 | |||
| 50b110f0ec | |||
| 248de38a9f | |||
| c686ea7a85 | |||
| 0b918e1761 | |||
| 3b2e1cbb91 | |||
| df78ea0e51 | |||
| fea288d4da | |||
| 27088833fe | |||
| 74f825bdbb | |||
| 5728b4defa | |||
| 4837a8831c | |||
| 41c11b4ac5 | |||
| 446d5225d6 | |||
| 6781104527 | |||
| fe2c2ae016 | |||
| c763c84abf | |||
| aea1618f0e | |||
| 475e6c51df | |||
| 7cc740d191 | |||
| 06b056fff6 | |||
| 994846f2b5 | |||
| 4de9a682b9 | |||
| 6404d01f22 | |||
| 482febd6e0 | |||
| 9cc489fbe1 | |||
| 6d4ec668cb | |||
| bbbd6f0133 | |||
| eb83262f4f | |||
| 6bbe69d680 | |||
| 1343fe6240 | |||
| 6691f1a6a5 | |||
| 31af2c1abe | |||
| 3eb9eb7db4 | |||
| 14d8515559 | |||
| 566f801972 | |||
| 8c73c1a3c8 | |||
| d35ff774bf | |||
| bf8b2d03e7 | |||
| bff0e289ca | |||
| 89c9bed215 | |||
| e01f51e8d5 | |||
| 276f492fd9 | |||
| 0b08a005db | |||
| a973a2c72a | |||
| 6c89f08856 | |||
| efc95378d8 | |||
| 16f1ccd713 | |||
| b1bb24b8eb | |||
| 97c9609793 | |||
| b64c53fb89 | |||
| 07dbe567b1 | |||
| 7f60717bda | |||
| fcc2078d54 | |||
| 5681fe9fe7 | |||
| 561bafb554 | |||
| 6b17144d16 | |||
| 346a03ba5d | |||
| bf86ee1a8a | |||
| 4efe8bb389 | |||
| 684d24db62 | |||
| b7f6051be2 | |||
| f44e74a51f | |||
| 63edb798e9 | |||
| c7c57c3914 | |||
| f6fed410e8 | |||
| 7dc173a961 | |||
| cb995a801a | |||
| 71a904afc7 | |||
| 6fa950c8e4 | |||
| 6145f30b34 | |||
| 7aeaa89a46 | |||
| b413e1b33d | |||
| 7e0871c456 | |||
| 6546665c29 | |||
| b45e5f91d1 | |||
| aa1a5f9b35 | |||
| 694f5878f8 | |||
| e4243312d5 | |||
| 3f7ed4dc69 | |||
| 626ed401d6 | |||
| 264668c85f | |||
| e254505337 | |||
| d589de6402 | |||
| 3c0dd360f5 | |||
| ced01fbac9 | |||
| 201e55a8bc | |||
| 40305a94b4 | |||
| 058b8950ab | |||
| daec39d3a2 | |||
| eb1bf16b15 | |||
| 6720e7900c | |||
| 8066590efc | |||
| 8eb33d24d7 | |||
| 28c28bb9d2 | |||
| d799735f35 | |||
| 704ef6932c | |||
| 302269ea3f | |||
| 22b551750e | |||
| 1b14168c84 | |||
| 91fd0975a5 | |||
| a8e56c8263 | |||
| c02fa63c57 | |||
| e359650e27 | |||
| 413b5ce1f6 | |||
| 786c0b9a20 | |||
| b10ad91d3c | |||
| fc92c7844a | |||
| 2eb0e018b3 | |||
| a395272078 | |||
| 077a5e2901 | |||
| 1cd1a8388c | |||
| f4e5b2e9e0 | |||
| 98e9f25aaf | |||
| 79d57e9c49 | |||
| d7a20623d8 | |||
| 12910722b5 | |||
| f01e654001 | |||
| df89dee4c6 | |||
| c122edd400 | |||
| 2ff852b466 | |||
| 2ce7244782 | |||
| eff23d4a3e | |||
| f35700c82e | |||
| d3e17f1988 | |||
| 710fd4029b | |||
| 0d8cf20521 | |||
| 49b144c012 | |||
| df535ce36d | |||
| 305559f05b | |||
| 778ccc9e03 | |||
| fc0047db9e | |||
| f362b67fdb | |||
| 8e48144ba3 | |||
| 98ab033cd4 | |||
| 47b13acc30 | |||
| 775bcb5b9a | |||
| e2dba9bfb8 | |||
| 64075a7d62 | |||
| 566349a967 | |||
| c314602e1b | |||
| 1ea8c0a043 | |||
| bdc005b7a7 | |||
| 390a5aac46 | |||
| 3641d4d290 | |||
| f34350fd51 | |||
| 974fbdbe97 | |||
| 389575a2e6 | |||
| c9e5ed1690 | |||
| 03c9080081 | |||
| 9ccc5d8def | |||
| 100b7a55d7 | |||
| 63d44bec99 | |||
| 4434a60729 | |||
| 09291d399f | |||
| 5c17e658ce | |||
| c797b691a6 | |||
| 80dcea738a | |||
| 2fb15fdecb | |||
| e1fc1437cd | |||
| 8159dfd0fd | |||
| 680ef06b3c | |||
| 59ae04e6da | |||
| 72817fcb81 | |||
| 4b4f8fac6b | |||
| 04ba40f28b | |||
| 9b335ce93c | |||
| 096681629d | |||
| 4ca2beecbf | |||
| 02ee2e25d9 | |||
| a47b354c3e | |||
| f090ea93c7 | |||
| 17f21f23dd | |||
| fe8752991b | |||
| 86d96195bf | |||
| 236888437d | |||
| ddf754b1e8 | |||
| 0e095151f0 | |||
| 0e1efe855e | |||
| 09141b389f | |||
| 1d6ba5855d | |||
| be3374506d | |||
| 3ab8b8990a | |||
| 3c416a4004 | |||
| 772c55f8a8 | |||
| 95eb74c115 | |||
| a7e4ef2bf1 | |||
| deb0391464 | |||
| 9550cef71d | |||
| 07063e64cd | |||
| e32c79ea02 | |||
| cdd5887194 | |||
| fbb1964488 | |||
| e971db6635 | |||
| 62149ffeab | |||
| c1ae76f7dc | |||
| e33a93d24a | |||
| 18e3c0ef2b | |||
| b163fdd290 | |||
| 0db0602cd6 | |||
| 17de2c7ae5 | |||
| f083340825 | |||
| 5795e2a5ea | |||
| 44a319233a | |||
| 55a23d07cf | |||
| 208bd7667a | |||
| d112125042 | |||
| 3f98aa66de | |||
| b9ab9c9ab0 | |||
| 80d2041941 | |||
| 8a478034cb | |||
| c2f1d848ff | |||
| aa3250fa44 | |||
| c44a1ec540 | |||
| 07bfea4df4 | |||
| 5ebe7d4122 | |||
| ad9443ab47 | |||
| 58048a474f | |||
| e48bc39c2b | |||
| bf88e7052f | |||
| 097c51149c | |||
| 9b4a8ccb52 | |||
| 1db4ae7592 | |||
| 7842d3d16d | |||
| 6d01963146 | |||
| fd6ca4e8d6 | |||
| d7eb796165 | |||
| adeef7b545 | |||
| 247e71445a | |||
| 8b64d60620 | |||
| a2fdef3d22 | |||
| 5b8620cdae | |||
| 7e30690442 | |||
| 3b3ce1f894 | |||
| 57e4d2e508 | |||
| a8db7806d5 | |||
| 15b060bf31 | |||
| fed7b1e8ad | |||
| d8bb801422 | |||
| 682d8ec0df | |||
| d3789253c0 | |||
| b1c7d3d59d | |||
| 3660e5d52d | |||
| 5c1345efb6 | |||
| 795a6ed852 | |||
| bc8a686c01 | |||
| d6e715d8be | |||
| 452806fff5 | |||
| 6f33b95718 | |||
| 707353d7a4 | |||
| f26491b055 | |||
| 7f02840237 | |||
| 0d1e0e5bd8 | |||
| 0a424f7464 | |||
| a75db50804 | |||
| 6e649a1bee | |||
| 0cbce7857d | |||
| 2192a7602d | |||
| 8957491f43 | |||
| abc58b4129 | |||
| 34958c9a33 | |||
| 939d35a0fe | |||
| 4b1ffd819e | |||
| 15abf7288b | |||
| 3e3f0e19b0 | |||
| cc606e9a7e | |||
| f56a602a71 | |||
| 8296ff33c1 | |||
| 6f34d48d61 | |||
| d28a567b55 | |||
| 6330c7b0ef | |||
| 3541b8b1cc | |||
| 7db647ebaa | |||
| 7c6b786a97 | |||
| d418f0242b | |||
| 5ff7dcad8d | |||
| 8d74c64821 | |||
| 9bda95f579 | |||
| 5cfc522107 | |||
| a60e0144c1 | |||
| fdd8fb24fd | |||
| 8b06f55eb8 | |||
| 843c7c1d5d | |||
| 87e4b0c226 | |||
| df5fafd11d | |||
| fed8cd7685 | |||
| 28ffd3d30d | |||
| a35c04455a | |||
| 56d219f881 | |||
| 2121f70ebe | |||
| a1705dc258 | |||
| 978d0e5876 | |||
| 4a3676c987 | |||
| fbd9d250d3 | |||
| 800370a96a | |||
| a446cc3054 | |||
| 57244d37ef | |||
| 6c70f1ce4e | |||
| 20a8d6583e | |||
| 593f2ee2c9 | |||
| 6d78e6aeb7 | |||
| 3b615c77c2 | |||
| 02673d9bac | |||
| 8112759c2f | |||
| 57518648b9 | |||
| e4712c5a5b | |||
| 9d9d849cc3 | |||
| 833976f525 | |||
| 48dc9306ec | |||
| 9c6cc52d49 | |||
| c5c13da285 | |||
| 48a70986b7 | |||
| 1e3916352e | |||
| 91150288aa | |||
| 9f34f9989b | |||
| d401f59d7f | |||
| dd953a1d17 | |||
| 45f6284891 | |||
| 99af6b0de6 | |||
| 7229fc1501 | |||
| 4e27d62953 | |||
| 4d4bd8bba5 | |||
| 50e4c46d4f | |||
| b03e4f2b33 | |||
| ffa7c5942a | |||
| 0ab7c79a91 | |||
| 755bb7ca8e | |||
| 3beebf6ccb | |||
| 0dfad6d08a | |||
| aa42b86b24 | |||
| 7c93367b42 | |||
| 85a99288d4 | |||
| 9a0840e5bb | |||
| 620d2a4ff7 | |||
| f442fe034d | |||
| 312c17e2c5 | |||
| e4d9ae9955 | |||
| f0951d09f0 | |||
| c3f6fde2fc | |||
| 776a6f936d | |||
| dabda08b40 | |||
| 807f563d11 | |||
| 101ac6c3aa | |||
| 4e5597ce72 | |||
| f42e832599 | |||
| cdedc212fe | |||
| 29ce8ffd81 | |||
| 23a37e993d | |||
| aa0c1698e5 | |||
| f9715aaebb | |||
| 4b67f2df5e | |||
| 4f7ecb3202 | |||
| 5b31caf7ac | |||
| 5a924514d2 | |||
| 26c633ad65 | |||
| 988ea46a25 | |||
| d66a5fa15b | |||
| 01a79ef71e | |||
| f47240a349 | |||
| fb9ac6c45c | |||
| 8fc204c7b1 | |||
| 97f5def116 | |||
| a2d14e557e | |||
| 3cc2e2ff42 | |||
| cbc2d07d59 | |||
| 6a4febe201 | |||
| 8aef3e9e81 | |||
| 70cb145a71 | |||
| 05f96f37a6 | |||
| 26bf6e2641 | |||
| a4c4d6b1bb | |||
| b81df35469 | |||
| 68e575a69d | |||
| 01a0cec3e7 | |||
| dacd2690c4 | |||
| 2f1b7d8fb6 | |||
| 057b9e72ef | |||
| d597130b9b | |||
| c18868d850 | |||
| af3ed02824 | |||
| ee107f1f51 | |||
| 661484b4c1 | |||
| 82c5ed555f | |||
| 7bed33128a | |||
| 0deb64b53a | |||
| bd4af1093f | |||
| 03ccf3c095 | |||
| ddf0b1ae4c | |||
| 1dfaa46360 | |||
| 9d9c0e34b9 | |||
| 988b15d7f1 | |||
| 4ee0d8586c | |||
| cc8a9e645e | |||
| 690377bc42 | |||
| 413dd37b21 | |||
| eab6f3e3fc | |||
| 658c947ca6 | |||
| 1a33167500 | |||
| 590061470b | |||
| 0311b2a153 | |||
| 97f09d34d4 | |||
| 2c89d9d93a | |||
| a18ae5b90d | |||
| 69a57acdd2 | |||
| 1868e85c57 | |||
| 31ca57bcfe | |||
| 9f87a1d437 | |||
| fa625d5ee3 | |||
| 926c88c43e | |||
| e7a7110d90 | |||
| a056b3545c | |||
| 06ce5ebcde | |||
| 8319b93f7d | |||
| 6f381c4c06 | |||
| 3999e51990 | |||
| d98365a5c1 | |||
| f71fcc1417 | |||
| 037b2f3ebd | |||
| e6eb66e24b | |||
| e27ed6274b | |||
| 3438dcda53 | |||
| 903e828ea2 | |||
| 4410c8b363 | |||
| a6a8f4496e | |||
| f61ccd70f3 | |||
| 30c1692f78 | |||
| c18b4d630d | |||
| f431dc1800 | |||
| 65e98ce27d | |||
| 70d0d7a9c9 | |||
| 394a9e21aa | |||
| b0865ca040 | |||
| 9863bd83d8 | |||
| c1a4a2b7a6 | |||
| 6c35430c8c | |||
| 3333e8d7fd | |||
| 5bc8f7bd96 |
@@ -68,7 +68,6 @@ function makedeb {
|
||||
|
||||
# build all debian packages
|
||||
makedeb xCAT-client $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
makedeb xCAT-nbroot $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
makedeb perl-xCAT $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
makedeb xCAT-server $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
makedeb xCAT-UI $PKG_LOCATION "$BUILD_STRING" $VERSION
|
||||
|
||||
+77
-48
@@ -19,12 +19,15 @@
|
||||
# directories that are needed.
|
||||
|
||||
# Usage: buildcore.sh [attr=value attr=value ...]
|
||||
# Before running buildcore.sh, you must change the local git repo to the branch you want built, using: git checkout <branch>
|
||||
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release.
|
||||
# Otherwise, and snap build is assumed.
|
||||
# PREGA=1 - means this is a branch that has not been released yet, so during the promote, copy the
|
||||
# xcat-core tarball to the SF web site instead of the FRS area.
|
||||
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release.
|
||||
# UP=0 or UP=1 - override the default upload behavior
|
||||
# SVNUP=<filename> - control which rpms get built by specifying a coresvnup file
|
||||
# GITUP=<filename> - control which rpms get built by specifying a coregitup file
|
||||
# FRSYUM=0 - put the yum repo and snap builds in the old project web area instead of the FRS area.
|
||||
# EMBED=<embedded-environment> - the environment for which a minimal version of xcat should be built, e.g. zvm or flex
|
||||
# VERBOSE=1 - to see lots of verbose output
|
||||
@@ -36,7 +39,7 @@ FRS=/home/frs/project/x/xc/xcat
|
||||
# Process cmd line variable assignments, assigning each attr=val pair to a variable of same name
|
||||
for i in $*; do
|
||||
# upper case the variable name
|
||||
varstring=`echo "$i"|cut -d '=' -f 1|tr [a-z] [A-Z]`=`echo "$i"|cut -d '=' -f 2`
|
||||
varstring=`echo "$i"|cut -d '=' -f 1|tr '[a-z]' '[A-Z]'`=`echo "$i"|cut -d '=' -f 2`
|
||||
export $varstring
|
||||
done
|
||||
if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ]; then
|
||||
@@ -67,6 +70,21 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
export HOME=/root # This is so rpm and gpg will know home, even in sudo
|
||||
fi
|
||||
|
||||
# for the git case, query the current branch and set REL (changing master to devel if necessary)
|
||||
function setbranch {
|
||||
#git checkout $BRANCH
|
||||
#REL=`git rev-parse --abbrev-ref HEAD`
|
||||
REL=`git name-rev --name-only HEAD`
|
||||
if [ "$REL" = "master" ]; then
|
||||
REL="devel"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$REL" = "xcat-core" ]; then # using git
|
||||
GIT=1
|
||||
setbranch # this changes the REL variable
|
||||
fi
|
||||
|
||||
# this is needed only when we are transitioning the yum over to frs
|
||||
if [ "$FRSYUM" != 0 ]; then
|
||||
YUMDIR=$FRS
|
||||
@@ -80,27 +98,12 @@ fi
|
||||
if [ -n "$EMBED" ]; then EMBEDDIR="/$EMBED"
|
||||
else EMBEDDIR=""; fi
|
||||
XCATCORE="xcat-core" # core-snap is a sym link to xcat-core
|
||||
echo "svn --quiet up Version"
|
||||
svn --quiet up Version
|
||||
VER=`cat Version`
|
||||
SHORTVER=`cat Version|cut -d. -f 1,2`
|
||||
SHORTSHORTVER=`cat Version|cut -d. -f 1`
|
||||
if [ "$PROMOTE" = 1 ]; then
|
||||
CORE="xcat-core"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-$VER.tar.gz
|
||||
else
|
||||
TARNAME=xcat-core-$VER.tar.bz2
|
||||
fi
|
||||
|
||||
if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms
|
||||
DESTDIR=../../$REL$EMBEDDIR/$XCATCORE
|
||||
else
|
||||
CORE="core-snap"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-snap.tar.gz
|
||||
else
|
||||
TARNAME=core-rpms-snap.tar.bz2
|
||||
fi
|
||||
DESTDIR=../..$EMBEDDIR/$XCATCORE
|
||||
fi
|
||||
DESTDIR=../..$EMBEDDIR/$XCATCORE
|
||||
SRCD=core-snap-srpms
|
||||
|
||||
# currently aix builds ppc rpms, but someday it should build noarch
|
||||
@@ -110,8 +113,21 @@ else
|
||||
NOARCH=noarch
|
||||
fi
|
||||
|
||||
function setversionvars {
|
||||
VER=`cat Version`
|
||||
SHORTVER=`cat Version|cut -d. -f 1,2`
|
||||
SHORTSHORTVER=`cat Version|cut -d. -f 1`
|
||||
}
|
||||
|
||||
|
||||
if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting
|
||||
# we are doing a snap build
|
||||
CORE="core-snap"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-snap.tar.gz
|
||||
else
|
||||
TARNAME=core-rpms-snap.tar.bz2
|
||||
fi
|
||||
mkdir -p $DESTDIR
|
||||
SRCDIR=$DESTDIR/../$SRCD
|
||||
mkdir -p $SRCDIR
|
||||
@@ -132,13 +148,33 @@ else
|
||||
#echo "source=$source"
|
||||
fi
|
||||
|
||||
# If they have not given us a premade update file, do an svn update and capture the results
|
||||
if [ -z "$SVNUP" ]; then
|
||||
SVNUP=../coresvnup
|
||||
echo "svn up > $SVNUP"
|
||||
svn up > $SVNUP
|
||||
# If they have not given us a premade update file, do an svn update or git pull and capture the results
|
||||
SOMETHINGCHANGED=0
|
||||
if [ "$GIT" = "1" ]; then # using git
|
||||
if [ -z "$GITUP" ]; then
|
||||
GITUP=../coregitup
|
||||
echo "git pull > $GITUP"
|
||||
git pull > $GITUP
|
||||
fi
|
||||
if ! $GREP 'Already up-to-date' $GITUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
else # using svn
|
||||
GIT=0
|
||||
if [ -z "$SVNUP" ]; then
|
||||
SVNUP=../coresvnup
|
||||
echo "svn up > $SVNUP"
|
||||
svn up > $SVNUP
|
||||
fi
|
||||
if ! $GREP 'At revision' $SVNUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
# copy the SVNUP variable to GITUP so the rest of the script doesnt have to worry whether we did svn or git
|
||||
GITUP=$SVNUP
|
||||
fi
|
||||
|
||||
setversionvars
|
||||
|
||||
# Process for making most of the rpms
|
||||
function maker {
|
||||
rpmname="$1"
|
||||
@@ -154,7 +190,7 @@ function maker {
|
||||
}
|
||||
|
||||
# If anything has changed, we should always rebuild perl-xCAT
|
||||
if ! $GREP 'At revision' $SVNUP; then # Use to be: $GREP perl-xCAT $SVNUP; then
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # Use to be: $GREP perl-xCAT $GITUP; then
|
||||
UPLOAD=1
|
||||
maker perl-xCAT
|
||||
fi
|
||||
@@ -165,7 +201,7 @@ fi
|
||||
|
||||
# Build the rest of the noarch rpms
|
||||
for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test; do
|
||||
if $GREP $rpmname $SVNUP; then
|
||||
if $GREP $rpmname $GITUP || [ "$BUILDALL" == 1 ]; then
|
||||
UPLOAD=1
|
||||
if [ "$EMBED" = "zvm" -a "$rpmname" != "xCAT-server" -a "$rpmname" != "xCAT-UI" ]; then continue; fi # for embedded envs only need to build server special
|
||||
maker $rpmname
|
||||
@@ -177,27 +213,10 @@ for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test; d
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$OSNAME" != "AIX" -a "$EMBED" != "zvm" ]; then
|
||||
if $GREP -v nbroot2 $SVNUP|$GREP xCAT-nbroot; then
|
||||
UPLOAD=1
|
||||
ORIGFAILEDRPMS="$FAILEDRPMS"
|
||||
for arch in x86_64 x86 ppc64; do
|
||||
./makerpm xCAT-nbroot-core $arch
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS xCAT-nbroot-core-$arch"; fi
|
||||
done
|
||||
if [ "$FAILEDRPMS" = "$ORIGFAILEDRPMS" ]; then # all succeeded
|
||||
rm -f $DESTDIR/xCAT-nbroot-core*rpm
|
||||
rm -f $SRCDIR/xCAT-nbroot-core*rpm
|
||||
mv $source/RPMS/noarch/xCAT-nbroot-core-*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-nbroot-core-*rpm $SRCDIR
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Build the xCAT and xCATsn rpms for all platforms
|
||||
for rpmname in xCAT xCATsn; do
|
||||
if [ "$EMBED" = "zvm" ]; then break; fi
|
||||
if $GREP -E "^[UAD] +$rpmname/" $SVNUP; then
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $GITUP; then
|
||||
UPLOAD=1
|
||||
ORIGFAILEDRPMS="$FAILEDRPMS"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
@@ -271,8 +290,8 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
echo "Signing RPMs..."
|
||||
build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
createrepo $DESTDIR
|
||||
createrepo $SRCDIR
|
||||
createrepo --checksum sha $DESTDIR # specifying checksum so the repo will work on rhel5
|
||||
createrepo --checksum sha $SRCDIR
|
||||
rm -f $SRCDIR/repodata/repomd.xml.asc
|
||||
rm -f $DESTDIR/repodata/repomd.xml.asc
|
||||
gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
|
||||
@@ -301,7 +320,17 @@ chmod -R g+w $DESTDIR
|
||||
chgrp -R xcat $SRCDIR
|
||||
chmod -R g+w $SRCDIR
|
||||
|
||||
fi # end of very long if-not-promote
|
||||
else # end of very long if-not-promote
|
||||
# we are only promoting (not building)
|
||||
setversionvars
|
||||
setbranch
|
||||
CORE="xcat-core"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-$VER.tar.gz
|
||||
else
|
||||
TARNAME=xcat-core-$VER.tar.bz2
|
||||
fi
|
||||
fi
|
||||
|
||||
cd $DESTDIR
|
||||
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
<packagereq type="required">xCAT-server</packagereq>
|
||||
<packagereq type="required">xCAT-client</packagereq>
|
||||
<packagereq type="required">perl-xCAT</packagereq>
|
||||
<packagereq type="required">xCAT-nbroot-core-x86_64</packagereq>
|
||||
<packagereq type="required">xCAT-nbroot-core-x86</packagereq>
|
||||
<packagereq type="optional">xCAT-nbroot-core-ppc64</packagereq>
|
||||
</packagelist>
|
||||
</group>
|
||||
</comps>
|
||||
|
||||
+5
-18
@@ -1,34 +1,21 @@
|
||||
#!/bin/sh
|
||||
# Put the version, svn revision #, and build date into the Version function in Version.pm
|
||||
|
||||
if [ -z "$2" ]
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "modifyUtils: Error: must specify the xCAT version and svn revision number as arguments" >&2
|
||||
echo "modifyUtils: Error: must specify the xCAT version as an argument" >&2
|
||||
exit
|
||||
fi
|
||||
|
||||
VER=$1
|
||||
SVNREF="svn r$2, "
|
||||
|
||||
#SVNINFO=`svn info 2>/dev/null|grep Revision`
|
||||
#/bin/echo -e $SVNINFO
|
||||
#if [ $? -ne 0 -a -f .svninfo ]; then
|
||||
# SVNINFO=`cat .svninfo 2>/dev/null|grep Revision`
|
||||
#fi
|
||||
#if [ $? -eq 0 ]
|
||||
# then
|
||||
# SVNREF="svn r"`echo $SVNINFO|awk '{print $2}'`", "
|
||||
# else
|
||||
# SVNREF=""
|
||||
# fi
|
||||
|
||||
BUILDDATE=`date`
|
||||
#echo ". '(${SVNREF}built $BUILDDATE)'"
|
||||
#echo ". '(built $BUILDDATE)'"
|
||||
|
||||
if [ "$(uname)" = "AIX" ]
|
||||
then
|
||||
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
|
||||
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
|
||||
mv xCAT/Version.pm.new xCAT/Version.pm
|
||||
else
|
||||
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm
|
||||
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ xCAT/Version.pm
|
||||
fi
|
||||
|
||||
@@ -24,7 +24,6 @@ Provides perl xCAT libraries for core functionality. Required for all xCAT inst
|
||||
Includes xCAT::Table, xCAT::NodeRange, among others.
|
||||
|
||||
%define zvm %(if [ "$zvm" = "1" ];then echo 1; else echo 0; fi)
|
||||
%define svninfo %(svn info | grep Revision | awk '{print $2}')
|
||||
|
||||
%prep
|
||||
%setup -q -n perl-xCAT
|
||||
@@ -34,7 +33,7 @@ Includes xCAT::Table, xCAT::NodeRange, among others.
|
||||
# as it is in svn.
|
||||
|
||||
# Modify the Version() function in xCAT/Utils.pm to automatically have the correct version
|
||||
./modifyUtils %{version} %{svninfo}
|
||||
./modifyUtils %{version}
|
||||
|
||||
# Build the pod version of the man pages for each DB table. It puts them in the man5 and man7 subdirs.
|
||||
# Then convert the pods to man pages and html pages.
|
||||
@@ -105,6 +104,18 @@ rm -rf $RPM_BUILD_ROOT
|
||||
# Just package everything that has been copied into RPM_BUILD_ROOT
|
||||
%{prefix}
|
||||
|
||||
%pre
|
||||
# only need to check on AIX
|
||||
%ifnos linux
|
||||
if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd
|
||||
/usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found
|
||||
if [ $? = 0 ]; then
|
||||
echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation."
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
%post
|
||||
%ifos linux
|
||||
if [ "$1" -gt 1 ]; then #Ugrade only, restart daemon and migrate settings
|
||||
|
||||
+129
-40
@@ -35,6 +35,9 @@ unless ($inet6support) {
|
||||
|
||||
|
||||
use XML::Simple; #smaller than libxml....
|
||||
use Fcntl;
|
||||
use POSIX qw/:errno_h/;
|
||||
use IO::Select;
|
||||
$XML::Simple::PREFERRED_PARSER='XML::Parser';
|
||||
#require Data::Dumper;
|
||||
my $xcathost='localhost:3001';
|
||||
@@ -44,6 +47,30 @@ my $EXITCODE; # save the bitmask of all exit codes returned by calls to hand
|
||||
1;
|
||||
|
||||
|
||||
sub rspclean {
|
||||
my $response = shift;
|
||||
my $callback = shift;
|
||||
my $rsps = XMLin($response,SuppressEmpty=>undef,ForceArray=>1);
|
||||
foreach my $rsp (@{$rsps->{xcatresponse}}) {
|
||||
#add ESC back
|
||||
foreach my $key (keys %$rsp) {
|
||||
if (ref($rsp->{$key}) eq 'ARRAY') {
|
||||
foreach my $text (@{$rsp->{$key}}) {
|
||||
next unless defined $text;
|
||||
$text =~ s/xxxxESCxxxx/\e/g;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$rsp->{$key} =~ s/xxxxESCxxxx/\e/g;
|
||||
}
|
||||
}
|
||||
$callback->($rsp);
|
||||
if ($rsp->{serverdone}) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#################################
|
||||
# submit_request will take an xCAT command and pass it to the xCAT
|
||||
# server for execution.
|
||||
@@ -91,13 +118,22 @@ sub submit_request {
|
||||
unless ($certfile) { $certfile = $homedir."/.xcat/client-cred.pem"; }
|
||||
unless ($cafile) { $cafile = $homedir."/.xcat/ca.pem"; }
|
||||
$xCAT::Client::EXITCODE = 0; # clear out exit code before invoking the plugin
|
||||
$request->{clienttype}->[0] = "cli"; # setup clienttype for auditlog
|
||||
if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
$request->{clienttype}->[0] = "cli"; # setup clienttype for auditlog
|
||||
}
|
||||
# If XCATBYPASS is set, invoke the plugin process_request method directly
|
||||
# without going through the socket connection to the xcatd daemon
|
||||
if ($ENV{XCATBYPASS}) {
|
||||
#add current userid to the request
|
||||
if (!(defined($request->{username}))) {
|
||||
$request->{username}->[0] = getpwuid($>);
|
||||
if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
if (!(defined($request->{username}))) {
|
||||
$request->{username}->[0] = getpwuid($>);
|
||||
}
|
||||
# only allow root to run
|
||||
unless ($request->{username}->[0] =~ /root/) {
|
||||
print ("WARNING: Only allow root to run XCATBYPASS mode, your current user ID is $request->{username}->[0].\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
# Load plugins from either specified or default dir
|
||||
require xCAT::Table;
|
||||
@@ -134,22 +170,41 @@ $request->{clienttype}->[0] = "cli"; # setup clienttype for auditlog
|
||||
if ($ENV{XCATHOST}) {
|
||||
$xcathost=$ENV{XCATHOST};
|
||||
}
|
||||
my $client;
|
||||
if (-r $keyfile and -r $certfile and -r $cafile) {
|
||||
$client = IO::Socket::SSL->new(
|
||||
my $pclient;
|
||||
if ($inet6support) {
|
||||
$pclient = IO::Socket::INET6->new(
|
||||
PeerAddr => $xcathost,
|
||||
SSL_key_file => $keyfile,
|
||||
SSL_cert_file => $certfile,
|
||||
SSL_ca_file => $cafile,
|
||||
SSL_use_cert => 1,
|
||||
Timeout => 15,
|
||||
);
|
||||
} else {
|
||||
$client = IO::Socket::SSL->new(
|
||||
$pclient = IO::Socket::INET->new(
|
||||
PeerAddr => $xcathost,
|
||||
Timeout => 15,
|
||||
);
|
||||
}
|
||||
unless ($pclient) {
|
||||
print "Unable to open socket connection to xcatd daemon on $xcathost.\n";
|
||||
print "Verify that the xcatd daemon is running and that your SSL setup is correct.\n";
|
||||
if ($@ =~ /SSL Timeout/) {
|
||||
die "Connection failure: SSL Timeout or incorrect certificates in ~/.xcat";
|
||||
} else {
|
||||
die "Connection failure: $@"
|
||||
}
|
||||
}
|
||||
my $client;
|
||||
if (-r $keyfile and -r $certfile and -r $cafile) {
|
||||
$client = IO::Socket::SSL->start_SSL($pclient,
|
||||
SSL_key_file => $keyfile,
|
||||
SSL_cert_file => $certfile,
|
||||
SSL_ca_file => $cafile,
|
||||
SSL_use_cert => 1,
|
||||
Timeout => 0,
|
||||
);
|
||||
} else {
|
||||
$client = IO::Socket::SSL->start_SSL($pclient,
|
||||
Timeout => 0,
|
||||
);
|
||||
}
|
||||
unless ($client) {
|
||||
print "Unable to open socket connection to xcatd daemon on $xcathost.\n";
|
||||
print "Verify that the xcatd daemon is running and that your SSL setup is correct.\n";
|
||||
@@ -159,7 +214,13 @@ $request->{clienttype}->[0] = "cli"; # setup clienttype for auditlog
|
||||
die "Connection failure: $@"
|
||||
}
|
||||
}
|
||||
my $msg=XMLout($request,RootName=>'xcatrequest',NoAttr=>1,KeyAttr=>[]);
|
||||
|
||||
my $msg;
|
||||
if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
$msg=XMLout($request,RootName=>'xcatrequest',NoAttr=>1,KeyAttr=>[]);
|
||||
} else { #XML
|
||||
$msg=$request;
|
||||
}
|
||||
if ($ENV{XCATXMLTRACE}) { print $msg; }
|
||||
if($ENV{XCATXMLWARNING}) {
|
||||
validateXML($msg);
|
||||
@@ -169,39 +230,60 @@ $request->{clienttype}->[0] = "cli"; # setup clienttype for auditlog
|
||||
my $response;
|
||||
my $rsp;
|
||||
my $cleanexit=0;
|
||||
while (<$client>) {
|
||||
$response .= $_;
|
||||
if (m/<\/xcatresponse>/) {
|
||||
my $massresponse="<massresponse>";
|
||||
my $nextcoalescetime=time()+1;
|
||||
my $coalescenow=0;
|
||||
my $flags=fcntl($client,F_GETFL,0);
|
||||
$flags |= O_NONBLOCK; #select can be a bit.. fickle, make sysread work more easily...
|
||||
fcntl($client,F_SETFL,$flags);
|
||||
my $clientsel = new IO::Select;
|
||||
$clientsel->add($client);
|
||||
my $line;
|
||||
my $newdata=0;
|
||||
while (1) {
|
||||
my $shouldexit;
|
||||
if ($newdata and ($coalescenow or time() > $nextcoalescetime)) {
|
||||
$coalescenow=0;
|
||||
$newdata=0;
|
||||
$nextcoalescetime=time()+1;
|
||||
$massresponse .= "</massresponse>";
|
||||
$shouldexit = rspclean($massresponse,$callback);
|
||||
$massresponse="<massresponse>";
|
||||
}
|
||||
|
||||
if ($shouldexit) {
|
||||
$cleanexit=1;
|
||||
last;
|
||||
}
|
||||
$line = "";
|
||||
$clientsel->can_read(0.5);
|
||||
my $readbytes;
|
||||
do { $readbytes=sysread($client,$line,65535,length($line)); } while ($readbytes);
|
||||
unless (length($line)) {
|
||||
if (not defined $readbytes and $! == EAGAIN) { next; }
|
||||
last;
|
||||
}
|
||||
$newdata=1;
|
||||
$response .= $line;
|
||||
if ($line =~ m/<\/xcatresponse>\s*\z/) {
|
||||
if ($line =~ /serverdone/) { $coalescenow=1; } #if serverdone was detected, hint at coalesce code to flush things out now
|
||||
#this means that coalesce can be triggered by stray words in the output prematurely, but that's harmless
|
||||
#replace ESC with xxxxESCxxx because XMLin cannot handle it
|
||||
$response =~ s/\e/xxxxESCxxxx/g;
|
||||
|
||||
if ($ENV{XCATXMLTRACE}) { print $response; }
|
||||
$rsp = XMLin($response,SuppressEmpty=>undef,ForceArray=>1);
|
||||
$massresponse.=$response;
|
||||
$response='';
|
||||
if($ENV{XCATXMLWARNING}) {
|
||||
validateXML($response);
|
||||
}
|
||||
|
||||
#add ESC back
|
||||
foreach my $key (keys %$rsp) {
|
||||
if (ref($rsp->{$key}) eq 'ARRAY') {
|
||||
foreach my $text (@{$rsp->{$key}}) {
|
||||
next unless defined $text;
|
||||
$text =~ s/xxxxESCxxxx/\e/g;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$rsp->{$key} =~ s/xxxxESCxxxx/\e/g;
|
||||
}
|
||||
}
|
||||
|
||||
$response='';
|
||||
$callback->($rsp);
|
||||
if ($rsp->{serverdone}) {
|
||||
$cleanexit=1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (not $cleanexit and $massresponse ne "<massresponse>") {
|
||||
$massresponse .= "</massresponse>";
|
||||
$cleanexit = rspclean($massresponse,$callback);
|
||||
}
|
||||
$massresponse="";
|
||||
unless ($cleanexit) {
|
||||
print STDERR "ERROR/WARNING: communication with the xCAT server seems to have been ended prematurely\n";
|
||||
}
|
||||
@@ -301,6 +383,12 @@ sub plugin_command {
|
||||
require xCAT::Table;
|
||||
|
||||
$Main::resps={};
|
||||
my $xmlreq;
|
||||
if (ref($req) ne 'HASH') { # the request XML, get an array
|
||||
$xmlreq=$req; # save the original XML
|
||||
$req = XMLin($xmlreq,SuppressEmpty=>undef,ForceArray=>1) ;
|
||||
|
||||
}
|
||||
my @nodes;
|
||||
if ($req->{node}) {
|
||||
@nodes = @{$req->{node}};
|
||||
@@ -320,10 +408,6 @@ sub plugin_command {
|
||||
$req->{emptynoderange} = [1];
|
||||
}
|
||||
|
||||
if(@nodes == 0 ) {
|
||||
print "No nodes or noderanges specified\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (@nodes) { $req->{node} = \@nodes; }
|
||||
my %unhandled_nodes;
|
||||
@@ -891,6 +975,11 @@ sub build_response {
|
||||
##########################################
|
||||
sub handle_response {
|
||||
my $rsp = shift;
|
||||
if ($ENV{'XCATSHOWXML'}) {
|
||||
my $xmlrec=XMLout($rsp,RootName=>'xcatresponse',NoAttr=>1,KeyAttr=>[]);
|
||||
print "$xmlrec\n";
|
||||
return;
|
||||
}
|
||||
#print "in handle_response\n";
|
||||
# Handle errors
|
||||
if ($rsp->{errorcode}) {
|
||||
|
||||
Regular → Executable
+52
-8
@@ -199,7 +199,7 @@ sub getobjattrs
|
||||
# list of object names
|
||||
foreach my $table (keys %tableattrs) {
|
||||
# open the table
|
||||
my $thistable = xCAT::Table->new($table, -create => 1, -autocommit => 0);
|
||||
my $thistable = xCAT::Table->new($table, -create => 1, -autocommit => 1);
|
||||
if (!$thistable) {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Could not open the \'$table\' table.";
|
||||
@@ -395,6 +395,44 @@ sub getobjdefs
|
||||
xCAT::MsgUtils->message("E", $rsp, $::callback);
|
||||
}
|
||||
}
|
||||
} elsif (($objtype eq 'auditlog') || ($objtype eq 'eventlog')) {
|
||||
# Special case for auditlog/eventlog
|
||||
# All the auditlog/eventlog attributes are in auditlog/eventlog table,
|
||||
# Do not need to read the table multiple times for each attribute.
|
||||
# The auditlog/eventlog is likely be very big over time,
|
||||
# performance is a big concern with the general logic
|
||||
my @TableRowArray = xCAT::DBobjUtils->getDBtable($objtype);
|
||||
foreach my $objname (sort @{$type_obj{$objtype}}) {
|
||||
if (@TableRowArray)
|
||||
{
|
||||
my $foundinfo = 0;
|
||||
foreach my $entry (@TableRowArray)
|
||||
{
|
||||
if ($entry->{recid} eq $objname)
|
||||
{
|
||||
foreach my $k (keys %{$entry})
|
||||
{
|
||||
# recid is the object name, do not need to be in the attributes list
|
||||
if ($k eq 'recid') { next; }
|
||||
if (defined($entry->{$k}) ) {
|
||||
$foundinfo++;
|
||||
if ($verbose == 1) {
|
||||
$objhash{$objname}{$k} = "$entry->{$k}\t(Table:$objtype - Key:$k)";
|
||||
} else {
|
||||
$objhash{$objname}{$k} = $entry->{$k};
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($foundinfo)
|
||||
{
|
||||
$objhash{$objname}{'objtype'} = $objtype;
|
||||
}
|
||||
# There should not be multiple entries with the same recid
|
||||
last;
|
||||
} # end if($entry->
|
||||
} # end foreach my $entry
|
||||
} # end if(@TableTowArray
|
||||
} # end foreach my $objname
|
||||
} else {
|
||||
# get the object type decription from Schema.pm
|
||||
my $datatype = $xCAT::Schema::defspec{$objtype};
|
||||
@@ -578,7 +616,7 @@ sub getDBtable
|
||||
{
|
||||
|
||||
# need to get info from DB
|
||||
my $thistable = xCAT::Table->new($table, -create => 1, -autocommit => 0);
|
||||
my $thistable = xCAT::Table->new($table, -create => 1);
|
||||
if (!$thistable)
|
||||
{
|
||||
return undef;
|
||||
@@ -2115,7 +2153,7 @@ sub getchildren
|
||||
$::RUNCMD_RC = 1;
|
||||
return undef;
|
||||
}
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype','hcp']);
|
||||
foreach my $entry ( @ps ) {
|
||||
my $p = $entry->{parent};
|
||||
my $c = $entry->{node};
|
||||
@@ -2126,13 +2164,19 @@ sub getchildren
|
||||
# build hash of ppc.parent -> ppc.node
|
||||
push @{$PPCHASH{$p}}, $c;
|
||||
}
|
||||
elsif ($t eq 'blade') {
|
||||
push @{$PPCHASH{$c}}, $entry->{hcp};
|
||||
}
|
||||
} else { # go look in the nodetype table to find nodetype
|
||||
my $type = getnodetype($c);
|
||||
my $type = getnodetype($c, "ppc");
|
||||
if ( $type eq 'fsp' or $type eq 'bpa')
|
||||
{
|
||||
# build hash of ppc.parent -> ppc.node
|
||||
push @{$PPCHASH{$p}}, $c;
|
||||
}
|
||||
elsif ($type eq "blade") {
|
||||
push @{$PPCHASH{$c}}, $entry->{hcp};
|
||||
}
|
||||
}
|
||||
} # not $p and $c
|
||||
}
|
||||
@@ -2278,11 +2322,11 @@ sub getnodetype
|
||||
##################################################
|
||||
# give error msg for the nodes can't get nodetype
|
||||
##################################################
|
||||
if ( @failnodes1 ) {
|
||||
my $nodelist = join(",", @failnodes1);
|
||||
xCAT::MsgUtils->message('S', "getnodetype:Can't find these nodes' type: $nodelist.\n");
|
||||
}
|
||||
}
|
||||
if ( @failnodes1 ) {
|
||||
my $nodelist = join(",", @failnodes1);
|
||||
xCAT::MsgUtils->message('S', "getnodetype:Can't find these nodes' type: $nodelist.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
#####################
|
||||
|
||||
+53
-22
@@ -777,6 +777,7 @@ sub fork_fanout_dcp
|
||||
#eval "require RemoteShell::$rsh_extension";
|
||||
eval "require xCAT::$rsh_extension";
|
||||
my $remoteshell = "xCAT::$rsh_extension";
|
||||
# HERE: Build the dcp command based on the arguments
|
||||
@dcp_command =
|
||||
$remoteshell->remote_copy_command(\%rcp_config, $remote_copy);
|
||||
|
||||
@@ -4073,23 +4074,6 @@ sub parse_and_run_dcp
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ($options{'File'})
|
||||
{
|
||||
|
||||
# input -F file is copied to tmp file on a service node
|
||||
if (xCAT::Utils->isServiceNode())
|
||||
{ # running on service node
|
||||
$options{'File'} = "/tmp/xcatrf.tmp";
|
||||
}
|
||||
my $syncfile = $options{'File'};
|
||||
if (!-f $options{'File'})
|
||||
{
|
||||
my $rsp = ();
|
||||
$rsp->{data}->[0] = "File:$syncfile does not exist.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
# invalid to put the -F with the -r flag
|
||||
if ($options{'File'} && $options{'node-rcp'})
|
||||
@@ -4207,6 +4191,17 @@ sub parse_and_run_dcp
|
||||
$synfiledir = $syndir[0];
|
||||
}
|
||||
|
||||
# input -F file is sync'd to site.syncfiledir on the service node
|
||||
# filename directory already changed
|
||||
my $syncfile = $options{'File'};
|
||||
if (!-f $options{'File'})
|
||||
{
|
||||
my $rsp = ();
|
||||
$rsp->{data}->[0] = "File:$syncfile does not exist.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
my $rc;
|
||||
my $syncfile = $options{'File'};
|
||||
# the parsing of the file will fill in an array of postscripts
|
||||
@@ -4220,9 +4215,36 @@ sub parse_and_run_dcp
|
||||
}
|
||||
else
|
||||
{ # running on MN
|
||||
# build the files to sync from the nodes sync file
|
||||
$rc =
|
||||
&parse_rsync_input_file_on_MN(\@nodelist, \%options, $syncfile,
|
||||
$::SYNCSN, $synfiledir);
|
||||
if ($::SYNCSN ==1) { # syncing a servicenode
|
||||
# build a temporary syncfile for the node's synclist
|
||||
# we need to make sure the latest is on the servicenode
|
||||
# for running of the syncfiles postscript, which only pulls
|
||||
# from the service node
|
||||
my $tmpsyncfile="/tmp/xdcpsynclist.$$";
|
||||
my $syncline = "$syncfile -> $syncfile";
|
||||
open(FILE, ">$tmpsyncfile")
|
||||
or die "cannot open file $tmpsyncfile\n";
|
||||
print FILE " $syncline";
|
||||
close FILE;
|
||||
# now put the original syncfile on the queue to sync to the SN's
|
||||
$rc =
|
||||
&parse_rsync_input_file_on_MN(\@nodelist, \%options,
|
||||
$tmpsyncfile, $::SYNCSN, $synfiledir);
|
||||
# cleanup
|
||||
my $cmd = "rm $tmpsyncfile";
|
||||
my @output = xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{data}->[0] = "Command: $cmd failed.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if ($rc == 1)
|
||||
{
|
||||
@@ -4251,9 +4273,13 @@ sub parse_and_run_dcp
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$options{'target'} = '';
|
||||
$options{'source'} = pop @ARGV;
|
||||
{
|
||||
# HERE:only one line of input source and target in that line
|
||||
# such as xdcp -R " /test/* /test"
|
||||
my $tmparg = pop @ARGV;
|
||||
my ($src,$tgt) = split " ", $tmparg;
|
||||
$options{'target'} = $tgt;
|
||||
$options{'source'} = join $::__DCP_DELIM, $src;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4266,6 +4292,7 @@ sub parse_and_run_dcp
|
||||
|
||||
else
|
||||
{
|
||||
# Get the source and the target
|
||||
$options{'target'} = pop @ARGV;
|
||||
$options{'source'} = join $::__DCP_DELIM, @ARGV;
|
||||
}
|
||||
@@ -4273,6 +4300,7 @@ sub parse_and_run_dcp
|
||||
}
|
||||
|
||||
# Execute the dcp api
|
||||
# HERE: Run xdcp
|
||||
@results = xCAT::DSHCLI->runDcp_api(\%options, 0);
|
||||
$::FAILED_NODES = $::RUNCMD_RC;
|
||||
|
||||
@@ -4453,13 +4481,16 @@ sub rsync_to_image
|
||||
|
||||
Globals:
|
||||
|
||||
|
||||
$::SYNCSN indicates we are only syncing the files to the
|
||||
service nodes xdcp -s flag
|
||||
Error:
|
||||
None
|
||||
|
||||
Example:
|
||||
|
||||
Comments:
|
||||
We also add the original synclist file for the node to be sync'd
|
||||
to the service node
|
||||
|
||||
=cut
|
||||
|
||||
@@ -4820,7 +4851,7 @@ sub run_rsync_postscripts
|
||||
|
||||
# now remove .post from the postscript file for the compare
|
||||
# with the returned file name
|
||||
my($tp,$post) = split(/.post/,$tmppostfile);
|
||||
my($tp,$post) = split(/\.post/,$tmppostfile);
|
||||
$tmppostfile = $tp;
|
||||
foreach my $line (@rsync_output) {
|
||||
my($hostname,$ps) = split(/: /, $line);
|
||||
|
||||
@@ -709,8 +709,19 @@ sub pping_hostnames
|
||||
my ($class, @hostnames) = @_;
|
||||
|
||||
my $hostname_list = join ",", @hostnames;
|
||||
# read site table, usefping attribute
|
||||
# if set then run pping -f to use fping
|
||||
# this fixes a broken nmap in Redhat 6.2 with ip alias (3512)
|
||||
my $cmd="$::XCATROOT/bin/pping $hostname_list"; # default
|
||||
my @usefping=xCAT::Utils->get_site_attribute("usefping");
|
||||
if ((defined($usefping[0])) && ($usefping[0] eq "1")) {
|
||||
$cmd = "$::XCATROOT/bin/pping -f $hostname_list";
|
||||
}
|
||||
#my $rsp={};
|
||||
#$rsp->{data}->[0] = "running command $cmd";
|
||||
#xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
my @output =
|
||||
xCAT::Utils->runcmd("$::XCATROOT/bin/pping $hostname_list", -1);
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC !=0) {
|
||||
my $rsp={};
|
||||
$rsp->{data}->[0] = "Error from pping";
|
||||
|
||||
+251
-63
@@ -30,6 +30,213 @@ require xCAT::Utils;
|
||||
require xCAT::NodeRange;
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 getHcpAttribs
|
||||
Description:
|
||||
Build 2 Hashes from ppc/vpd table
|
||||
one hash is : CEC/Frame is the Key, FSPs/BPAs are the value.
|
||||
the other is: fsp/bpa is the key, the side is the value.
|
||||
|
||||
Arguments:
|
||||
$request: this hash will be usded to store the ppc hash and vpd hash
|
||||
$tabs: the hash store the new tables for ppc and bpd.
|
||||
Returns:
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example: xCAT::FSPUtils::getPPCAttribs($request, \%tabs);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub getHcpAttribs
|
||||
{
|
||||
my $request = shift;
|
||||
my $tabs = shift;
|
||||
my %ppchash ;
|
||||
my %vpd ;
|
||||
|
||||
my @vs = $tabs->{vpd}->getAllNodeAttribs(['node', 'side']);
|
||||
for my $entry ( @vs ) {
|
||||
my $tmp_node = $entry->{node};
|
||||
my $tmp_side = $entry->{side};
|
||||
if(defined($tmp_node) && defined($tmp_side)) {
|
||||
$vpd{$tmp_node} = $tmp_side ;
|
||||
}
|
||||
}
|
||||
|
||||
my @ps = $tabs->{ppc}->getAllNodeAttribs(['node','parent','nodetype', 'hcp']);
|
||||
for my $entry ( @ps ) {
|
||||
my $tmp_parent = $entry->{parent};
|
||||
my $tmp_node = $entry->{node};
|
||||
my $tmp_type = $entry->{nodetype};
|
||||
if(defined($tmp_node) && defined($tmp_type) && ($tmp_type =~ /^(fsp|bpa)$/ && $tmp_parent) ) {
|
||||
push @{$ppchash{$tmp_parent}{children}}, $tmp_node;
|
||||
#push @{$ppchash{$tmp_parent}}, $tmp_node;
|
||||
}
|
||||
if (defined($tmp_node) && defined($tmp_type) && ($tmp_type eq "blade") && defined($entry->{hcp})) {
|
||||
push @{$ppchash{$tmp_node}{children}}, $entry->{hcp};
|
||||
}
|
||||
|
||||
#if(exists($ppchash{$tmp_node})) {
|
||||
# if( defined($tmp_type) ) {
|
||||
# #push @{$ppchash{$tmp_node}{type}}, $tmp_type;
|
||||
# } else {
|
||||
# my %output;
|
||||
# my $msg = "no type for $tmp_type in the ppc table.";
|
||||
# $output{errorcode} = 1;
|
||||
# $output{data} = $msg;
|
||||
# $request->{callback}->( \%output );
|
||||
# }
|
||||
#}
|
||||
}
|
||||
|
||||
$request->{ppc}=\%ppchash ;
|
||||
$request->{vpd}=\%vpd ;
|
||||
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 getIPaddress
|
||||
Description:
|
||||
Used by DFM related functions. When getting the IPs for CECs' FSPs, or
|
||||
getting the IPs for Frames' BPAs. And the IPs order is A-0,A-1,B-0,B-1.
|
||||
When getting the IP for one FSP or one BPA, if the $nodetocheck it one IP,
|
||||
it will return the IP immediately; if not, it will get the IP of the FSP or BPA.
|
||||
|
||||
Arguments:
|
||||
$request: Because getIPaddress() is always used for one node after the process fork. Avoiding to
|
||||
access the DB for each node in the subprocess, we should collect the attributs before
|
||||
process fork, and put the attributes in the $request variable. For the getIpaddress().
|
||||
The $request parameter should include the ppc hash which mapping the CEC->FSPs and
|
||||
Frames->BPAs, and vpd hash the fsp->side and the bpa->side.
|
||||
$type: the type of the $nodetocheck
|
||||
$nodetocheck: Node name, only one node at a time.
|
||||
$port: if the $nodetocheck is a fsp or bpa, it will be usde.
|
||||
Returns: ip address(s)
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example: my $c1 = xCAT::FSPUtils::getIPaddress($request, $type, $nodetocheck);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub getIPaddress
|
||||
{
|
||||
# require xCAT::Table;
|
||||
my $request = shift;
|
||||
my $type = shift;
|
||||
my $nodetocheck = shift;
|
||||
my $port = shift;
|
||||
if (xCAT::Utils::isIpaddr($nodetocheck)) {
|
||||
return $nodetocheck;
|
||||
}
|
||||
my $side = "[A|B]";
|
||||
if (!defined($port)) {
|
||||
$port = "[0|1]";
|
||||
}
|
||||
|
||||
my $ppc = $request->{ppc};
|
||||
my $vpd = $request->{vpd};
|
||||
|
||||
# only need to parse IP addresses for Frame/CEC/BPA/FSP
|
||||
|
||||
#my $type = xCAT::DBobjUtils->getnodetype($nodetocheck);
|
||||
#my $type = $$attrs[4];
|
||||
if ($type) {
|
||||
my @children;
|
||||
my %node_side_pairs = ();
|
||||
my $children_num = 0;
|
||||
my $parent;
|
||||
if ($type eq "bpa" or $type eq "fsp") {
|
||||
|
||||
push @children, $nodetocheck;
|
||||
|
||||
#my $tmp_s = $vpdtab->getNodeAttribs($nodetocheck, ['side']);
|
||||
my $tmp_s = $vpd->{$nodetocheck};
|
||||
if ($tmp_s and $tmp_s =~ /(A|B)-\d/i) {
|
||||
$side = $1; # get side for the fsp
|
||||
|
||||
} else {
|
||||
return -3;
|
||||
}
|
||||
} elsif ($type eq "frame" or $type eq "cec" or ($type =~ /lpar/i)) {
|
||||
#In DFM
|
||||
#1. when the node type is frame, its hcp( $nodetocheck ) is frame,
|
||||
#and it will get the BPAs IPs for the Frame.
|
||||
#2. when the node type is CEC, its hcp( $nodetocheck ) is CEC,
|
||||
#and it will get the FSPs IPs for the CEC.
|
||||
#3. when the node type is lpar, its hcp is the CEC.
|
||||
#the $nodetocheck is its' hcp. So set $nodetocheck to $parent variable.
|
||||
#And then get the FSPs IPs for the CEC.
|
||||
$parent = $nodetocheck;
|
||||
} elsif ($type eq "blade") {
|
||||
return $ppc->{$nodetocheck}->{children}->[0];
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
if( @children == 0 ) {
|
||||
if( exists($ppc->{$parent} ) ) {
|
||||
#for cec/frame, get the FSPs/BPAs from the hash we built in getHcpAttribs() before.
|
||||
@children = @{$ppc->{$parent}->{children}};
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
foreach my $tmp_n( @children) {
|
||||
my $tmp_s = $vpd->{$tmp_n};
|
||||
if ($tmp_s and $tmp_s =~ /^$side-$port$/i) {
|
||||
$tmp_s =~ s/a/A/;
|
||||
$tmp_s =~ s/b/B/;
|
||||
if (xCAT::Utils::isIpaddr($tmp_n)) {
|
||||
$node_side_pairs{$tmp_s} = $tmp_n;
|
||||
$children_num++;
|
||||
} else {
|
||||
my $tmpip = xCAT::NetworkUtils->getipaddr($tmp_n);
|
||||
if (!$tmpip) {
|
||||
#my $hoststab = xCAT::Table->new( 'hosts' );
|
||||
#my $tmp = $hoststab->getNodeAttribs($tmp_n, ['ip']);
|
||||
#if ($tmp->{ip}) {
|
||||
# $tmpip = $tmp->{ip};
|
||||
#}
|
||||
}
|
||||
if ($tmpip) {
|
||||
$node_side_pairs{$tmp_s} = $tmpip;
|
||||
$children_num++;
|
||||
}
|
||||
} # end of parse IP address for a fsp/bpa
|
||||
} # end of parse a child's side
|
||||
} #end of loop for children
|
||||
if ($children_num == 0) {
|
||||
return undef; #no children or brothers for this node.
|
||||
}
|
||||
my @keys = qw(A-0 A-1 B-0 B-1);
|
||||
my $out_strings = undef;
|
||||
foreach my $tmp (@keys) {
|
||||
if (!$node_side_pairs{$tmp}) {
|
||||
$node_side_pairs{$tmp} = '';
|
||||
}
|
||||
}
|
||||
|
||||
$out_strings = $node_side_pairs{"A-0"}.','.$node_side_pairs{"A-1"}.','.$node_side_pairs{"B-0"}.','.$node_side_pairs{"B-1"};
|
||||
|
||||
return $out_strings;
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
@@ -56,6 +263,7 @@ require xCAT::NodeRange;
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub fsp_api_action {
|
||||
my $request = shift;
|
||||
my $node_name = shift;
|
||||
my $attrs = shift;
|
||||
my $action = shift;
|
||||
@@ -99,12 +307,10 @@ sub fsp_api_action {
|
||||
############################
|
||||
# Get IP address
|
||||
############################
|
||||
#$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name, $parameter );
|
||||
$fsp_ip = xCAT::Utils::getIPaddress( $fsp_name, $parameter );
|
||||
undef($parameter);
|
||||
$fsp_ip = getIPaddress($request, $$attrs[4], $fsp_name, $parameter );
|
||||
undef($parameter);
|
||||
} else {
|
||||
#$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name );
|
||||
$fsp_ip = xCAT::Utils::getIPaddress( $fsp_name );
|
||||
$fsp_ip = getIPaddress($request, $$attrs[4], $fsp_name );
|
||||
}
|
||||
|
||||
if(!defined($fsp_ip)) {
|
||||
@@ -123,34 +329,35 @@ sub fsp_api_action {
|
||||
#print "fsp name: $fsp_name\n";
|
||||
#print "fsp ip: $fsp_ip\n";
|
||||
|
||||
#get the HMC/password from passwd table or ppcdirect table.
|
||||
#In DFM, only the add_connection action need the userid/password to create the connection
|
||||
#between hdwr_svr and FSPs or BPAs.
|
||||
if( $action =~ /^add_connection$/) {
|
||||
my $tmp_node;
|
||||
if( $$attrs[4] =~ /^cec$/ || $$attrs[4] =~ /^frame$/ ) {
|
||||
#for redundant FSPs/BPAs, we only need to get the one node's HMC/passwd
|
||||
my $children = xCAT::DBobjUtils->getchildren($fsp_name);
|
||||
if( !defined($children) ) {
|
||||
$res = "Failed to get the $fsp_name\'s FSPs/BPAs";
|
||||
return ([$fsp_name, $res, -1]);
|
||||
}
|
||||
$tmp_node = $$children[0];
|
||||
} elsif ($$attrs[4] =~ /^blade$/) {
|
||||
$tmp_node = $$attrs[5];
|
||||
} else {
|
||||
if( $$attrs[4] =~ /^cec$/ || $$attrs[4] =~ /^frame$/ ) {
|
||||
$tmp_node = $node_name;
|
||||
} elsif ($$attrs[4] =~ /^blade$/) {
|
||||
$tmp_node = $$attrs[5];
|
||||
} else {
|
||||
$tmp_node = $fsp_name;
|
||||
}
|
||||
|
||||
($user, $password) = xCAT::PPCdb::credentials( $tmp_node, $fsp_bpa_type,'HMC');
|
||||
if ( !$password) {
|
||||
$res = "Cannot get password of userid 'HMC'. Please check table 'passwd' or 'ppcdirect'.";
|
||||
return ([$node_name, $res, -1]);
|
||||
}
|
||||
}
|
||||
|
||||
my $cred = $request->{$tmp_node}{cred};
|
||||
($user, $password) = @$cred ;
|
||||
#($user, $password) = xCAT::PPCdb::credentials( $tmp_node, $fsp_bpa_type,'HMC');
|
||||
if ( !$password) {
|
||||
$res = "Cannot get password of userid 'HMC'. Please check table 'passwd' or 'ppcdirect'.";
|
||||
return ([$node_name, $res, -1]);
|
||||
}
|
||||
# The userid for creating connection only is "HMC".
|
||||
$user = 'HMC';
|
||||
}
|
||||
|
||||
my $cmd;
|
||||
my $install_dir = xCAT::Utils->getInstallDir();
|
||||
if( $action =~ /^(code_update|get_compatible_version_from_rpm)$/) {
|
||||
$cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name:$parameter -d $install_dir/packages_fw/";
|
||||
} elsif($action =~ /^code_updateD$/) {
|
||||
$cmd = "$fsp_api -a code_update -D -T $tooltype -t $type:$fsp_ip:$id:$node_name:$parameter -d $install_dir/packages_fw/";
|
||||
} elsif($action =~ /^add_connection$/) {
|
||||
$cmd = "$fsp_api -a $action -u $user -p $password -T $tooltype -t $type:$fsp_ip:$id:$node_name:";
|
||||
} elsif ($action =~ /^set_frame_number$/) {
|
||||
@@ -172,9 +379,17 @@ sub fsp_api_action {
|
||||
|
||||
#print "cmd: $cmd\n";
|
||||
$SIG{CHLD} = 'DEFAULT';
|
||||
# secure passwords in verbose mode
|
||||
my $tmpv = $::VERBOSE;
|
||||
if($action =~ /^add_connection$/)
|
||||
{
|
||||
# password involved
|
||||
$::VERBOSE = 0;
|
||||
}
|
||||
$res = xCAT::Utils->runcmd($cmd, -1);
|
||||
#$res = "good";
|
||||
$Rc = $::RUNCMD_RC;
|
||||
$::VERBOSE = $tmpv;
|
||||
|
||||
##################
|
||||
# output the prompt
|
||||
@@ -211,8 +426,9 @@ sub fsp_api_action {
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub fsp_state_action {
|
||||
my $request = shift;
|
||||
my $node_name = shift;
|
||||
my $type_name = shift;
|
||||
my $attrs = shift;
|
||||
my $action = shift;
|
||||
my $tooltype = shift;
|
||||
my $fsp_api = ($::XCATROOT) ? "$::XCATROOT/sbin/fsp-api" : "/opt/xcat/sbin/fsp-api";
|
||||
@@ -233,7 +449,7 @@ sub fsp_state_action {
|
||||
$fsp_name = $node_name;
|
||||
|
||||
|
||||
if($type_name =~ /^fsp$/ || $type_name =~ /^lpar$/ || $type_name =~ /^(cec|blade)$/) {
|
||||
if( $$attrs[4] =~ /^(fsp|lpar|cec|blade)$/) {
|
||||
$type = 0;
|
||||
} else {
|
||||
$type = 1;
|
||||
@@ -242,11 +458,10 @@ sub fsp_state_action {
|
||||
############################
|
||||
# Get IP address
|
||||
############################
|
||||
#$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name );
|
||||
$fsp_ip = xCAT::Utils::getIPaddress( $fsp_name );
|
||||
$fsp_ip = getIPaddress($request, $$attrs[4], $fsp_name );
|
||||
if(!defined($fsp_ip) or ($fsp_ip == -3)) {
|
||||
$res[0] = ["Failed to get IP address for $fsp_name."];
|
||||
return ([$node_name, @res, -1]);
|
||||
$res[0] = "Failed to get IP address for $fsp_name or the related FSPs/BPAs.";
|
||||
return ([-1, $res[0]]);
|
||||
}
|
||||
|
||||
#print "fsp name: $fsp_name\n";
|
||||
@@ -265,42 +480,15 @@ sub fsp_state_action {
|
||||
#################
|
||||
#$outhash{ $node_name } = $res;
|
||||
if( @res ) {
|
||||
$res[0] =~ s/$node_name: //;
|
||||
$res[0] =~ s/$node_name: //g;
|
||||
}
|
||||
return( [$Rc,@res] );
|
||||
}
|
||||
|
||||
sub getTypeOfNode
|
||||
{
|
||||
my $class = shift;
|
||||
my $node = shift;
|
||||
my $callback = shift;
|
||||
|
||||
my $nodetypetab = xCAT::Table->new( 'nodetype');
|
||||
|
||||
if (!$nodetypetab) {
|
||||
my $rsp;
|
||||
$rsp->{errorcode}->[0] = [1];
|
||||
$rsp->{data}->[0]= "Failed to open table 'nodetype'";
|
||||
xCAT::MsgUtils->message('E', $rsp, $callback);
|
||||
}
|
||||
my $nodetype_hash = $nodetypetab->getNodeAttribs( $node,[qw(nodetype)]);
|
||||
my $nodetype = $nodetype_hash->{nodetype};
|
||||
if ( !$nodetype) {
|
||||
my $rsp;
|
||||
$rsp->{errorcode}->[0] = [1];
|
||||
$rsp->{data}->[0]= "Not found the $node\'s nodetype";
|
||||
xCAT::MsgUtils->message('E', $rsp, $callback);
|
||||
return undef;
|
||||
}
|
||||
return $nodetype;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 fsp_api_partition_action
|
||||
=head3 fsp_api_create_partition
|
||||
Description:
|
||||
invoke the fsp_api to perform the functions
|
||||
|
||||
@@ -316,13 +504,14 @@ sub getTypeOfNode
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my $res = xCAT::FSPUtils::fsp_api_action( $node_name, $d, "add_connection", $tooltype );
|
||||
my $res = xCAT::FSPUtils::fsp_api_create_partition($request, ... );
|
||||
Comments:
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub fsp_api_create_parttion {
|
||||
sub fsp_api_create_partition {
|
||||
my $request = shift;
|
||||
my $starting_lpar_id = shift;
|
||||
my $octant_cfg = shift;
|
||||
my $node_number = shift;
|
||||
@@ -360,8 +549,7 @@ sub fsp_api_create_parttion {
|
||||
############################
|
||||
# Get IP address
|
||||
############################
|
||||
#$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name );
|
||||
$fsp_ip = xCAT::Utils::getIPaddress( $fsp_name );
|
||||
$fsp_ip = getIPaddress($request, $$attrs[4], $fsp_name );
|
||||
if(!defined($fsp_ip) or ($fsp_ip == -3)) {
|
||||
$res = "Failed to get IP address for $fsp_name.";
|
||||
return ([$fsp_name, $res, -1]);
|
||||
|
||||
@@ -215,7 +215,7 @@ sub rnetboot {
|
||||
my $options = $request->{opt};
|
||||
my $hwtype = @$exp[2];
|
||||
my $result;
|
||||
my $name;
|
||||
my $name = $request->{node};
|
||||
my $callback = $request->{callback};
|
||||
#####################################
|
||||
# Get node data
|
||||
@@ -238,6 +238,13 @@ sub rnetboot {
|
||||
C => $o->{client},
|
||||
m => $o->{mac}
|
||||
);
|
||||
#####################################
|
||||
# Parse node range
|
||||
#####################################
|
||||
if ($name =~ /ARRAY/) {
|
||||
$name = join(',', @$name);
|
||||
}
|
||||
|
||||
#####################################
|
||||
# Strip colons from mac address
|
||||
#####################################
|
||||
|
||||
@@ -97,6 +97,11 @@ sub parse_args {
|
||||
#print "in parse_args:\n";
|
||||
#print $command;
|
||||
#print Dumper(\%opt);
|
||||
|
||||
my $nodetype = xCAT::DBobjUtils->getnodetype($$node[0], "ppc");
|
||||
if( $nodetype =~ /^blade$/) {
|
||||
$request->{callback}->({data =>[ "After running rebootseq on the nodes successfully, it's required to run <rpower noderange reset> to make the setting be permanent"]});
|
||||
}
|
||||
|
||||
####################################
|
||||
# Set method to invoke
|
||||
@@ -136,7 +141,7 @@ sub rbootseq {
|
||||
return (\@output);
|
||||
}
|
||||
# add checking the power state of the cec
|
||||
my $power_state = xCAT::FSPUtils::fsp_api_action ($node_name, $d, "cec_state", $tooltype);
|
||||
my $power_state = xCAT::FSPUtils::fsp_api_action ($request, $node_name, $d, "cec_state", $tooltype);
|
||||
if ( @$power_state[2] != 0 ) {
|
||||
push @output, [$node_name, @$power_state[1], -1 ];
|
||||
return (\@output);
|
||||
@@ -208,7 +213,7 @@ sub rbootseq {
|
||||
|
||||
}
|
||||
|
||||
my $res = xCAT::FSPUtils::fsp_api_action ($node_name, $d, "set_lpar_bootstring", $tooltype, $parameter);
|
||||
my $res = xCAT::FSPUtils::fsp_api_action ($request, $node_name, $d, "set_lpar_bootstring", $tooltype, $parameter);
|
||||
#print "In boot, state\n";
|
||||
#print Dumper($res);
|
||||
my $Rc = @$res[2];
|
||||
|
||||
+14
-17
@@ -5,6 +5,7 @@ use strict;
|
||||
use Getopt::Long;
|
||||
use xCAT::Usage;
|
||||
use xCAT::Utils;
|
||||
use xCAT::FSPUtils;
|
||||
use xCAT::PPCcfg;
|
||||
#use Data::Dumper;
|
||||
#use xCAT::PPCcli;
|
||||
@@ -465,7 +466,7 @@ sub do_query {
|
||||
while (my ($mtms, $h) = each(%$hash)) {
|
||||
while (my($name, $d) = each(%$h)) {
|
||||
my $action = $fspapi_action{$cmd}{query}{@$d[4]};
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($name, $d, $action);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, $action);
|
||||
&do_process_query_res($name, $cmd, \@result, $values);
|
||||
#my $res = &do_process_query_res($name, $cmd, \@result, $values);
|
||||
#if (defined($res)) {
|
||||
@@ -512,7 +513,7 @@ sub do_set {
|
||||
while (my($name, $d) = each(%$h)) {
|
||||
my $action = $fspapi_action{$cmd}{set}{@$d[4]};
|
||||
my $para = &do_set_get_para($name, $cmd, $value);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($name, $d, $action, 0, $para);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, $action, 0, $para);
|
||||
# print Dumper($values);
|
||||
&do_process_set_res($name, $cmd, \@result, $values);
|
||||
#my $res = &do_process_set_res($name, $cmd, \@result, $values);
|
||||
@@ -594,7 +595,7 @@ sub passwd {
|
||||
while ( my ($node,$d) = each(%$h) ) {
|
||||
my $type = @$d[4];
|
||||
my $fsp_api = ($::XCATROOT) ? "$::XCATROOT/sbin/fsp-api" : "/opt/xcat/sbin/fsp-api";
|
||||
my $cmd = xCAT::FSPcfg::fsp_api_passwd ($node, $d, $usr, $passwd, $newpasswd);
|
||||
my $cmd = xCAT::FSPcfg::fsp_api_passwd ($request, $node, $d, $usr, $passwd, $newpasswd);
|
||||
my $Rc = @$cmd[2];
|
||||
my $data = @$cmd[1];
|
||||
my $usr_back = $usr;
|
||||
@@ -676,7 +677,7 @@ sub frame {
|
||||
# Get frame number
|
||||
#################################
|
||||
#$data = xCAT::PPCcli::lssyscfg( $exp, @$d[4], @$d[2], 'frame_num' );
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $node, $d, "get_frame_number");
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $request, $node, $d, "get_frame_number");
|
||||
$Rc = pop(@$data);
|
||||
|
||||
#################################
|
||||
@@ -707,7 +708,7 @@ sub frame {
|
||||
return( [[$node,"Cannot find frame num in database", -1]] );
|
||||
}
|
||||
#$data = xCAT::PPCcli::chsyscfg( $exp, "bpa", $d, "frame_num=".$ent->{id} );
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $node, $d, "set_frame_number", 0, $ent->{id});
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $request, $node, $d, "set_frame_number", 0, $ent->{id});
|
||||
$Rc = pop(@$data);
|
||||
|
||||
#################################
|
||||
@@ -726,7 +727,7 @@ sub frame {
|
||||
# Read the frame number from opt
|
||||
#################################
|
||||
#$data = xCAT::PPCcli::chsyscfg( $exp, "bpa", $d, "frame_num=$value" );
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $node, $d, "set_frame_number", 0, $value);
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $request, $node, $d, "set_frame_number", 0, $value);
|
||||
$Rc = pop(@$data);
|
||||
|
||||
#################################
|
||||
@@ -774,7 +775,7 @@ sub cec_off_policy {
|
||||
#################################
|
||||
# Get platform IPL parameters
|
||||
#################################
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $node, $d, "get_phyp_cfg_power_off_policy");
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $request, $node, $d, "get_phyp_cfg_power_off_policy");
|
||||
$Rc = pop(@$data);
|
||||
|
||||
#################################
|
||||
@@ -798,7 +799,7 @@ sub cec_off_policy {
|
||||
} else {
|
||||
$value = "cec_off_policy_stayon";
|
||||
}
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $node, $d, $value);
|
||||
$data = xCAT::FSPUtils::fsp_api_action( $request, $node, $d, $value);
|
||||
$Rc = pop(@$data);
|
||||
|
||||
#################################
|
||||
@@ -830,6 +831,7 @@ sub cec_off_policy {
|
||||
# Invoke fsp_api to change the passwords and store updated passwd in db
|
||||
##########################################################################
|
||||
sub fsp_api_passwd {
|
||||
my $request = shift;
|
||||
my $node_name = shift;
|
||||
my $attrs = shift;
|
||||
my $user = shift;
|
||||
@@ -862,7 +864,8 @@ sub fsp_api_passwd {
|
||||
############################
|
||||
#$fsp_ip = xCAT::Utils::get_hdwr_ip($fsp_name);
|
||||
#$fsp_ip = xCAT::Utils::getNodeIPaddress($fsp_name);
|
||||
$fsp_ip = xCAT::Utils::getIPaddress($fsp_name);
|
||||
#$fsp_ip = xCAT::Utils::getIPaddress($fsp_name);
|
||||
$fsp_ip = xCAT::FSPUtils::getIPaddress($request, $$attrs[4], $fsp_name );
|
||||
if(!defined($fsp_ip) or ($fsp_ip == -3)) {
|
||||
$res = "Failed to get IP address for $fsp_name.";
|
||||
return ([$node_name, $res, -1]);
|
||||
@@ -901,14 +904,8 @@ sub fsp_api_passwd {
|
||||
##########################################################################
|
||||
sub resetnet {
|
||||
my $request = shift;
|
||||
my $hash = shift;
|
||||
my %nodehash;
|
||||
foreach ( @{$request->{noderange}}) {
|
||||
$nodehash{$_} = 1;
|
||||
}
|
||||
# go to use lsslp do_resetnet
|
||||
my $result = xCAT_plugin::lsslp::do_resetnet($request, \%nodehash);
|
||||
return [$result];
|
||||
xCAT::PPCcfg::doresetnet($request);
|
||||
return 0;
|
||||
}
|
||||
1;
|
||||
|
||||
|
||||
+46
-18
@@ -92,6 +92,7 @@ sub mkhwconn_parse_args
|
||||
my $vpdtab = xCAT::Table->new( 'vpd');
|
||||
my @bpa_ctrled_nodes = ();
|
||||
my @no_type_nodes = ();
|
||||
my @error_type_nodes = ();
|
||||
my @frame_members = ();
|
||||
|
||||
###########################################
|
||||
@@ -159,7 +160,8 @@ sub mkhwconn_parse_args
|
||||
{
|
||||
unless ( $nodetype =~ /^(fsp|bpa|frame|cec|hmc|blade)$/)
|
||||
{
|
||||
return ( usage("Node type is incorrect. \n"));
|
||||
push @error_type_nodes, $node;
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,9 +190,12 @@ sub mkhwconn_parse_args
|
||||
if (scalar(@no_type_nodes))
|
||||
{
|
||||
my $tmp_nodelist = join ',', @no_type_nodes;
|
||||
return ( usage("Attribute nodetype.nodetype cannot be found for node(s) $tmp_nodelist"));
|
||||
return ( usage("Attribute nodetype.nodetype cannot be found for node(s) $tmp_nodelist. Please define first and try again.\n"));
|
||||
}
|
||||
if (scalar(@error_type_nodes)) {
|
||||
my $tmp_nodelist = join ',', @error_type_nodes;
|
||||
return ( usage("Incorrect nodetype for nodes(s): $tmp_nodelist. Please modify first and try again.\n"));
|
||||
}
|
||||
|
||||
#if (scalar(@bpa_ctrled_nodes))
|
||||
#{
|
||||
# my $tmp_nodelist = join ',', @bpa_ctrled_nodes;
|
||||
@@ -354,24 +359,30 @@ sub lshwconn_parse_args
|
||||
}
|
||||
|
||||
my $nodetype;
|
||||
my @no_typenodes = ();
|
||||
my @no_mgt_nodes = ();
|
||||
my @error_type_nodes = ();
|
||||
my $typehash = xCAT::DBobjUtils->getnodetype(\@{$request->{node}}, "ppc");
|
||||
for my $node ( @{$request->{node}})
|
||||
{
|
||||
#my $ent = $nodetypetab->getNodeAttribs( $node, [qw(nodetype)]);
|
||||
my $nodehm = $nodehmtab->getNodeAttribs( $node, [qw(mgt)]);
|
||||
#if ( ! $ent)
|
||||
#{
|
||||
# return( ["Failed to get node type for node $node.\n"]);
|
||||
#}
|
||||
my $ttype = $$typehash{$node};
|
||||
if ( ! $ttype)
|
||||
if ( ! $nodehm)
|
||||
{
|
||||
return( ["Failed to get nodehm.mgt value for node $node.\n"]);
|
||||
push @no_mgt_nodes, $node;
|
||||
next;
|
||||
}
|
||||
my $ttype = $$typehash{$node};
|
||||
if ( !$ttype)
|
||||
{
|
||||
push @no_typenodes, $node;
|
||||
next;
|
||||
}
|
||||
if ( $ttype ne 'fsp' and $ttype ne 'cec'
|
||||
and $ttype ne 'bpa' and $ttype ne 'frame' and $ttype ne 'blade')
|
||||
{
|
||||
return( ["Node type $ttype is not supported for this command in FSPAPI\n"]);
|
||||
push @error_type_nodes, $node;
|
||||
next;
|
||||
}
|
||||
if ( ! $nodetype)
|
||||
{
|
||||
@@ -385,7 +396,19 @@ sub lshwconn_parse_args
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (scalar(@no_typenodes)) {
|
||||
my $tmp_nodelist = join ',', @no_typenodes;
|
||||
return ( ["Attribute nodetype.nodetype cannot be found for node(s): $tmp_nodelist. Please define first and try again.\n"]);
|
||||
}
|
||||
if (scalar(@no_mgt_nodes)) {
|
||||
my $tmp_nodelist = join ',', @no_mgt_nodes;
|
||||
return( ["Failed to get nodehm.mgt value for node(s) $tmp_nodelist. Please define first and try again.\n"]);
|
||||
}
|
||||
if (scalar(@error_type_nodes)) {
|
||||
my $tmp_nodelist = join ',', @error_type_nodes;
|
||||
my $link = (scalar(@error_type_nodes) == '1')? 'is':'are';
|
||||
return( ["Node type of node(s) $tmp_nodelist $link not supported for this command in FSPAPI.\n"]);
|
||||
}
|
||||
#$nodetypetab->close();
|
||||
$nodehmtab->close();
|
||||
|
||||
@@ -461,6 +484,7 @@ sub rmhwconn_parse_args
|
||||
return( ["Failed to open table 'nodehm'.\n"]) if (! $nodehmtab);
|
||||
my @bpa_ctrled_nodes = ();
|
||||
my @no_type_nodes = ();
|
||||
my @no_mgt_nodes = ();
|
||||
my @frame_members = ();
|
||||
my $nodetype_hash = xCAT::DBobjUtils->getnodetype($nodes, "ppc");
|
||||
for my $node ( @$nodes)
|
||||
@@ -468,7 +492,8 @@ sub rmhwconn_parse_args
|
||||
my $nodehm = $nodehmtab->getNodeAttribs( $node, [qw(mgt)]);
|
||||
if ( ! $nodehm)
|
||||
{
|
||||
return( ["Failed to get nodehm.mgt value for node $node.\n"]);
|
||||
push @no_mgt_nodes, $node;
|
||||
next;
|
||||
}
|
||||
|
||||
my $node_parent = undef;
|
||||
@@ -505,9 +530,12 @@ sub rmhwconn_parse_args
|
||||
if (scalar(@no_type_nodes))
|
||||
{
|
||||
my $tmp_nodelist = join ',', @no_type_nodes;
|
||||
return ( usage("Attribute nodetype.nodetype cannot be found for node(s) $tmp_nodelist"));
|
||||
return ( usage("Attribute nodetype.nodetype cannot be found for node(s) $tmp_nodelist. Please define first and try again.\n"));
|
||||
}
|
||||
if (scalar(@no_mgt_nodes)) {
|
||||
my $tmp_nodelist = join ',', @no_mgt_nodes;
|
||||
return( ["Failed to get nodehm.mgt value for node(s) $tmp_nodelist. Please define first and try again.\n"]);
|
||||
}
|
||||
|
||||
$ppctab->close();
|
||||
#$nodetypetab->close();
|
||||
$vpdtab->close();
|
||||
@@ -568,7 +596,7 @@ sub mkhwconn
|
||||
|
||||
#}
|
||||
|
||||
my $res = xCAT::FSPUtils::fsp_api_action( $node_name, $d, "add_connection", $tooltype, $opt->{port} );
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($request, $node_name, $d, "add_connection", $tooltype, $opt->{port} );
|
||||
$Rc = @$res[2];
|
||||
if( @$res[1] ne "") {
|
||||
push @value, [$node_name, @$res[1], $Rc];
|
||||
@@ -600,7 +628,7 @@ sub lshwconn
|
||||
{
|
||||
my $d = $node_hash->{$node_name};
|
||||
my $action = "query_connection";
|
||||
my $res = xCAT::FSPUtils::fsp_api_action ($node_name, $d, $action, $tooltype);
|
||||
my $res = xCAT::FSPUtils::fsp_api_action ($request, $node_name, $d, $action, $tooltype);
|
||||
#print "in lshwconn:\n";
|
||||
#print Dumper($res);
|
||||
my $Rc = @$res[2];
|
||||
@@ -669,7 +697,7 @@ sub rmhwconn
|
||||
|
||||
my ( undef,undef,undef,undef,$type) = @$d;
|
||||
|
||||
my $res = xCAT::FSPUtils::fsp_api_action( $node_name, $d, "rm_connection", $tooltype );
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($request, $node_name, $d, "rm_connection", $tooltype );
|
||||
$Rc = @$res[2];
|
||||
if( @$res[1] ne "") {
|
||||
push @value, [$node_name, @$res[1], $Rc];
|
||||
|
||||
+27
-16
@@ -44,7 +44,11 @@ sub dpush {
|
||||
# Parse the command line for options and operands
|
||||
##########################################################################
|
||||
sub parse_args {
|
||||
xCAT::PPCrflash::parse_args(@_);
|
||||
my $req = shift;
|
||||
$req->{mgt} = __PACKAGE__;
|
||||
my $opt = xCAT::PPCrflash::parse_args($req);
|
||||
delete($req->{mgt});
|
||||
return $opt;
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
@@ -146,9 +150,9 @@ sub get_lic_filenames {
|
||||
# return ("", "","", $msg, -1);
|
||||
# }
|
||||
} else {
|
||||
$msg = $msg . "Upgrade $mtms disruptively!";
|
||||
if($activate ne "disruptive") {
|
||||
$msg = "Option --activate's value shouldn't be concurrent, and it must be disruptive";
|
||||
$msg = $msg . "Upgrade $mtms!";
|
||||
if($activate !~ /^(disruptive|deferred)$/) {
|
||||
$msg = "Option --activate's value shouldn't be $activate, and it must be disruptive or deferred";
|
||||
return ("", "","", $msg, -1);
|
||||
}
|
||||
}
|
||||
@@ -248,7 +252,7 @@ sub rflash {
|
||||
|
||||
if( !defined($housekeeping) && ($$d[4] =~ /^fsp$/ || $$d[4] =~ /^lpar$/ || $$d[4] =~ /^cec$/)) {
|
||||
$action = "get_compatible_version_from_rpm";
|
||||
my $values = xCAT::FSPUtils::fsp_api_action( $name, $d, $action, 0, $request->{opt}->{d} );
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, $action, 0, $request->{opt}->{d} );
|
||||
my $Rc = @$values[2];
|
||||
my $v = @$values[1];
|
||||
if ($Rc != 0) {
|
||||
@@ -261,11 +265,11 @@ sub rflash {
|
||||
|
||||
my $frame = $$d[5];
|
||||
my $type = xCAT::DBobjUtils->getnodetype($frame);
|
||||
if ( ( $frame ne $name ) && ( $type eq "frame" ) ){
|
||||
if ( ( $frame ne $name ) && ( $type eq "frame" ) && $activate !~ /^deferred$/){
|
||||
|
||||
my @frame_d = (0, 0, 0, $frame, "frame", 0);
|
||||
$action = "list_firmware_level";
|
||||
$values = xCAT::FSPUtils::fsp_api_action( $frame, \@frame_d, $action );
|
||||
$values = xCAT::FSPUtils::fsp_api_action($request, $frame, \@frame_d, $action );
|
||||
$Rc = @$values[2];
|
||||
my $frame_firmware_level = @$values[1];
|
||||
if ($Rc != 0) {
|
||||
@@ -300,7 +304,7 @@ sub rflash {
|
||||
}
|
||||
|
||||
if(!defined($housekeeping)) {
|
||||
my $values = xCAT::FSPUtils::fsp_api_action( $name, $d, "list_firmware_level");
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, "list_firmware_level");
|
||||
my $Rc = @$values[2];
|
||||
my $level = @$values[1];
|
||||
#####################################
|
||||
@@ -327,14 +331,17 @@ sub rflash {
|
||||
|
||||
if($housekeeping =~ /^commit$/) { $action = "code_commit"}
|
||||
if($housekeeping =~ /^recover$/) { $action = "code_reject"}
|
||||
if($activate =~ /^disruptive$/) {
|
||||
if($housekeeping =~ /^bpa_acdl$/) { $action = "acdl"}
|
||||
if($activate eq "disruptive") {
|
||||
$action = "code_update";
|
||||
}
|
||||
if($activate =~ /^concurrent$/) {
|
||||
my $res = "\'concurrent\' option not supported in FSPflash.Please use disruptive mode";
|
||||
} elsif ($activate eq "deferred") {
|
||||
$action = "code_updateD";
|
||||
} elsif (defined($activate)){
|
||||
#if($activate =~ /^concurrent$/) {
|
||||
my $res = "\'$activate\' option not supported in FSPflash. Please use disruptive or deferred mode";
|
||||
push @value, [$name, $res, -1];
|
||||
next;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
my $msg;
|
||||
if(!defined($housekeeping)) {
|
||||
@@ -348,8 +355,12 @@ sub rflash {
|
||||
dpush ( \@value, [$name, $msg]);
|
||||
}
|
||||
|
||||
my $res = xCAT::FSPUtils::fsp_api_action( $name, $d, $action, 0, $request->{opt}->{d} );
|
||||
push(@value,[$name, @$res[1], @$res[2]]);
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($request, $name, $d, $action, 0, $request->{opt}->{d} );
|
||||
if ($action eq "acdl" && @$res[2] eq '0') {
|
||||
push(@value, [$name, "Success", '0']);
|
||||
} else {
|
||||
push(@value,[$name, @$res[1], @$res[2]]);
|
||||
}
|
||||
return (\@value);
|
||||
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ sub firmware {
|
||||
@$d[4] = "fsp";
|
||||
@$d[0] = 0;
|
||||
}
|
||||
my $values = xCAT::FSPUtils::fsp_api_action( $name, $d, "list_firmware_level");
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, "list_firmware_level");
|
||||
my $Rc = @$values[2];
|
||||
my $data = @$values[1];
|
||||
#print "values";
|
||||
@@ -248,7 +248,7 @@ sub deconfig {
|
||||
# @$d[4] = "fsp";
|
||||
# @$d[0] = 0;
|
||||
#}
|
||||
my $values = xCAT::FSPUtils::fsp_api_action( $name, $d, "get_cec_deconfigured");
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, "get_cec_deconfigured");
|
||||
my $Rc = @$values[2];
|
||||
my $data = @$values[1];
|
||||
#print "values";
|
||||
@@ -287,15 +287,21 @@ sub deconfig {
|
||||
my $Location_code;
|
||||
my $RID;
|
||||
my $TYPE;
|
||||
if(ref($node->{GARDRECORD}) ne "ARRAY") {
|
||||
my $dres;
|
||||
if (ref($node->{GARDRECORD}) eq "ARRAY") {
|
||||
$dres = $node->{GARDRECORD};
|
||||
} elsif (ref($node->{GARDRECORD}) eq "HASH") {
|
||||
push @$dres, $node->{GARDRECORD};
|
||||
} else {
|
||||
push @result,[$name,"NO Deconfigured resources", 0];
|
||||
return( \@result );
|
||||
}
|
||||
push @result,[$name,"Deconfigured resources", 0];
|
||||
push @result,[$name,"Location_code RID Call_Out_Method Call_Out_Hardware_State TYPE", 0];
|
||||
push @result,[$name,"$node->{Location_code} $node->{RID}", 0];
|
||||
foreach my $unit(@{$node->{GARDRECORD}}) {
|
||||
|
||||
#foreach my $unit(@{$node->{GARDRECORD}}) {
|
||||
foreach my $unit(@$dres) {
|
||||
while (my ($key, $unit3) = each(%$unit) ) {
|
||||
|
||||
if($key eq "GARDUNIT") {
|
||||
|
||||
@@ -257,7 +257,7 @@ sub getmacs {
|
||||
#########################################
|
||||
for ( my $stat = 0; $stat < 3; $stat++ ) {
|
||||
#my $output = xCAT::PPCcli::lshwres( $exp, @$cmd[$stat], $hcp);
|
||||
my $output = xCAT::FSPUtils::fsp_api_action($name, $d, $cmd[$stat]);
|
||||
my $output = xCAT::FSPUtils::fsp_api_action($request, $name, $d, $cmd[$stat]);
|
||||
my $macs;
|
||||
my $res = $$output[1];
|
||||
chomp($res);
|
||||
@@ -369,14 +369,25 @@ sub getmacs {
|
||||
# specified
|
||||
#########################################
|
||||
if ( defined($filter) ) {
|
||||
my $matched = 1;
|
||||
foreach ( keys %$filter ) {
|
||||
if ( $att{$_} ne $filter->{$_} ) {
|
||||
$matched = 0;
|
||||
my $matched = 0;
|
||||
foreach my $key ( keys %$filter ) {
|
||||
if ( $key eq "MAC_Address" ) {
|
||||
my $mac = lc($att{$key});
|
||||
my $filter_mac = lc($filter->{$key});
|
||||
|
||||
$mac =~ s/://g;
|
||||
$filter_mac =~ s/://g;
|
||||
|
||||
if ( grep(/$filter_mac/, $mac) ) {
|
||||
$matched = 1;
|
||||
last;
|
||||
}
|
||||
} elsif ( grep(/$filter->{$key}/, $att{$key}) ) {
|
||||
$matched = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
if ( $matched == 1 ) {
|
||||
if ( $matched ) {
|
||||
push @$value,"$att{'Type'} $att{'Phys_Port_Loc'} $att{'MAC_Address'} $att{'Adapter'} $att{'Port_Group'} $att{'Phys_Port'} $att{'Logical_Port'} $att{'VLan'} $att{'VSwitch'} $att{'Curr_Conn_Speed'}\n";
|
||||
}
|
||||
} else {
|
||||
|
||||
+47
-22
@@ -21,22 +21,29 @@ sub parse_args {
|
||||
##########################################################################
|
||||
sub enumerate {
|
||||
|
||||
my $request = shift;
|
||||
my $h = shift;
|
||||
my $mtms = shift;
|
||||
my $tooltype = shift;
|
||||
my %outhash = ();
|
||||
my %cmds = ();
|
||||
my $type = ();
|
||||
my $cec_bpa = ();
|
||||
my $tmp_d;
|
||||
my $tmp_name;
|
||||
|
||||
######################################
|
||||
# Check for CEC/LPAR/BPAs in list
|
||||
######################################
|
||||
while (my ($name,$d) = each(%$h) ) {
|
||||
$cec_bpa = @$d[3];
|
||||
$type = @$d[4];
|
||||
$tmp_d = $d;
|
||||
$tmp_name = $name;
|
||||
#$cmds{$type} = ($type=~/^lpar$/) ? "all_lpars_state" : "cec_state";
|
||||
if( $type=~/^lpar$/ ) {
|
||||
$cmds{$type} = "all_lpars_state";
|
||||
} elsif ($type=~/^(fsp|cec)$/) {
|
||||
} elsif ($type=~/^(fsp|cec|blade)$/) {
|
||||
$cmds{$type} = "cec_state";
|
||||
} else {
|
||||
$cmds{$type} = "bpa_state";
|
||||
@@ -44,7 +51,8 @@ sub enumerate {
|
||||
}
|
||||
foreach my $type ( keys %cmds ) {
|
||||
my $action = $cmds{$type};
|
||||
my $values = xCAT::FSPUtils::fsp_state_action ($cec_bpa, $type, $action);;
|
||||
#my $values = xCAT::FSPUtils::fsp_state_action ($request, $cec_bpa, $type, $action, $tooltype);
|
||||
my $values = xCAT::FSPUtils::fsp_state_action ($request, $cec_bpa, $tmp_d, $action, $tooltype);
|
||||
my $Rc = shift(@$values);
|
||||
##################################
|
||||
# Return error
|
||||
@@ -61,7 +69,18 @@ sub enumerate {
|
||||
##############################
|
||||
# No lparid for fsp/bpa
|
||||
##############################
|
||||
if ( $type =~ /^(fsp|bpa|cec|frame)$/ ) {
|
||||
if ( $type =~ /^(fsp|bpa|cec|frame|blade)$/ ) {
|
||||
if ($type eq 'blade') {
|
||||
if ($state eq 'operating') {
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($request, $tmp_name,$tmp_d,'state',$tooltype);
|
||||
if (@$res[2] == 0 and @$res[1] =~ /open-firmware/i) {
|
||||
$state = @$res[1];
|
||||
}
|
||||
}
|
||||
if ($state =~ /standby|operating/) {
|
||||
$state = "on";
|
||||
}
|
||||
}
|
||||
$lparid = $type;
|
||||
}
|
||||
$outhash{ $lparid } = $state;
|
||||
@@ -111,7 +130,7 @@ sub powercmd_boot {
|
||||
next;
|
||||
}
|
||||
|
||||
my $res = xCAT::FSPUtils::fsp_api_action ($node_name, $d, "state");
|
||||
my $res = xCAT::FSPUtils::fsp_api_action ($request,$node_name, $d, "state");
|
||||
#print "In boot, state\n";
|
||||
#print Dumper($res);
|
||||
my $Rc = @$res[2];
|
||||
@@ -141,7 +160,7 @@ sub powercmd_boot {
|
||||
}
|
||||
|
||||
|
||||
$res = xCAT::FSPUtils::fsp_api_action ($node_name, $d, $op);
|
||||
$res = xCAT::FSPUtils::fsp_api_action ($request,$node_name, $d, $op);
|
||||
|
||||
# @output ...
|
||||
$Rc = @$res[2];
|
||||
@@ -165,6 +184,7 @@ sub powercmd {
|
||||
|
||||
my $request = shift;
|
||||
my $hash = shift;
|
||||
my $tooltype = $request->{opt}->{T};
|
||||
my @result = ();
|
||||
my @output;
|
||||
my $action;
|
||||
@@ -214,8 +234,9 @@ sub powercmd {
|
||||
if($action =~ /^off$/) { $action = "cec_off"; }
|
||||
if($action =~ /^resetsp$/) { $action = "reboot_service_processor"; }
|
||||
if($action =~ /^lowpower$/) { $action = "cec_on_low_power"; }
|
||||
if($action =~ /^cycle$/) {$action = "cec_reboot";}
|
||||
if($action !~ /^cec_on_autostart$/ && $action !~ /^cec_off$/ && $action !~ /^cec_on_low_power$/ && $action !~ /^onstandby$/ && $action !~ /^reboot_service_processor$/ && $action !~ /^cec_reboot$/) {
|
||||
#if($action =~ /^cycle$/) {$action = "cec_reboot";}
|
||||
if($action =~ /^cycle$/) {$action = "reset";}
|
||||
if($action !~ /^cec_on_autostart$/ && $action !~ /^cec_off$/ && $action !~ /^cec_on_low_power$/ && $action !~ /^onstandby$/ && $action !~ /^reboot_service_processor$/ && $action !~ /^reset$/ && $action !~ /^sms$/) {
|
||||
push @output, [$node_name, "\'$action\' command not supported for $$d[4]", -1 ];
|
||||
return (\@output);
|
||||
}
|
||||
@@ -264,7 +285,7 @@ sub powercmd {
|
||||
|
||||
#print Dumper($newd);
|
||||
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($newnames, $newd, $action, 0, $request->{'powerinterval'} );
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($request, $newnames, $newd, $action, $tooltype, $request->{'powerinterval'} );
|
||||
# print "In boot, state\n";
|
||||
# print Dumper($res);
|
||||
my $Rc = @$res[2];
|
||||
@@ -287,7 +308,17 @@ sub powercmd {
|
||||
if ((scalar(keys %$hash) == 1) and $Rc) {
|
||||
push @output, [$node_name, $data, $Rc];
|
||||
} else {
|
||||
push @output, [$node_name,"Success", 0];
|
||||
# check the state of the blade or CEC after cec_reboot in order to let HWS realize the destination CEC had been powerd off #
|
||||
#my $msg = "success";
|
||||
if ($action eq 'cec_reboot') {
|
||||
sleep 0.1;
|
||||
xCAT::FSPUtils::fsp_state_action ($request, @$d[3], $d, "cec_state");
|
||||
#my $state_res = xCAT::FSPUtils::fsp_state_action (@$d[3], @$d[4], "cec_state");
|
||||
#my @state_state = @$state_res[1];
|
||||
#$msg = @state_state[0];
|
||||
}
|
||||
push @output, [$node_name,"Success", 0];
|
||||
#push @output, [$node_name,$msg, 0];
|
||||
}
|
||||
}
|
||||
return( \@output );
|
||||
@@ -300,7 +331,7 @@ sub powercmd {
|
||||
sub power_status {
|
||||
my $value = shift;
|
||||
my @states = (
|
||||
"Operating|operating",
|
||||
"Operating|operating|on",
|
||||
"Running|running",
|
||||
"standby",
|
||||
"Open Firmware|open-firmware"
|
||||
@@ -324,6 +355,7 @@ sub state {
|
||||
my $prefix = shift;
|
||||
my $convert = shift;
|
||||
my @output = ();
|
||||
my $tooltype = $request->{opt}->{T};
|
||||
|
||||
|
||||
#print "------in state--------\n";
|
||||
@@ -358,7 +390,7 @@ sub state {
|
||||
######################################
|
||||
# Build CEC/LPAR information hash
|
||||
######################################
|
||||
my $stat = enumerate( $h, $mtms );
|
||||
my $stat = enumerate($request, $h, $mtms, $tooltype);
|
||||
my $Rc = shift(@$stat);
|
||||
my $data = @$stat[0];
|
||||
#if($Rc != 0) {
|
||||
@@ -370,7 +402,7 @@ sub state {
|
||||
# Look up by lparid
|
||||
##################################
|
||||
my $type = @$d[4];
|
||||
my $id = ($type=~/^(fsp|bpa|cec|frame)$/) ? $type : @$d[0];
|
||||
my $id = ($type=~/^(fsp|bpa|cec|frame|blade)$/) ? $type : @$d[0];
|
||||
|
||||
##################################
|
||||
# Output error
|
||||
@@ -387,8 +419,8 @@ sub state {
|
||||
##################################
|
||||
# Node not found
|
||||
##################################
|
||||
if ( !exists( $data->{$id} )) {
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($name, $d, "state");
|
||||
if ($type !~ /^blade$/ and !exists( $data->{$id} )) {
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($request, $name, $d, "state", $tooltype);
|
||||
my $rc = @$res[2];
|
||||
my $val = @$res[1];
|
||||
if( $rc != 0) {
|
||||
@@ -411,13 +443,6 @@ sub state {
|
||||
##############################
|
||||
# Convert state to on/off
|
||||
##############################
|
||||
if ($type eq 'blade') {
|
||||
if ($value =~ /^(power-on-transition|power off|off)$/) {
|
||||
$value = "off";
|
||||
} else {
|
||||
$value = "on";
|
||||
}
|
||||
}
|
||||
if ( defined( $convert )) {
|
||||
$value = power_status( $value );
|
||||
}
|
||||
@@ -483,7 +508,7 @@ sub state1 {
|
||||
if($$d[4] =~ /^fsp$/ || $$d[4] =~ /^bpa$/) {
|
||||
$action = "cec_state";
|
||||
}
|
||||
my $stat = xCAT::FSPUtils::fsp_api_action ($node_name, $d, $action);
|
||||
my $stat = xCAT::FSPUtils::fsp_api_action ($request, $node_name, $d, $action);
|
||||
my $Rc = @$stat[2];
|
||||
my $data = @$stat[1];
|
||||
my $type = @$d[4];
|
||||
|
||||
@@ -82,6 +82,7 @@ sub getshorthost {
|
||||
##########################################################################
|
||||
sub enumerate {
|
||||
|
||||
my $request = shift;
|
||||
my $hash = shift;
|
||||
my $exp = shift;
|
||||
my $hwtype = ();
|
||||
@@ -118,7 +119,7 @@ sub enumerate {
|
||||
push @values, $data;
|
||||
next;
|
||||
}
|
||||
my $stat = xCAT::FSPUtils::fsp_api_action ($node_name, $d, "query_connection");
|
||||
my $stat = xCAT::FSPUtils::fsp_api_action ($request, $node_name, $d, "query_connection");
|
||||
my $Rc = @$stat[2];
|
||||
my $data = @$stat[1];
|
||||
|
||||
@@ -183,7 +184,7 @@ sub enumerate {
|
||||
#####################################
|
||||
# Enumerate LPARs
|
||||
#####################################
|
||||
$stat = xCAT::FSPUtils::fsp_api_action ($node_name, $d, "get_lpar_info");
|
||||
$stat = xCAT::FSPUtils::fsp_api_action ($request, $node_name, $d, "get_lpar_info");
|
||||
$Rc = @$stat[2];
|
||||
$data = @$stat[1];
|
||||
|
||||
@@ -524,7 +525,7 @@ sub rscan {
|
||||
###################################
|
||||
# Enumerate all the hardware
|
||||
###################################
|
||||
my $values = enumerate( $hash );
|
||||
my $values = enumerate($request, $hash );
|
||||
#print "In rscan:\n";
|
||||
#print Dumper($values);
|
||||
if ( ref($values) ne 'ARRAY' ) {
|
||||
|
||||
+126
-36
@@ -56,39 +56,92 @@ sub enumerate_temp {
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
# Returns refcode
|
||||
# Returns refcode ; In DFM, it will get both the LCD value and the Current Power status Value
|
||||
##########################################################################
|
||||
sub enumerate_lcds {
|
||||
|
||||
my $request= shift;
|
||||
my $name= shift;
|
||||
my $d = shift;
|
||||
my $mtms = @$d[2];
|
||||
my $Rc = undef;
|
||||
my $value = undef;
|
||||
my $nodetype = @$d[4];
|
||||
my $lpar_id = @$d[0];
|
||||
my @refcode = ();
|
||||
my $action;
|
||||
if($$d[4] =~ /^lpar$/) {
|
||||
$action = "query_lcds";
|
||||
|
||||
#} elsif($$d[4] =~ /^fsp$/) {
|
||||
# $action = "cec_query_lcds";
|
||||
} else {
|
||||
$action = "cec_query_lcds";
|
||||
}
|
||||
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($name, $d, $action);
|
||||
my $action = shift;
|
||||
my $only_lcds = shift;
|
||||
my $prefix = "Current LCD:";
|
||||
my $power_status_prefix = "Current Power Status:";
|
||||
my $Rc;
|
||||
my @refcode;
|
||||
my $c = 0;
|
||||
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $name, $d, $action);
|
||||
$Rc = @$values[2];
|
||||
my $data = @$values[1];
|
||||
$data =~ /\|(\w*)/ ;
|
||||
my $code = $1;
|
||||
if ( ! $code) {
|
||||
push @refcode, [$Rc, "blank"];
|
||||
} else {
|
||||
push @refcode, [$Rc, $code] ;
|
||||
}
|
||||
my $t_n = @$values[0];
|
||||
if( $Rc != 0 ) {
|
||||
my @names = split(/,/, $t_n);
|
||||
my @t_data = split(/\n/, $data);
|
||||
foreach my $n (@names) {
|
||||
if( $data =~ /$n/ ) {
|
||||
chomp $t_data[$c];
|
||||
#push @refcode,[$n, "$prefix $t_data[$c]", $Rc];
|
||||
if($t_data[$c] =~ /Error/ ) {
|
||||
if( $only_lcds == 0) {
|
||||
push @refcode,[$n, "$power_status_prefix $t_data[$c]", $Rc];
|
||||
}
|
||||
push @refcode,[$n, "$prefix $t_data[$c]", $Rc];
|
||||
} else {
|
||||
if( $only_lcds == 0) {
|
||||
|
||||
# get power status
|
||||
if( $data =~ /1\|/) {
|
||||
push @refcode, [$n, "$power_status_prefix on", $Rc] ;
|
||||
} else {
|
||||
push @refcode, [$n, "$power_status_prefix off", $Rc];
|
||||
}
|
||||
}
|
||||
|
||||
# get lcd value
|
||||
if( $t_data[$c] =~ /1\|(\w[\w\s]*)/) {
|
||||
push @refcode, [$n, "$prefix $1", $Rc] ;
|
||||
} else {
|
||||
push @refcode, [$n, "$prefix blank", $Rc];
|
||||
}
|
||||
}
|
||||
$c++;
|
||||
} else {
|
||||
push @refcode, [$n, "$prefix $data", $Rc];
|
||||
if( $only_lcds == 0) {
|
||||
push @refcode, [$n, "$power_status_prefix $data", $Rc];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
my @array = split(/\n/, $data);
|
||||
foreach my $a (@array) {
|
||||
if ($a !~ /:\s?[^\s]*\s?[0|1]/) {
|
||||
next;
|
||||
}
|
||||
my @t = split(/:/, $a);
|
||||
my $name = $t[0];
|
||||
$data = $t[1];
|
||||
## it will not parse the power status if only lcds.
|
||||
# $only_lcds = 0, it will get the power status
|
||||
# $only_lcds = 0, not get the power status.
|
||||
if( $only_lcds == 0) {
|
||||
# get power status
|
||||
if( $data =~ /1\|/) {
|
||||
push @refcode, [$name, "$power_status_prefix on", $Rc] ;
|
||||
} else {
|
||||
push @refcode, [$name, "$power_status_prefix off", $Rc];
|
||||
}
|
||||
}
|
||||
|
||||
# get lcd value
|
||||
if( $data =~ /1\|(\w[\w\s]*)/) {
|
||||
push @refcode, [$name, "$prefix $1", $Rc] ;
|
||||
} else {
|
||||
push @refcode, [$name, "$prefix blank", $Rc];
|
||||
}
|
||||
}
|
||||
}
|
||||
return \@refcode;
|
||||
}
|
||||
|
||||
@@ -97,6 +150,7 @@ sub enumerate_lcds {
|
||||
##########################################################################
|
||||
sub enumerate_rackenv {
|
||||
|
||||
my $request= shift;
|
||||
my $name= shift;
|
||||
my $d = shift;
|
||||
#my $mtms = @$d[2];
|
||||
@@ -106,7 +160,7 @@ sub enumerate_rackenv {
|
||||
my %outhash = ();
|
||||
my $action = "get_rack_env";
|
||||
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($name, $d, $action);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $name, $d, $action);
|
||||
$Rc = @$values[2];
|
||||
my $data = @$values[1];
|
||||
if ( $Rc != 0 ) {
|
||||
@@ -303,7 +357,7 @@ sub rackenv {
|
||||
}
|
||||
|
||||
my $action = "get_rack_env";
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($name, $d, $action);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $name, $d, $action);
|
||||
my $Rc = @$values[2];
|
||||
my $data = @$values[1];
|
||||
if ( $Rc != 0 ) {
|
||||
@@ -335,6 +389,8 @@ sub rackenv {
|
||||
|
||||
##########################################################################
|
||||
# Returns system power status (on or off)
|
||||
# This subroutine will not be used in DFM
|
||||
# And the power status will be returned with lcds
|
||||
##########################################################################
|
||||
sub power {
|
||||
return( xCAT::FSPpower::state(@_,"Current Power Status: ",1));
|
||||
@@ -347,9 +403,50 @@ sub state {
|
||||
return( xCAT::FSPpower::state(@_,"System State: "));
|
||||
}
|
||||
###########################################################################
|
||||
# Returns system LCD status (LCD1, LCD2)
|
||||
# Returns system LCD status and the power status
|
||||
##########################################################################
|
||||
sub lcds {
|
||||
my $request = shift;
|
||||
my $hash = shift;
|
||||
my $exp = shift;
|
||||
my $result;
|
||||
my $newids;
|
||||
my $newnames;
|
||||
my $newd;
|
||||
my $action;
|
||||
my $type;
|
||||
my $only_lcds;
|
||||
if( $request->{method} =~ /^lcds$/ ) {
|
||||
$only_lcds = 1;
|
||||
}
|
||||
while (my ($mtms,$h) = each(%$hash) ) {
|
||||
while(my ($name, $d) = each(%$h) ){
|
||||
$newids .="$$d[0],";
|
||||
$newnames .="$name,";
|
||||
$newd = $d;
|
||||
if( defined( $type) && $type ne $$d[4] ) {
|
||||
push @$result, [$name, "$name\'s type is $$d[4]. Please get the lcds for $type and $$d[4] seperately", -1 ];
|
||||
return $result;
|
||||
}
|
||||
$type = $$d[4];
|
||||
}
|
||||
}
|
||||
|
||||
if( $type eq "lpar" ) {
|
||||
$action = "query_lcds";
|
||||
} elsif ($type eq "blade") {
|
||||
$action = "pblade_query_lcds";
|
||||
} else {
|
||||
$action = "cec_query_lcds";
|
||||
}
|
||||
|
||||
$$newd[0] = $newids;
|
||||
$result = enumerate_lcds($request, $newnames, $newd, $action, $only_lcds);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub lcds_orig {
|
||||
my $request = shift;
|
||||
my $hash = shift;
|
||||
my $exp = shift;
|
||||
@@ -365,12 +462,7 @@ sub lcds {
|
||||
|
||||
while (my ($mtms,$h) = each(%$hash) ) {
|
||||
while(my ($name, $d) = each(%$h) ){
|
||||
#Support HMC only
|
||||
#if($hwtype ne 'hmc'){
|
||||
# push @result, [$name, "$text Not available(NO HMC)", 1];
|
||||
# next;
|
||||
#}
|
||||
$refcodes = enumerate_lcds($name, $d);
|
||||
$refcodes = enumerate_lcds($request, $name, $d);
|
||||
$num = 1;
|
||||
foreach $rcode (@$refcodes){
|
||||
$Rc = shift(@$rcode);
|
||||
@@ -383,7 +475,6 @@ sub lcds {
|
||||
return \@result;
|
||||
}
|
||||
|
||||
|
||||
##########################################################################
|
||||
# Returns all vitals
|
||||
##########################################################################
|
||||
@@ -392,7 +483,6 @@ sub all {
|
||||
my @values = (
|
||||
@{rackenv(@_)},
|
||||
@{state(@_)},
|
||||
@{power(@_)},
|
||||
@{lcds(@_)},
|
||||
);
|
||||
|
||||
|
||||
+32
-20
@@ -60,7 +60,7 @@ sub chvm_parse_extra_options {
|
||||
return "no value specified";
|
||||
}
|
||||
if ($cmd =~ /^lparname$/) {
|
||||
if ($value ne '*' && $value !~ /^[a-zA-Z0-9-_]$/) {
|
||||
if ($value ne '*' && $value !~ /^[a-zA-Z0-9-_]+$/) {
|
||||
return "'$value' invalid";
|
||||
}
|
||||
my $len = rindex $value."\$", "\$";
|
||||
@@ -202,8 +202,11 @@ sub chvm_parse_args {
|
||||
|
||||
|
||||
# pending memory interleaving mode (1- interleaved, 2- non-interleaved)
|
||||
# non-interleaved mode means the memory cannot be shared across the processors in an octant.
|
||||
# interleaved means the memory can be shared.
|
||||
# non-interleaved mode: Memory allocations are only interleaved across the two
|
||||
# memory controllers on a local chip in the octant
|
||||
# interleaved mode: Memory allocations are interleaved evenly across all eight
|
||||
# memory controllers in the octant
|
||||
# Note: A octant with partition value 2-5 can not be set with memory interleaving = 1.
|
||||
if( exists($opt{m}) ) {
|
||||
if( $opt{m} =~ /^interleaved$/ || $opt{m} =~ /^1$/ ) {
|
||||
$opt{m} = 1;
|
||||
@@ -238,6 +241,9 @@ sub chvm_parse_args {
|
||||
if( grep(/^$subelems[1]$/, @ratio ) != 1) {
|
||||
return(usage( "Invalid octant configuration value in $elem.\n For Power 775, octant configuration values only could be 1, 2, 3, 4, 5. Please see the details in manpage of chvm." ));
|
||||
}
|
||||
if( $opt{m} == 1 && $subelems[1] > 1 ) {
|
||||
return(usage("Need to specify \"-m 2\" when specifying an octant configuration value greater than 1. Error!"));
|
||||
}
|
||||
if( exists($octant_cfg{$subelems[0]}) && $octant_cfg{$subelems[0]} == $subelems[1] ) {
|
||||
return(usage("In the octant configuration rule, same octant with different octant configuration value. Error!"));
|
||||
}
|
||||
@@ -249,6 +255,9 @@ sub chvm_parse_args {
|
||||
if( $left < 0 || $left > 7 || $right < 0 || $right > 7) {
|
||||
return(usage("Octant ID only could be 0 to 7 in the octant configuration rule $elem"));
|
||||
}
|
||||
if( $opt{m} == 1 && $subelems[1] > 1 ) {
|
||||
return(usage("Need to specify \"-m 2\" when specifying an octant configuration value greater than 1. Error!"));
|
||||
}
|
||||
if($left == $right) {
|
||||
if( grep(/^$subelems[1]$/, @ratio ) != 1) {
|
||||
return(usage( "Invalid octant configuration value in $elem.\n For Power 775, octant configuration values only could be 1, 2, 3, 4, 5. Please see the details in manpage of chvm." ));
|
||||
@@ -644,7 +653,7 @@ sub do_op_extra_cmds {
|
||||
while (my ($mtms, $h) = each(%$hash)) {
|
||||
while (my($name, $d) = each(%$h)) {
|
||||
my $tmp_value = ($param eq '*') ? $name : $param;
|
||||
my $value = xCAT::FSPUtils::fsp_api_action($name, $d, $action, 0, $tmp_value);
|
||||
my $value = xCAT::FSPUtils::fsp_api_action($request, $name, $d, $action, 0, $tmp_value);
|
||||
if (@$value[1] && ((@$value[1] =~ /Error/i) && (@$value[2] ne '0'))) {
|
||||
return ([[$name, @$value[1], '1']]) ;
|
||||
} else {
|
||||
@@ -716,12 +725,13 @@ sub modify_by_prof {
|
||||
while (my ($cec,$h) = each(%$hash) ) {
|
||||
while (my ($lpar,$d) = each(%$h) ) {
|
||||
$td = $d;
|
||||
@$td[4] = "fsp";
|
||||
#@$td[4] = "fsp";
|
||||
$cec_name = @$d[3];
|
||||
}
|
||||
$td->[4] = "cec";
|
||||
#get the current I/O slot information
|
||||
my $action = "get_io_slot_info";
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($cec_name, $td, $action);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $cec_name, $td, $action);
|
||||
my $Rc = $$values[2];
|
||||
if ( $Rc != 0 ) {
|
||||
push @result, [$cec_name, $$values[1], $Rc];
|
||||
@@ -738,7 +748,7 @@ sub modify_by_prof {
|
||||
#get all the nodes state in the same cec
|
||||
$action = "all_lpars_state";
|
||||
undef($values);
|
||||
my $values = xCAT::FSPUtils::fsp_state_action ($cec_name, "fsp", $action);
|
||||
my $values = xCAT::FSPUtils::fsp_state_action ($request, $cec_name, $td, $action);
|
||||
$Rc = shift(@$values);
|
||||
if ( $Rc != 0 ) {
|
||||
push @result, [$cec_name, $$values[0], $Rc];
|
||||
@@ -770,7 +780,7 @@ sub modify_by_prof {
|
||||
return ( \@result );
|
||||
}
|
||||
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($lpar, $d, $action, $tooltype, $drc_index);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $lpar, $d, $action, $tooltype, $drc_index);
|
||||
#my $Rc = shift(@$values);
|
||||
my $Rc = pop(@$values);
|
||||
if ( $Rc != 0 ) {
|
||||
@@ -787,6 +797,7 @@ sub modify_by_prof {
|
||||
|
||||
sub enumerate {
|
||||
|
||||
my $request = shift;
|
||||
my $h = shift;
|
||||
my $mtms = shift;
|
||||
my %outhash = ();
|
||||
@@ -800,9 +811,9 @@ sub enumerate {
|
||||
@td = @$d;
|
||||
}
|
||||
|
||||
$td[4]="fsp";
|
||||
$td[4]="cec";
|
||||
my $action = "get_io_slot_info";
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($cec, \@td, $action);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $cec, \@td, $action);
|
||||
#my $Rc = shift(@$values);
|
||||
my $Rc = $$values[2];
|
||||
if ( $Rc != 0 ) {
|
||||
@@ -818,7 +829,7 @@ sub enumerate {
|
||||
|
||||
if( $type =~ /^(fsp|cec)$/ ) {
|
||||
$action = "query_octant_cfg";
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($cec, \@td, $action);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $cec, \@td, $action);
|
||||
my $Rc = pop(@$values);
|
||||
if ( $Rc != 0 ) {
|
||||
return( [$Rc,$$values[1]] );
|
||||
@@ -841,6 +852,7 @@ sub enumerate {
|
||||
}
|
||||
|
||||
sub get_cec_attr_info {
|
||||
my $request = shift;
|
||||
my $name = shift;
|
||||
my $attr = shift;
|
||||
my $op = shift;
|
||||
@@ -850,7 +862,7 @@ sub get_cec_attr_info {
|
||||
huge_page => "get_huge_page"
|
||||
);
|
||||
my $action = $op_hash{$op};
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($name, $attr, $action);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($request, $name, $attr, $action);
|
||||
if (@$values[1] && ((@$values[1] =~ /Error/i) && @$values[2] ne '0')) {
|
||||
return ([[$name, @$values[1], '1']]);
|
||||
}
|
||||
@@ -985,7 +997,7 @@ sub list {
|
||||
my $l_string = "\n";
|
||||
#print Dumper($hash);
|
||||
while (my ($mtms,$h) = each(%$hash) ) {
|
||||
my $info = enumerate( $h, $mtms );
|
||||
my $info = enumerate($request, $h, $mtms );
|
||||
my $Rc = shift(@$info);
|
||||
my $data = @$info[0];
|
||||
|
||||
@@ -1013,16 +1025,16 @@ sub list {
|
||||
# get the I/O slot information
|
||||
if($request->{opt}->{l}) {
|
||||
if ($type =~ /^(fsp|cec)$/) {
|
||||
$bsr_infos = get_cec_attr_info($node_name, $d, "bsr");
|
||||
$bsr_infos = get_cec_attr_info($request, $node_name, $d, "bsr");
|
||||
if (ref($bsr_infos) eq 'ARRAY') {
|
||||
return $bsr_infos;
|
||||
}
|
||||
$huge_infos = get_cec_attr_info($node_name, $d, "huge_page");
|
||||
$huge_infos = get_cec_attr_info($request,$node_name, $d, "huge_page");
|
||||
if (ref($huge_infos) eq 'ARRAY') {
|
||||
return $huge_infos;
|
||||
}
|
||||
}
|
||||
$lpar_infos = get_cec_attr_info($node_name, $d, "lpar_info");
|
||||
$lpar_infos = get_cec_attr_info($request, $node_name, $d, "lpar_info");
|
||||
if (ref($lpar_infos) eq 'ARRAY') {
|
||||
return $lpar_infos;
|
||||
}
|
||||
@@ -1053,7 +1065,7 @@ sub list {
|
||||
if (defined($lpar_huges{$lparid})) {
|
||||
$hugepage = $lpar_huges{$lparid};
|
||||
} else {
|
||||
$hugepage = get_cec_attr_info($node_name, $d, "huge_page");
|
||||
$hugepage = get_cec_attr_info($request, $node_name, $d, "huge_page");
|
||||
if (ref($hugepage) eq 'ARRAY') {
|
||||
return $hugepage;
|
||||
}
|
||||
@@ -1144,7 +1156,7 @@ sub list_orig {
|
||||
# This is a CEC
|
||||
####################################
|
||||
else {
|
||||
my $values = xCAT::FSPUtils::fsp_api_action( $node_name, $d, "query_octant_cfg");
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($request, $node_name, $d, "query_octant_cfg");
|
||||
my $Rc = @$values[2];
|
||||
my $data = @$values[1];
|
||||
if ( $Rc != SUCCESS ) {
|
||||
@@ -1210,7 +1222,7 @@ sub create {
|
||||
}
|
||||
}
|
||||
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($cec_name, $d, "query_octant_cfg");
|
||||
my $values = xCAT::FSPUtils::fsp_api_action ($request, $cec_name, $d, "query_octant_cfg");
|
||||
my $Rc = shift(@$values);
|
||||
if ( $Rc != 0 ) {
|
||||
return( [[$cec_name,$$values[0],$Rc]] );
|
||||
@@ -1287,7 +1299,7 @@ sub create {
|
||||
|
||||
|
||||
#$values = xCAT::FSPUtils::fsp_api_create_parttion( $starting_lpar_id, $octant_cfg, $node_number, $d, "set_octant_cfg");
|
||||
$values = xCAT::FSPUtils::fsp_api_action ($cec_name, $d, "set_octant_cfg", 0, $parameters);
|
||||
$values = xCAT::FSPUtils::fsp_api_action ($request,$cec_name, $d, "set_octant_cfg", 0, $parameters);
|
||||
my $Rc = $$values[2];
|
||||
my $data = $$values[1];
|
||||
if ( $Rc != SUCCESS ) {
|
||||
|
||||
+71
-28
@@ -119,43 +119,52 @@ sub myxCATname
|
||||
|
||||
# make sure xcatd is running - & db is available
|
||||
# this routine is called during initial install of xCAT
|
||||
my $cmd="lsxcatd -d > /dev/null 2>&1";
|
||||
my $outref = [];
|
||||
@$outref = `$cmd`;
|
||||
my $rc = $? >> 8;
|
||||
|
||||
if ($rc == 0)
|
||||
{
|
||||
|
||||
if (xCAT::Utils->isMN())
|
||||
{
|
||||
|
||||
my $cmd="lsxcatd -d > /dev/null 2>&1";
|
||||
my $outref = [];
|
||||
@$outref = `$cmd`;
|
||||
my $rc = $? >> 8;
|
||||
if ($rc == 0)
|
||||
{
|
||||
if (xCAT::Utils->isMN())
|
||||
{
|
||||
# read the site table, master attrib
|
||||
my $hostname = xCAT::Utils->get_site_Master();
|
||||
if (($hostname =~ /\d+\.\d+\.\d+\.\d+/) || ($hostname =~ /:/))
|
||||
{
|
||||
$name = xCAT::NetworkUtils->gethostname($hostname);
|
||||
$name = xCAT::NetworkUtils->gethostname($hostname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$name = $hostname;
|
||||
}
|
||||
|
||||
}
|
||||
elsif (xCAT::Utils->isServiceNode())
|
||||
{
|
||||
|
||||
# the myxcatpost_<nodename> file should exist on all nodes!
|
||||
my $catcmd = "cat /xcatpost/myxcatpost_* | grep '^NODE='";
|
||||
# - can't use runcmd because this routine is called by runcmd
|
||||
|
||||
my $output = `$catcmd`;
|
||||
if ($::RUNCMD_RC == 0)
|
||||
}
|
||||
elsif (xCAT::Utils->isServiceNode())
|
||||
{
|
||||
my $filename;
|
||||
# get any files with the format myxcatpost_*
|
||||
my $lscmd = qq~/bin/ls /xcatpost/myxcatpost_* 2>/dev/null~;
|
||||
my $output = `$lscmd`;
|
||||
my $rc = $? >> 8;
|
||||
if ($rc == 0)
|
||||
{
|
||||
($junk, $name) = split('=', $output);
|
||||
foreach my $line ( split(/\n/, $output)) {
|
||||
my ($junk, $hostname) = split('myxcatpost_', $line);
|
||||
if (xCAT::InstUtils->is_me($hostname)) {
|
||||
$filename="/xcatpost/myxcatpost_$hostname";
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
if ( -e $filename ) {
|
||||
my $catcmd = qq~/bin/cat $filename | grep '^NODE=' 2>/dev/null~;
|
||||
my $string = `$catcmd`;
|
||||
if ($rc == 0) {
|
||||
($junk, $name) = split('=', $string);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$name) {
|
||||
$name = hostname();
|
||||
@@ -1007,7 +1016,36 @@ sub dolitesetup
|
||||
}
|
||||
}
|
||||
|
||||
# need list for just this set of nodes!!!
|
||||
my $nrange;
|
||||
my @flist;
|
||||
my @litef;
|
||||
if (scalar(@nodel) > 0)
|
||||
{
|
||||
$nrange = join(',',@nodel);
|
||||
}
|
||||
|
||||
my @flist = xCAT::Utils->runcmd("/opt/xcat/bin/litefile $nrange", -1);
|
||||
if (scalar(@flist) > 0) {
|
||||
foreach my $l (@flist) {
|
||||
my ($j1, $j2, $file) = split /\s+/, $l;
|
||||
push (@litef, $file);
|
||||
}
|
||||
}
|
||||
my $foundras;
|
||||
if (scalar(@litef) > 0) {
|
||||
foreach my $f (@litef) {
|
||||
chomp $f;
|
||||
if (($f eq "/var/adm/ras/") || ($f eq "/var/adm/ras/conslog")) {
|
||||
$foundras++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($foundras) {
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "One or more nodes is using a persistent \/var\/adm\/ras\/ directory. \nWhen the nodes boot up you will then have to move the conslog file to a \nlocation outside of the persistent directory. (Leaving the conslog \nfile in a persistent directory can occasionally lead to a deadlock situation.) \nThis can be done by using the xdsh command to run swcons on the \ncluster nodes. \n(Ex. xdsh <noderange> \'\/usr\/sbin\/swcons -p \/tmp\/conslog\') \n";
|
||||
xCAT::MsgUtils->message("W", $rsp, $callback);
|
||||
}
|
||||
|
||||
unless (open(LITETREE, ">$litetreetable"))
|
||||
{
|
||||
@@ -1019,12 +1057,13 @@ sub dolitesetup
|
||||
my @treelist = xCAT::Utils->runcmd("/opt/xcat/bin/litetree $noderange", -1);
|
||||
if (scalar(@treelist) > 0) {
|
||||
foreach my $l (@treelist) {
|
||||
my ($p, $serv, $dir) = split (/:/, $l);
|
||||
my ($p, $serv, $dir, $mopts) = split (/:/, $l);
|
||||
$p =~ s/\s*//g;
|
||||
$serv =~ s/\s*//g;
|
||||
$dir =~ s/\s*//g;
|
||||
$mopts =~ s/\s*//g;
|
||||
my $serverIP = xCAT::NetworkUtils->getipaddr($serv);
|
||||
my $entry = "$p|$serverIP|$dir";
|
||||
my $entry = "$p|$serverIP|$dir|$mopts";
|
||||
print LITETREE $entry . "\n";
|
||||
$foundstatelite++;
|
||||
}
|
||||
@@ -1095,6 +1134,10 @@ sub dolitesetup
|
||||
# $file could be full path file name or dir name
|
||||
# ex. /foo/bar/ or /etc/lppcfg
|
||||
my ($node, $option, $file) = split (/\|/, $line);
|
||||
|
||||
if (!$file) {
|
||||
next;
|
||||
}
|
||||
|
||||
# ex. .../inst_root/foo/bar/ or .../inst_root/etc/lppcfg
|
||||
my $instrootfile = $instrootloc . $file;
|
||||
|
||||
@@ -827,7 +827,7 @@ sub get_mac_addr {
|
||||
$done[0] = 0;
|
||||
$cmd[0] = "\" local-mac-address\" ". $phandle . " get-package-property\r";
|
||||
$msg[0] = "Status: return code and mac-address now on stack\n";
|
||||
$pattern[0] = "ok";#"\s*3 >";
|
||||
$pattern[0] = "local-mac-address.*ok";#"\s*3 >";
|
||||
$newstate[0] = 1;
|
||||
|
||||
# cmd(1) is a dot (.). This is a stack manipulation command that removes one
|
||||
@@ -1231,8 +1231,8 @@ sub ping_server{
|
||||
$done[2] = 0;
|
||||
$cmd[2] = "dev /packages/net\r";
|
||||
$msg[2] = "Status: selected the /packages/net node as the active package\n";
|
||||
#$pattern[2] = ".*dev(.*)ok(.*)0 >(.*)";
|
||||
$pattern[2] = "ok";
|
||||
$pattern[2] = ".*dev.*packages.*net(.*)ok(.*)0 >(.*)";
|
||||
#$pattern[2] = "ok";
|
||||
$newstate[2]= 3;
|
||||
|
||||
# state 3, ping the server
|
||||
@@ -1266,6 +1266,7 @@ sub ping_server{
|
||||
# state 5, all done
|
||||
$done[5] = 1;
|
||||
|
||||
|
||||
# for ping, only need to set speed and duplex for ethernet adapters
|
||||
#
|
||||
if ( $list_type eq "ent" ) {
|
||||
@@ -1323,8 +1324,10 @@ sub ping_server{
|
||||
|
||||
$timeout = 300;
|
||||
while ( $done[$state] eq 0 ) {
|
||||
|
||||
send_command($verbose, $rconsole, $cmd[$state]);
|
||||
@result = $rconsole->expect(
|
||||
|
||||
$timeout,
|
||||
[qr/$pattern[$state]/s=>
|
||||
sub {
|
||||
@@ -1362,7 +1365,9 @@ sub ping_server{
|
||||
}
|
||||
],
|
||||
);
|
||||
return 1 if ($rc eq 1);
|
||||
|
||||
return 1 if ($rc eq 1);
|
||||
|
||||
if ( $state eq 1 ) {
|
||||
$adap_conn = $adap_conn_list[$j];
|
||||
$cmd[1] = "\" ethernet,$adap_speed,$adap_conn,$adap_duplex\" encode-string \" chosen-network-type\" property\r";
|
||||
@@ -1849,6 +1854,14 @@ sub boot_network {
|
||||
$state = $newstate[$state];
|
||||
}
|
||||
],
|
||||
# For some old firmware, does not output "----"
|
||||
[qr/BOOTP/=>
|
||||
sub {
|
||||
nc_msg ($verbose, $msg[$state]);
|
||||
$rconsole->clear_accum();
|
||||
$state = $newstate[$state];
|
||||
}
|
||||
],
|
||||
[qr/]/=>
|
||||
sub {
|
||||
nc_msg($verbose, "Unexpected prompt\n");
|
||||
@@ -1917,7 +1930,28 @@ sub Boot {
|
||||
#],
|
||||
[qr/BOOTP/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding, exiting.\n");
|
||||
nc_msg($verbose, "# Network boot proceeding - matched BOOTP, exiting.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
# Welcome to AIX - some old firmware does not output BOOTP or ----
|
||||
[qr/Welcome/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding - matched Welcome, exiting.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
# tftp file download - some old firmware does not output BOOTP or ----
|
||||
[qr/FILE/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding - matched FILE.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
# some old firmware does not output BOOTP or ----
|
||||
[qr/Elapsed/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding - matched Elapsed, exiting.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
@@ -2021,14 +2055,46 @@ sub multiple_open_dev {
|
||||
; \r";
|
||||
send_command($verbose, $rconsole, $command);
|
||||
|
||||
$command = "patch new-open-dev open-dev net-ping \r";
|
||||
send_command($verbose, $rconsole, $command);
|
||||
|
||||
$timeout = 30;
|
||||
$rconsole->expect(
|
||||
$timeout,
|
||||
#[qr/patch new-open-dev(.*)>/=>
|
||||
[qr/>/=>
|
||||
[qr/new-open-dev(.*)ok/=>
|
||||
#[qr/>/=>
|
||||
sub {
|
||||
nc_msg($verbose, "Status: at End of multiple_open_dev \n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
[qr/]/=>
|
||||
sub {
|
||||
nc_msg($verbose, "Unexpected prompt\n");
|
||||
$rconsole->clear_accum();
|
||||
$rc = 1;
|
||||
}
|
||||
],
|
||||
[timeout =>
|
||||
sub {
|
||||
send_user(2, "Timeout\n");
|
||||
$rconsole->clear_accum();
|
||||
$rc = 1;
|
||||
}
|
||||
],
|
||||
[eof =>
|
||||
sub {
|
||||
send_user(2, "Cannot connect to $node\n");
|
||||
$rconsole->clear_accum();
|
||||
$rc = 1;
|
||||
}
|
||||
],
|
||||
);
|
||||
|
||||
$command = "patch new-open-dev open-dev net-ping \r";
|
||||
send_command($verbose, $rconsole, $command);
|
||||
|
||||
$rconsole->expect(
|
||||
$timeout,
|
||||
[qr/patch new-open-dev(.*)ok/=>
|
||||
#[qr/>/=>
|
||||
sub {
|
||||
nc_msg($verbose, "Status: at End of multiple_open_dev \n");
|
||||
$rconsole->clear_accum();
|
||||
@@ -2057,6 +2123,7 @@ sub multiple_open_dev {
|
||||
}
|
||||
],
|
||||
);
|
||||
|
||||
return $rc;
|
||||
}
|
||||
###################################################################
|
||||
@@ -2540,7 +2607,7 @@ sub lparnetbootexp
|
||||
####################################
|
||||
nc_msg($verbose, "Connecting to the $node.\n");
|
||||
sleep 3;
|
||||
$timeout = 2;
|
||||
$timeout = 10;
|
||||
$rconsole->expect(
|
||||
$timeout,
|
||||
[ qr/Enter.* for help.*/i =>
|
||||
@@ -2594,7 +2661,7 @@ sub lparnetbootexp
|
||||
# if -o is not used, power node of
|
||||
####################################
|
||||
unless ($from_of) {
|
||||
if (($output =~ /off/i) or ($output =~ /Not Activated/i) ) {
|
||||
if (($output =~ /^off$/i) or ($output =~ /Not Activated/i) ) {
|
||||
nc_msg($verbose, "# Power off complete.\n");
|
||||
} else {
|
||||
nc_msg($verbose, "# Begin to Power off the node.\n");
|
||||
@@ -2622,7 +2689,7 @@ sub lparnetbootexp
|
||||
$query_count = 0;
|
||||
while (!$done) {
|
||||
$output = xCAT::LparNetbootExp->run_lssyscfg($subreq, $verbose, $node);
|
||||
if (($output =~ /off/i) or ($output =~ /Not Activated/)) {
|
||||
if (($output =~ /^off$/i) or ($output =~ /Not Activated/)) {
|
||||
nc_msg($verbose, "Power off complete.\n");
|
||||
$done = 1;
|
||||
next;
|
||||
@@ -2749,6 +2816,8 @@ sub lparnetbootexp
|
||||
$done = 0;
|
||||
$retry_count = 0;
|
||||
|
||||
$timeout = 10;
|
||||
|
||||
while (!$done) {
|
||||
my @result = $rconsole->expect(
|
||||
$timeout,
|
||||
@@ -2856,6 +2925,7 @@ sub lparnetbootexp
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
##############################
|
||||
# Call multiple_open_dev to
|
||||
# circumvent firmware OPEN-DEV
|
||||
@@ -2890,6 +2960,7 @@ sub lparnetbootexp
|
||||
$match_pat = ".*";
|
||||
}
|
||||
|
||||
|
||||
if($colon) {
|
||||
nc_msg($verbose, "#Type:Location_Code:MAC_Address:Full_Path_Name:Ping_Result:Device_Type:Size_MB:OS:OS_Version:\n");
|
||||
$outputarrayindex++; # start from 1, 0 is used to set as 0
|
||||
@@ -2943,7 +3014,7 @@ sub lparnetbootexp
|
||||
} else {
|
||||
for( $i = 0; $i < $adapter_found; $i++) {
|
||||
if ($adap_type[$i] =~ /$match_pat/) {
|
||||
if ($adap_type[$i] eq "hfi-ent") {
|
||||
if (!($adap_type[$i] eq "hfi-ent")) {
|
||||
$mac_address = get_mac_addr($phandle_array[$i], $rconsole, $node, $verbose);
|
||||
$loc_code = get_adaptr_loc($phandle_array[$i], $rconsole, $node, $verbose);
|
||||
}
|
||||
@@ -3148,12 +3219,12 @@ sub lparnetbootexp
|
||||
}
|
||||
],
|
||||
);
|
||||
return [1] if ($rc eq 1);
|
||||
}
|
||||
nc_msg($verbose, "# bootp sent over network.\n");
|
||||
$rc = Boot($rconsole, $node, $verbose);#, @expect_out);
|
||||
unless ($rc eq 0) {
|
||||
nc_msg($verbose, "Can't boot here. \n");
|
||||
return [1] if ($rc eq 1);
|
||||
nc_msg($verbose, "# bootp sent over network.\n");
|
||||
$rc = Boot($rconsole, $node, $verbose);#, @expect_out);
|
||||
unless ($rc eq 0) {
|
||||
nc_msg($verbose, "Can't boot here. \n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3180,7 +3251,7 @@ sub lparnetbootexp
|
||||
# separate the nodename from the query status
|
||||
##############################################
|
||||
if ($from_of != 1) {
|
||||
if (( $output =~ /off/i ) or ($output =~ /Not Activated/i)) {
|
||||
if (( $output =~ /^off$/i ) or ($output =~ /Not Activated/i)) {
|
||||
$done = 1;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
#!/usr/bin/perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
package xCAT::MacMap;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
|
||||
require Exporter;
|
||||
our @ISA=qw/Exporter/;
|
||||
our @EXPORT_OK=qw/walkoid/;
|
||||
@@ -174,11 +181,19 @@ sub rvlan {
|
||||
#first order of business is to identify the target switches
|
||||
my $switchtab=xCAT::Table->new('switch',-create=>0);
|
||||
unless ($switchtab) { return; }
|
||||
my $switchents = $switchtab->getNodesAttribs($nodes,[qw/switch port/]);
|
||||
my $switchents = $switchtab->getNodesAttribs($nodes,[qw/switch port interface/]);
|
||||
my $node;
|
||||
foreach $node (keys %$switchents) {
|
||||
my $entry;
|
||||
foreach $entry (@{$switchents->{$node}}) {
|
||||
#skip the none primary interface.
|
||||
# The vlaue of the primary interface could be empty, primary or primary:ethx
|
||||
if (defined($entry->{interface})) {
|
||||
if ($entry->{interface} !~ /primary/) {
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
$self->{switches}->{$entry->{switch}}->{$entry->{port}} = $node;
|
||||
}
|
||||
}
|
||||
@@ -318,6 +333,7 @@ sub refresh_table {
|
||||
$self->{switches} = {};
|
||||
foreach my $entry (@entries) {
|
||||
if (defined($entry->{switch}) and $entry->{switch} ne "" and defined($entry->{port}) and $entry->{port} ne "") {
|
||||
|
||||
if ( !$self->{switches}->{$entry->{switch}}->{$entry->{port}})
|
||||
{
|
||||
$self->{switches}->{$entry->{switch}}->{$entry->{port}} = $entry->{node};
|
||||
@@ -337,6 +353,9 @@ sub refresh_table {
|
||||
if ($checked_pairs{$entry->{switch}}) {
|
||||
next;
|
||||
}
|
||||
while($children > 64) {
|
||||
$self->handle_output($inputs);
|
||||
}
|
||||
$checked_pairs{$entry->{switch}}=1;
|
||||
pipe my $child,my $parent;
|
||||
$child->autoflush(1);
|
||||
|
||||
@@ -710,5 +710,24 @@ sub backup_logfile
|
||||
return $::OK;
|
||||
}
|
||||
|
||||
sub verbose_message
|
||||
{
|
||||
shift;
|
||||
my $req = shift;
|
||||
my $data = shift;
|
||||
if (!defined($req->{verbose})) {
|
||||
return;
|
||||
}
|
||||
my ($sec,$min,$hour,$mday,$mon,$yr,$wday,$yday,$dst) = localtime(time);
|
||||
my $time = sprintf "%04d%02d%02d.%02d:%02d:%02d", $yr+1900,$mon+1,$mday,$hour,$min,$sec;
|
||||
$data = "$time ($$) ".$data;
|
||||
if (defined($req->{callback})) {
|
||||
my %rsp;
|
||||
$rsp{data} = [$data];
|
||||
xCAT::MsgUtils->message("I", \%rsp, $req->{callback});
|
||||
} else {
|
||||
xCAT::MsgUtils->message("I", $data);
|
||||
}
|
||||
}
|
||||
1;
|
||||
|
||||
|
||||
@@ -365,7 +365,12 @@ sub ishostinsubnet {
|
||||
$numbits=128;
|
||||
}
|
||||
if ($mask) {
|
||||
$mask=getipaddr($mask,GetNumber=>1);
|
||||
if ($mask =~ /\//) {
|
||||
$mask =~ s/^\///;
|
||||
$mask=Math::BigInt->new("0b".("1"x$mask).("0"x($numbits-$mask)));
|
||||
} else {
|
||||
$mask=getipaddr($mask,GetNumber=>1);
|
||||
}
|
||||
} else { #CIDR notation supported
|
||||
if ($subnet =~ /\//) {
|
||||
($subnet,$mask) = split /\//,$subnet,2;
|
||||
|
||||
+27
-18
@@ -35,6 +35,9 @@ my @allnodeset;
|
||||
my %allnodehash;
|
||||
my @grplist;
|
||||
my $didgrouplist;
|
||||
my $glstamp=0;
|
||||
my $allnodesetstamp=0;
|
||||
my $allgrphashstamp=0;
|
||||
my %allgrphash;
|
||||
my $retaincache=0;
|
||||
my $recurselevel=0;
|
||||
@@ -180,16 +183,19 @@ sub nodesbycriteria {
|
||||
sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels5.3)
|
||||
my $atom = shift;
|
||||
if ($recurselevel > 4096) { die "NodeRange seems to be hung on evaluating $atom, recursion limit hit"; }
|
||||
unless (scalar(@allnodeset)) { #Build a cache of all nodes, some corner cases will perform worse, but by and large it will do better. We could do tests to see where the breaking points are, and predict how many atoms we have to evaluate to mitigate, for now, implement the strategy that keeps performance from going completely off the rails
|
||||
unless (scalar(@allnodeset) and (($allnodesetstamp+5) > time())) { #Build a cache of all nodes, some corner cases will perform worse, but by and large it will do better. We could do tests to see where the breaking points are, and predict how many atoms we have to evaluate to mitigate, for now, implement the strategy that keeps performance from going completely off the rails
|
||||
$allnodesetstamp=time();
|
||||
$nodelist->_set_use_cache(1);
|
||||
@allnodeset = $nodelist->getAllAttribs('node','groups');
|
||||
%allnodehash = map { $_->{node} => 1 } @allnodeset;
|
||||
}
|
||||
my $verify = (scalar(@_) == 1 ? shift : 1);
|
||||
my $verify = (scalar(@_) >= 1 ? shift : 1);
|
||||
my %args = @_;
|
||||
my @nodes= ();
|
||||
#TODO: these env vars need to get passed by the client to xcatd
|
||||
my $nprefix=(defined ($ENV{'XCAT_NODE_PREFIX'}) ? $ENV{'XCAT_NODE_PREFIX'} : 'node');
|
||||
my $nsuffix=(defined ($ENV{'XCAT_NODE_SUFFIX'}) ? $ENV{'XCAT_NODE_SUFFIX'} : '');
|
||||
if ($allnodehash{$atom}) { #The atom is a plain old nodename
|
||||
if (not $args{genericrange} and $allnodehash{$atom}) { #The atom is a plain old nodename
|
||||
return ($atom);
|
||||
}
|
||||
if ($atom =~ /^\(.*\)$/) { # handle parentheses by recursively calling noderange()
|
||||
@@ -203,11 +209,13 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
|
||||
}
|
||||
|
||||
# Try to match groups?
|
||||
unless ($args{genericrange}) {
|
||||
unless ($grptab) {
|
||||
$grptab = xCAT::Table->new('nodegroup');
|
||||
}
|
||||
if ($grptab and not $didgrouplist and not scalar @grplist) {
|
||||
if ($grptab and (($glstamp < (time()-5)) or (not $didgrouplist and not scalar @grplist))) {
|
||||
$didgrouplist = 1;
|
||||
$glstamp=time();
|
||||
@grplist = @{$grptab->getAllEntries()};
|
||||
}
|
||||
my $isdynamicgrp = 0;
|
||||
@@ -235,7 +243,9 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
|
||||
# The atom is not a dynamic node group, is it a static node group???
|
||||
if(!$isdynamicgrp)
|
||||
{
|
||||
unless (scalar %allgrphash) { #build a group membership cache
|
||||
unless (scalar %allgrphash and (time() < ($allgrphashstamp+5))) { #build a group membership cache
|
||||
$allgrphashstamp=time();
|
||||
%allgrphash=();
|
||||
my $nlent;
|
||||
foreach $nlent (@allnodeset) {
|
||||
my @groups=split(/,/,$nlent->{groups});
|
||||
@@ -261,6 +271,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($atom =~ m/[=~]/) { #TODO: this is the clunky, slow code path to acheive the goal. It also is the easiest to write, strange coincidence. Aggregating multiples would be nice
|
||||
my @nodes;
|
||||
@@ -279,7 +290,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
|
||||
}
|
||||
if ($atom =~ m/^[0-9]+\z/) { # if only numbers, then add the prefix
|
||||
my $nodename=$nprefix.$atom.$nsuffix;
|
||||
return expandatom($nodename,$verify);
|
||||
return expandatom($nodename,$verify,%args);
|
||||
}
|
||||
my $nodelen=@nodes;
|
||||
if ($nodelen > 0) {
|
||||
@@ -314,12 +325,12 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
|
||||
$subrange=$subrange."$start$subelem" . ($morebrackets?'':$ending) . "$subop";
|
||||
}
|
||||
foreach (split /,/,$subrange) {
|
||||
my @newnodes=expandatom($_, ($morebrackets?0:$verify));
|
||||
my @newnodes=expandatom($_, ($morebrackets?0:$verify), genericrange=>$morebrackets);
|
||||
if (!$morebrackets) { push @nodes,@newnodes; }
|
||||
else {
|
||||
# for each of the new nodes, add the 2nd brackets and then expand
|
||||
foreach my $n (@newnodes) {
|
||||
push @nodes, expandatom("$n$ending", $verify);
|
||||
push @nodes, expandatom("$n$ending", $verify, %args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -341,7 +352,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
|
||||
$suf=$nsuffix;
|
||||
}
|
||||
foreach ("$startnum".."$endnum") {
|
||||
my @addnodes=expandatom($pref.$_.$suf,$verify);
|
||||
my @addnodes=expandatom($pref.$_.$suf,$verify,%args);
|
||||
@nodes=(@nodes,@addnodes);
|
||||
}
|
||||
return (@nodes);
|
||||
@@ -368,7 +379,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
|
||||
$right=$2;
|
||||
}
|
||||
if ($left eq $right) { #if they said node1-node1 for some strange reason
|
||||
return expandatom($left,$verify);
|
||||
return expandatom($left,$verify,%args);
|
||||
}
|
||||
my @leftarr=split(/(\d+)/,$left);
|
||||
my @rightarr=split(/(\d+)/,$right);
|
||||
@@ -405,7 +416,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
|
||||
}
|
||||
}
|
||||
foreach ($leftarr[$idx]..$rightarr[$idx]) {
|
||||
my @addnodes=expandatom($prefix.$_.$luffix,$verify);
|
||||
my @addnodes=expandatom($prefix.$_.$luffix,$verify,%args);
|
||||
push @nodes,@addnodes;
|
||||
}
|
||||
return (@nodes); #the return has been built, return, exiting loop and all
|
||||
@@ -441,7 +452,10 @@ sub retain_cache { #A semi private operation to be used *ONLY* in the interestin
|
||||
$retaincache=shift;
|
||||
unless ($retaincache) { #take a call to retain_cache(0) to also mean that any existing
|
||||
#cache must be zapped
|
||||
if ($nodelist) { $nodelist->_clear_cache(); }
|
||||
if ($nodelist) { $nodelist->_build_cache(1); }
|
||||
$glstamp=0;
|
||||
$allnodesetstamp=0;
|
||||
$allgrphashstamp=0;
|
||||
undef $nodelist;
|
||||
@allnodeset=();
|
||||
%allnodehash=();
|
||||
@@ -473,7 +487,6 @@ sub extnoderange { #An extended noderange function. Needed as the more straight
|
||||
}
|
||||
$return->{intersectinggroups}=[sort keys %grouphash];
|
||||
}
|
||||
retain_cache(0);
|
||||
return $return;
|
||||
}
|
||||
sub abbreviate_noderange {
|
||||
@@ -538,7 +551,7 @@ sub noderange {
|
||||
$nodelist =xCAT::Table->new('nodelist',-create =>1);
|
||||
$nodelist->_set_use_cache(0); #TODO: a more proper external solution
|
||||
@cachedcolumns = ('node','groups');
|
||||
$nodelist->_build_cache(\@cachedcolumns);
|
||||
$nodelist->_build_cache(\@cachedcolumns,noincrementref=>1);
|
||||
$nodelist->_set_use_cache(1); #TODO: a more proper external solution
|
||||
}
|
||||
my %nodes = ();
|
||||
@@ -621,10 +634,6 @@ sub noderange {
|
||||
}
|
||||
if ($recurselevel) {
|
||||
$recurselevel--;
|
||||
} else {
|
||||
unless ($retaincache) {
|
||||
retain_cache(0);
|
||||
}
|
||||
}
|
||||
return sort (keys %nodes);
|
||||
|
||||
|
||||
+789
-16
@@ -4,9 +4,14 @@ package xCAT::PPCcfg;
|
||||
use strict;
|
||||
use Getopt::Long;
|
||||
use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR);
|
||||
use xCAT::PPCfsp;
|
||||
use xCAT::Usage;
|
||||
use Storable qw(freeze thaw);
|
||||
use POSIX "WNOHANG";
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
|
||||
|
||||
use LWP;
|
||||
use HTTP::Cookies;
|
||||
##########################################
|
||||
# Globals
|
||||
##########################################
|
||||
@@ -16,8 +21,8 @@ my %rspconfig = (
|
||||
hostname => \&hostname
|
||||
);
|
||||
|
||||
|
||||
|
||||
my %rsp_result;
|
||||
my $start;
|
||||
##########################################################################
|
||||
# Parse the command line for options and operands
|
||||
##########################################################################
|
||||
@@ -90,7 +95,7 @@ sub parse_args {
|
||||
#}
|
||||
|
||||
my $nodes = $request->{node};
|
||||
my $typehash = xCAT::DBobjUtils->getnodetype($nodes, "ppc");
|
||||
my $typehash = xCAT::DBobjUtils->getnodetype($nodes);
|
||||
foreach my $nn (@$nodes) {
|
||||
$request->{hwtype} = $$typehash{$nn};
|
||||
last if ($request->{hwtype});
|
||||
@@ -121,7 +126,7 @@ sub parse_args {
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
$request->{method} = undef;
|
||||
|
||||
if ( !GetOptions( \%opt, qw(V|Verbose resetnet))) {
|
||||
if ( !GetOptions( \%opt, qw(V|verbose resetnet))) {
|
||||
return( usage() );
|
||||
}
|
||||
####################################
|
||||
@@ -358,6 +363,7 @@ sub passwd {
|
||||
while ( my ($cec,$h) = each(%$hash) ) {
|
||||
while ( my ($node,$d) = each(%$h) ) {
|
||||
my $type = @$d[4];
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :modify password of $usr for node:$node.");
|
||||
my $data = xCAT::PPCcli::chsyspwd( $exp, $usr, $type, $cec, $passwd, $newpasswd );
|
||||
my $Rc = shift(@$data);
|
||||
my $usr_back = $usr;
|
||||
@@ -368,6 +374,7 @@ sub passwd {
|
||||
# Write the new password to table
|
||||
##################################
|
||||
if ( $Rc == SUCCESS ) {
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :update xCATdb for node:$node,ID:$usr_back.");
|
||||
xCAT::PPCdb::update_credentials( $node, $type, $usr_back, $newpasswd );
|
||||
}
|
||||
}
|
||||
@@ -437,6 +444,7 @@ sub sshcfg {
|
||||
# Determine if SSH is enabled
|
||||
#####################################
|
||||
if ( !defined( $mode )) {
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :check sshcfg for user:$logon on node:$server.");
|
||||
my $result = xCAT::PPCcli::send_cmd( $exp, "cat $auth" );
|
||||
my $Rc = shift(@$result);
|
||||
|
||||
@@ -459,6 +467,7 @@ sub sshcfg {
|
||||
#####################################
|
||||
# Enable/disable SSH
|
||||
#####################################
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :sshcfg $mode for user:$logon on node:$server.");
|
||||
my $result = xCAT::PPCcli::mkauthkeys( $exp, $mode, $logon, $sshkey );
|
||||
my $Rc = shift(@$result);
|
||||
|
||||
@@ -502,6 +511,7 @@ sub frame {
|
||||
#################################
|
||||
# Get frame number
|
||||
#################################
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :get frame_num for node:$node.");
|
||||
$data = xCAT::PPCcli::lssyscfg( $exp, @$d[4], @$d[2], 'frame_num' );
|
||||
$Rc = shift(@$data);
|
||||
|
||||
@@ -532,6 +542,7 @@ sub frame {
|
||||
if ( !defined($ent) or !defined($ent->{id}) ) {
|
||||
return( [[$node,"Cannot find frame num in database",RC_ERROR]] );
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :set frame_num=".$ent->{id}." for node:$node.");
|
||||
$data = xCAT::PPCcli::chsyscfg( $exp, "bpa", $d, "frame_num=".$ent->{id} );
|
||||
$Rc = shift(@$data);
|
||||
|
||||
@@ -549,6 +560,7 @@ sub frame {
|
||||
# Set frame number
|
||||
# Read the frame number from opt
|
||||
#################################
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :set frame_num=$value for node:$node.");
|
||||
$data = xCAT::PPCcli::chsyscfg( $exp, "bpa", $d, "frame_num=$value" );
|
||||
$Rc = shift(@$data);
|
||||
|
||||
@@ -564,6 +576,7 @@ sub frame {
|
||||
#################################
|
||||
# Set frame number to database
|
||||
#################################
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig : set frame_num, update node:$node attr id=$value.");
|
||||
$tab->setNodeAttribs( $node, { id=>$value } );
|
||||
}
|
||||
}
|
||||
@@ -596,6 +609,7 @@ sub hostname {
|
||||
#################################
|
||||
# Get system name
|
||||
#################################
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :get system name for node:$node.");
|
||||
$data = xCAT::PPCcli::lssyscfg( $exp, @$d[4], @$d[2], 'name' );
|
||||
$Rc = shift(@$data);
|
||||
|
||||
@@ -608,6 +622,7 @@ sub hostname {
|
||||
|
||||
push @$result, [$node,@$data[0],SUCCESS];
|
||||
} elsif ( $value eq '*' ) {
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :set system name:$node for node:$node.");
|
||||
$data = xCAT::PPCcli::chsyscfg( $exp, @$d[4], $d, "new_name=$node" );
|
||||
$Rc = shift(@$data);
|
||||
|
||||
@@ -620,6 +635,7 @@ sub hostname {
|
||||
|
||||
push @$result, [$node,@$data[0],SUCCESS];
|
||||
} else {
|
||||
xCAT::MsgUtils->verbose_message($request, "rspconfig :set system name:$value for node:$node.");
|
||||
$data = xCAT::PPCcli::chsyscfg( $exp, @$d[4], $d, "new_name=$value" );
|
||||
$Rc = shift(@$data);
|
||||
|
||||
@@ -639,22 +655,779 @@ sub hostname {
|
||||
return( [@$result] );
|
||||
}
|
||||
##########################################################################
|
||||
# Do resetnet
|
||||
# Do resetnet public entry
|
||||
##########################################################################
|
||||
sub resetnet {
|
||||
my $request = shift;
|
||||
my $hash = shift;
|
||||
my %nodehash;
|
||||
foreach ( @{$request->{noderange}}) {
|
||||
$nodehash{$_} = 1;
|
||||
}
|
||||
# go to use lsslp do_resetnet
|
||||
my $result = xCAT_plugin::lsslp::do_resetnet($request, \%nodehash);
|
||||
return [$result];
|
||||
doresetnet($request);
|
||||
return 0;
|
||||
}
|
||||
##########################################################################
|
||||
# Reset the network interfraces if necessary
|
||||
##########################################################################
|
||||
sub doresetnet {
|
||||
|
||||
my $req = shift;
|
||||
my %iphash;
|
||||
my $targets;
|
||||
my $result;
|
||||
my %grouphash;
|
||||
my %oihash;
|
||||
my %machash;
|
||||
my %vpdhash;
|
||||
|
||||
unless ($req) {
|
||||
send_msg( $req, 1, "request is empty, return" );
|
||||
return;
|
||||
}
|
||||
###########################################
|
||||
# prepare to reset network
|
||||
###########################################
|
||||
xCAT::MsgUtils->verbose_message($req, "rspconfig :do resetnet begin to phase nodes");
|
||||
my $hoststab = xCAT::Table->new( 'hosts' );
|
||||
if ( !$hoststab ) {
|
||||
send_msg( $req, 1, "Error open hosts table" );
|
||||
return;
|
||||
} else {
|
||||
my @hostslist = $hoststab->getAllNodeAttribs(['node','otherinterfaces']);
|
||||
foreach my $otherentry ( @hostslist) {
|
||||
$oihash{$otherentry->{node}} = $otherentry->{otherinterfaces};
|
||||
}
|
||||
}
|
||||
|
||||
my $mactab = xCAT::Table->new( 'mac' );
|
||||
if ( !$mactab ) {
|
||||
send_msg( $req, 1, "Error open mac table" );
|
||||
return;
|
||||
}else{
|
||||
my @maclist = $mactab->getAllNodeAttribs(['node','mac']);
|
||||
foreach my $macentry (@maclist) {
|
||||
$machash{$macentry->{node}} = $macentry->{mac};
|
||||
}
|
||||
}
|
||||
$mactab = ();
|
||||
|
||||
my $vpdtab = xCAT::Table->new( 'vpd' );
|
||||
if ( !$vpdtab ) {
|
||||
send_msg( $req, 1, "Error open vpd table" );
|
||||
return;
|
||||
} else {
|
||||
my @vpdlist = $vpdtab->getAllNodeAttribs(['node','mtm','serial','side']);
|
||||
foreach my $vpdentry (@vpdlist) {
|
||||
if ($vpdentry->{side} =~ /(\w)\-\w/) {
|
||||
my $side = $1;
|
||||
$vpdhash{$vpdentry->{node}} = $vpdentry->{mtm}."*".$vpdentry->{serial}."*".$side;
|
||||
}
|
||||
}
|
||||
}
|
||||
$vpdtab = ();
|
||||
|
||||
unless ( $req->{node} ) {
|
||||
send_msg( $req, 0, "no node specified" );
|
||||
return;
|
||||
}
|
||||
###########################################
|
||||
# Process nodes and get network information
|
||||
###########################################
|
||||
my $nodetype = $req->{hwtype};
|
||||
if ( $nodetype =~ /^(cec|frame)$/ ) {
|
||||
# this brunch is just for the xcat 2.6(or 2.6+) database
|
||||
foreach my $nn ( @{ $req->{node}} ) {
|
||||
my $cnodep = xCAT::DBobjUtils->getchildren($nn);
|
||||
$nodetype = ( $nodetype =~ /^frame$/i ) ? "bpa" : "fsp";
|
||||
if ($cnodep) {
|
||||
foreach my $cnode (@$cnodep) {
|
||||
my $ip = xCAT::Utils::getNodeIPaddress( $cnode );
|
||||
my $oi = $oihash{$cnode};
|
||||
if(!defined $ip) {
|
||||
send_msg($req, "doresetnet: can't get $cnode ip");
|
||||
next;
|
||||
}
|
||||
if(!defined $oi) {
|
||||
send_msg($req, "doresetnet: can't get $cnode hosts.otherinterfaces");
|
||||
next;
|
||||
}
|
||||
if ( exists($oihash{$cnode}) and $ip eq $oihash{$cnode}) {
|
||||
send_msg( $req, 0, "$cnode: same ip address, skipping $nn network reset" );
|
||||
} elsif( ! exists $machash{$cnode}){
|
||||
send_msg( $req, 0, "$cnode: no mac defined, skipping $nn network reset" );
|
||||
} else {
|
||||
$iphash{$cnode}{sip} = $ip;
|
||||
$iphash{$cnode}{tip} = $oihash{$cnode};
|
||||
if(exists $grouphash{$vpdhash{$cnode}}) {
|
||||
$grouphash{$vpdhash{$cnode}} .= ",$cnode";
|
||||
} else {
|
||||
$grouphash{$vpdhash{$cnode}} = "$cnode";
|
||||
}
|
||||
$targets->{$nodetype}->{$ip}->{'args'} = "0.0.0.0,$cnode";
|
||||
$targets->{$nodetype}->{$ip}->{'mac'} = $machash{$cnode};
|
||||
$targets->{$nodetype}->{$ip}->{'name'} = $cnode;
|
||||
$targets->{$nodetype}->{$ip}->{'ip'} = $ip;
|
||||
$targets->{$nodetype}->{$ip}->{'type'} = $nodetype;
|
||||
my %netinfo = xCAT::DBobjUtils->getNetwkInfo( [$ip] );
|
||||
$targets->{$nodetype}->{$ip}->{'args'} .= ",$netinfo{$ip}{'gateway'},$netinfo{$ip}{'mask'}";
|
||||
#xCAT::MsgUtils->verbose_message($req, "doresetnet: get node $cnode info $targets->{$nodetype}->{$ip}->{'args'}, ip is $ip");
|
||||
$targets->{$nodetype}->{$oi}->{'args'} = "0.0.0.0,$cnode";
|
||||
$targets->{$nodetype}->{$oi}->{'mac'} = $machash{$cnode};
|
||||
$targets->{$nodetype}->{$oi}->{'name'} = $cnode;
|
||||
$targets->{$nodetype}->{$oi}->{'ip'} = $oi;
|
||||
$targets->{$nodetype}->{$oi}->{'type'} = $nodetype;
|
||||
%netinfo = xCAT::DBobjUtils->getNetwkInfo( [$oi] );
|
||||
$targets->{$nodetype}->{$oi}->{'args'} .= ",$netinfo{$oi}{'gateway'},$netinfo{$oi}{'mask'}";
|
||||
#xCAT::MsgUtils->verbose_message($req, "doresetnet: get node $cnode info $targets->{$nodetype}->{$oi}->{'args'}, oi is $oi");
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
send_msg( $req, 1, "Can't get the fsp/bpa nodes for the $nn" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
# this brunch is just for the xcat 2.5(or 2.5-) databse
|
||||
} elsif ( $nodetype =~ /^(fsp|bpa)$/ ) {
|
||||
foreach my $nn ( @{ $req->{node}} ) {
|
||||
my $ip = xCAT::Utils::getNodeIPaddress( $nn );
|
||||
if(!defined $ip) {
|
||||
send_msg($req, "doresetnet: can't get $nn ip");
|
||||
next;
|
||||
}
|
||||
if(!exists $oihash{$nn}) {
|
||||
send_msg($req, "doresetnet: can't get $nn hosts.otherinterfaces");
|
||||
next;
|
||||
}
|
||||
my $oi = $oihash{$nn};
|
||||
if( exists($oihash{$nn}) and $ip eq $oihash{$nn}) {
|
||||
send_msg( $req, 0, "$nn: same ip address, skipping network reset" );
|
||||
} elsif (!exists $machash{$nn}){
|
||||
send_msg( $req, 0, "$nn: no mac defined, skipping network reset" );
|
||||
} else {
|
||||
$iphash{$nn}{sip} = $ip;
|
||||
$iphash{$nn}{tip} = $oihash{$nn};
|
||||
if(exists $grouphash{$vpdhash{$nn}}) {
|
||||
$grouphash{$vpdhash{$nn}} .= ",$nn";
|
||||
} else {
|
||||
$grouphash{$vpdhash{$nn}} = "$nn";
|
||||
}
|
||||
$targets->{$nodetype}->{$ip}->{'args'} = "0.0.0.0,$nn";
|
||||
$targets->{$nodetype}->{$ip}->{'mac'} = $machash{$nn};
|
||||
$targets->{$nodetype}->{$ip}->{'name'} = $nn;
|
||||
$targets->{$nodetype}->{$ip}->{'ip'} = $ip;
|
||||
$targets->{$nodetype}->{$ip}->{'type'} = $nodetype;
|
||||
my %netinfo = xCAT::DBobjUtils->getNetwkInfo( [$ip] );
|
||||
$targets->{$nodetype}->{$ip}->{'args'} .= ",$netinfo{$ip}{'gateway'},$netinfo{$ip}{'mask'}";
|
||||
#xCAT::MsgUtils->verbose_message($req, "doresetnet: get node $nn info $targets->{$nodetype}->{$ip}->{'args'},ip is $ip");
|
||||
$targets->{$nodetype}->{$oi}->{'args'} = "0.0.0.0,$nn";
|
||||
$targets->{$nodetype}->{$oi}->{'mac'} = $machash{$nn};
|
||||
$targets->{$nodetype}->{$oi}->{'name'} = $nn;
|
||||
$targets->{$nodetype}->{$oi}->{'ip'} = $oi;
|
||||
$targets->{$nodetype}->{$oi}->{'type'} = $nodetype;
|
||||
%netinfo = xCAT::DBobjUtils->getNetwkInfo( [$oi] );
|
||||
$targets->{$nodetype}->{$oi}->{'args'} .= ",$netinfo{$oi}{'gateway'},$netinfo{$oi}{'mask'}";
|
||||
#xCAT::MsgUtils->verbose_message($req, "doresetnet: get node $nn info $targets->{$nodetype}->{$oi}->{'args'}, oi is $oi");
|
||||
}
|
||||
}
|
||||
} elsif ( !$nodetype ){
|
||||
send_msg( $req, 0, "no nodetype defined, skipping network reset" );
|
||||
return;
|
||||
} else {
|
||||
send_msg( $req, 0, "$nodetype not supported, skipping network reset" );
|
||||
return;
|
||||
}
|
||||
|
||||
unless (%grouphash) {
|
||||
send_msg( $req, 0, "Failed to group the nodes, skipping network reset" );
|
||||
return;
|
||||
}
|
||||
###########################################
|
||||
# Update target hardware w/discovery info
|
||||
###########################################
|
||||
my %rsp_dev = get_rsp_dev( $req, $targets);
|
||||
|
||||
######################################################
|
||||
# Start to reset network. Fork one process per BPA/FSP
|
||||
######################################################
|
||||
%oihash = ();
|
||||
%machash = ();
|
||||
%vpdhash = ();
|
||||
$start = Time::HiRes::gettimeofday();
|
||||
my $children = 0;
|
||||
$SIG{CHLD} = sub { while (waitpid(-1, WNOHANG) > 0) { $children--; } };
|
||||
my $fds = new IO::Select;
|
||||
my $callback = $req->{callback};
|
||||
my $ij = 0;
|
||||
foreach my $node ( keys %grouphash) {
|
||||
my %iphashfornode;
|
||||
my $gc = $grouphash{$node};
|
||||
my %rsp_devfornode;
|
||||
|
||||
foreach my $tn (split /,/, $gc) {
|
||||
$iphashfornode{$tn} = $iphash{$tn};
|
||||
for my $ti (keys %{$iphash{$tn}}){
|
||||
my $tip = $iphash{$tn}{$ti};
|
||||
$rsp_devfornode{$tip} = $rsp_dev{$tip};
|
||||
}
|
||||
}
|
||||
|
||||
xCAT::MsgUtils->verbose_message($req, "========> begin to fork process for node $node");
|
||||
######################################################
|
||||
# Begin fork
|
||||
######################################################
|
||||
my $pipe;
|
||||
my $rspdevref = \%rsp_devfornode;
|
||||
my $grouphashref = $gc;
|
||||
my $iphashref = \%iphashfornode;
|
||||
my $result;
|
||||
my @data = ("RSPCONFIG6sK4ci");
|
||||
|
||||
#######################################
|
||||
# Pipe childs output back to parent
|
||||
#######################################
|
||||
my $parent;
|
||||
my $child;
|
||||
pipe $parent, $child;
|
||||
$ij ++;
|
||||
$ij = int($ij%60);
|
||||
my $pid = xCAT::Utils->xfork();
|
||||
|
||||
if ( !defined($pid) ) {
|
||||
###################################
|
||||
# Fork error
|
||||
###################################
|
||||
send_msg( $req, 1, "Fork error: $!" );
|
||||
return undef;
|
||||
}
|
||||
elsif ( $pid == 0 ) {
|
||||
sleep $ij;
|
||||
###################################
|
||||
# Child process, clear memory first
|
||||
###################################
|
||||
%rsp_dev = ();
|
||||
%grouphash = ();
|
||||
%iphash = ();
|
||||
close( $parent );
|
||||
$req->{pipe} = $child;
|
||||
my $msgs;
|
||||
my $report;
|
||||
#try and try to avoid the fail that caused by refreshing IP when doing resetnet
|
||||
my $time = 0;
|
||||
while (1) {
|
||||
my $erflag = 0;
|
||||
$msgs = child_process($grouphashref, $iphashref, $rspdevref, $req, $node );
|
||||
foreach my $port (keys %$msgs){
|
||||
unless ($msgs->{$port} =~ /successful/) {
|
||||
$erflag = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
if ($erflag) {
|
||||
$report = ();
|
||||
foreach my $port1 (keys %$msgs){
|
||||
$report .= $port1.":".$msgs->{$port1}.";";
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message($req, "========> try again, $report");
|
||||
#send_msg( $req, 0, "========> try again, $report");
|
||||
sleep 3;
|
||||
$time++;
|
||||
} else {
|
||||
last;
|
||||
}
|
||||
last if ($time > 10);
|
||||
}
|
||||
$report = ();
|
||||
foreach my $port (keys %$msgs){
|
||||
$report .= $port.":".$msgs->{$port}.";";
|
||||
}
|
||||
send_msg( $req, 0, "Resetnet result for $node is : $report");
|
||||
####################################
|
||||
# Pass result array back to parent
|
||||
####################################
|
||||
my %data;
|
||||
$data{errorcode} = 0;
|
||||
my $out = $req->{pipe};
|
||||
print $out freeze( [\%data] );
|
||||
print $out "\nENDOFFREEZE6sK4ci\n";
|
||||
exit(0);
|
||||
} else {
|
||||
###################################
|
||||
# Parent process
|
||||
###################################
|
||||
close( $child );
|
||||
$pipe = $parent ;
|
||||
}
|
||||
|
||||
|
||||
if ( $pipe ) {
|
||||
$fds->add( $pipe );
|
||||
$children++;
|
||||
}
|
||||
}
|
||||
#############################################
|
||||
# Process responses from children
|
||||
#############################################
|
||||
while ( $children > 0 ) {
|
||||
child_response( $callback, $fds );
|
||||
}
|
||||
while (child_response($callback,$fds)) {}
|
||||
|
||||
my $elapsed = Time::HiRes::gettimeofday() - $start;
|
||||
my $msg = sprintf( "Total rspconfig Time: %.3f sec\n", $elapsed );
|
||||
xCAT::MsgUtils->verbose_message($req, $msg);
|
||||
|
||||
return undef;
|
||||
}
|
||||
##########################################################################
|
||||
# child process
|
||||
##########################################################################
|
||||
sub child_process {
|
||||
my $grouphashref = shift;
|
||||
my $iphashref = shift;
|
||||
my $rspdevref = shift;
|
||||
my $req = shift;
|
||||
my $node = shift;
|
||||
my %msginfo;
|
||||
my @ns = split /,/, $grouphashref;
|
||||
my @valid_ips;
|
||||
my @portneedreset;
|
||||
my @portsuccess;
|
||||
|
||||
##########################################################
|
||||
# ping static ip firstly, if succesufully, skip resetnet
|
||||
##########################################################
|
||||
foreach my $fspport (@ns) {
|
||||
my $ip = ${$iphashref->{$fspport}}{sip};
|
||||
my $rc = system("ping -q -n -c 1 -w 1 $ip > /dev/null");
|
||||
if ($rc == 0) {
|
||||
xCAT::MsgUtils->verbose_message( $req, "ping static $ip successfully");
|
||||
push @valid_ips, $ip; # static ip should be used first
|
||||
push @portsuccess, $fspport;
|
||||
$msginfo{$fspport} = "successful";
|
||||
} else {
|
||||
xCAT::MsgUtils->verbose_message( $req, "ping static $ip failed, need to do resetnet for $fspport");
|
||||
push @portneedreset, $fspport;
|
||||
}
|
||||
}
|
||||
if (scalar (@portneedreset) == 0) {
|
||||
return \%msginfo;
|
||||
}
|
||||
###########################################
|
||||
# ping temp ip secondary
|
||||
###########################################
|
||||
foreach my $fspport (@ns) {
|
||||
my $ip = ${$iphashref->{$fspport}}{tip};
|
||||
my $rc = system("ping -q -n -c 1 -w 1 $ip > /dev/null");
|
||||
if ($rc == 0) {
|
||||
push @valid_ips, $ip;
|
||||
xCAT::MsgUtils->verbose_message( $req, "ping temp $ip successfully");
|
||||
} else {
|
||||
xCAT::MsgUtils->verbose_message( $req, "ping temp $ip failed");
|
||||
}
|
||||
}
|
||||
if (scalar (@valid_ips) == 0) {
|
||||
foreach my $fspport (@ns) {
|
||||
$msginfo{$fspport} = "failed to find valid ip to log on";
|
||||
}
|
||||
return \%msginfo;
|
||||
}
|
||||
#########################################
|
||||
# log on, no retry here
|
||||
#########################################
|
||||
my @exp;
|
||||
my $goodip;
|
||||
my $retry = 2;
|
||||
foreach my $ip(@valid_ips) {
|
||||
@exp = xCAT::PPCcfg::connect(${$rspdevref->{$ip}}{username},${$rspdevref->{$ip}}{password}, $ip);
|
||||
####################################
|
||||
# Successfully connected
|
||||
####################################
|
||||
if ( ref($exp[0]) eq "LWP::UserAgent" ) {
|
||||
$goodip = $ip;
|
||||
xCAT::MsgUtils->verbose_message( $req, "log in successfully with $ip");
|
||||
last;
|
||||
}
|
||||
}
|
||||
my $msg = "login result is :".join(',', @exp);
|
||||
xCAT::MsgUtils->verbose_message( $req, $msg);
|
||||
####################################
|
||||
# do resetnet
|
||||
####################################
|
||||
unless ($goodip) {
|
||||
foreach my $fspport (@ns) {
|
||||
$msginfo{$fspport} = "failed to log on with $exp[0]";
|
||||
}
|
||||
return \%msginfo;
|
||||
}
|
||||
my %handled;
|
||||
my $port;
|
||||
if (scalar(@portneedreset) == 2 ) { ## do resetnet for the other port first
|
||||
$port = $portneedreset[0];
|
||||
my $ip = ${$iphashref->{$port}}{sip};
|
||||
if ($goodip eq $ip) {
|
||||
$port = $portneedreset[1];
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message( $req, "begin to reset for port $port.. good ip is $goodip, ip is $ip....................................");
|
||||
my $rc = system("ping -q -n -c 1 -w 1 $ip > /dev/null");
|
||||
unless ($rc == 0) {
|
||||
$ip = ${$iphashref->{$port}}{tip};
|
||||
$handled{network} = $ip.",".${$rspdevref->{$ip}}{args};
|
||||
my @cmds = ("network=$ip,${$rspdevref->{$ip}}{args}");
|
||||
my %request = (
|
||||
ppcretry => 1,
|
||||
verbose => 0,
|
||||
ppcmaxp => 64,
|
||||
ppctimeout => 0,
|
||||
fsptimeout => 0,
|
||||
ppcretry => 3,
|
||||
maxssh => 8,
|
||||
arg => \@cmds,
|
||||
method => \%handled,
|
||||
command => 'rspconfig',
|
||||
hwtype => ${$rspdevref->{$ip}}{type},
|
||||
);
|
||||
xCAT::MsgUtils->verbose_message( $req, "Begin to do reset for $port, nic is $ip");
|
||||
my $result = xCAT::PPCfsp::handler($ip, \%request, \@exp, 1 );
|
||||
if ($result) {
|
||||
my $errcode = ${@$result[0]}{errorcode};
|
||||
if ( $errcode == 0) {
|
||||
$msginfo{$port} = "successful";
|
||||
} else {
|
||||
my $node = ${@$result[0]}{node};
|
||||
$msginfo{$port} = @{${@{${@$node[0]}{data}}[0]}{contents}}[0];
|
||||
}
|
||||
} else {
|
||||
$msginfo{$port} = "failed with unknown reason";
|
||||
}
|
||||
} else {
|
||||
$msginfo{$port} = "successful";
|
||||
}
|
||||
}
|
||||
if ($port) {
|
||||
if ($port eq $portneedreset[0] ) {
|
||||
$port = $portneedreset[1];
|
||||
} else {
|
||||
$port = $portneedreset[0];
|
||||
}
|
||||
} else {
|
||||
$port = $portneedreset[0];
|
||||
}
|
||||
xCAT::MsgUtils->verbose_message( $req, "begin to reset for port $port......................................");
|
||||
my $ip = ${$iphashref->{$port}}{sip};
|
||||
my $rc = system("ping -q -n -c 1 -w 1 $ip > /dev/null");
|
||||
unless ($rc == 0) { #should be unless!!!!!!!!!!!!!
|
||||
$ip = ${$iphashref->{$port}}{tip};
|
||||
$handled{network} = $ip.",".${$rspdevref->{$ip}}{args};
|
||||
my @cmds = ("network=$ip,${$rspdevref->{$ip}}{args}");
|
||||
my %request = (
|
||||
ppcretry => 1,
|
||||
verbose => 0,
|
||||
ppcmaxp => 64,
|
||||
ppctimeout => 0,
|
||||
fsptimeout => 0,
|
||||
ppcretry => 3,
|
||||
maxssh => 8,
|
||||
arg => \@cmds,
|
||||
method => \%handled,
|
||||
command => 'rspconfig',
|
||||
hwtype => ${$rspdevref->{$ip}}{type},
|
||||
);
|
||||
xCAT::MsgUtils->verbose_message( $req, "Begin to do reset for $port, nic is $ip");
|
||||
my $result = xCAT::PPCfsp::handler($ip, \%request, \@exp);
|
||||
if ($result) {
|
||||
my $errcode = ${@$result[0]}{errorcode};
|
||||
if ( $errcode == 0) {
|
||||
$msginfo{$port} = "successful";
|
||||
} else {
|
||||
my $node = ${@$result[0]}{node};
|
||||
$msginfo{$port} = @{${@{${@$node[0]}{data}}[0]}{contents}}[0];
|
||||
}
|
||||
} else {
|
||||
$msginfo{$port} = "failed with unknown reason";
|
||||
}
|
||||
} else {
|
||||
xCAT::PPCfsp::disconnect( \@exp );
|
||||
$msginfo{$port} = "successful";
|
||||
}
|
||||
return \%msginfo;
|
||||
}
|
||||
|
||||
#############################################
|
||||
# Get rsp devices and their logon info
|
||||
#############################################
|
||||
sub get_rsp_dev
|
||||
{
|
||||
my $request = shift;
|
||||
my $targets = shift;
|
||||
|
||||
my $mm = $targets->{'mm'} ? $targets->{'mm'} : {};
|
||||
my $hmc = $targets->{'hmc'} ? $targets->{'hmc'}: {};
|
||||
my $fsp = $targets->{'fsp'} ? $targets->{'fsp'}: {};
|
||||
my $bpa = $targets->{'bpa'} ? $targets->{'bpa'}: {};
|
||||
|
||||
if (%$mm)
|
||||
{
|
||||
my $bladeuser = 'USERID';
|
||||
my $bladepass = 'PASSW0RD';
|
||||
#if ( $verbose ) {
|
||||
# trace( $request, "telneting to management-modules....." );
|
||||
#}
|
||||
#############################################
|
||||
# Check passwd table for userid/password
|
||||
#############################################
|
||||
my $passtab = xCAT::Table->new('passwd');
|
||||
if ( $passtab ) {
|
||||
#my ($ent) = $passtab->getAttribs({key=>'blade'},'username','password');
|
||||
my $ent = $passtab->getNodeAttribs('blade', ['username','password']);
|
||||
if ( defined( $ent )) {
|
||||
$bladeuser = $ent->{username};
|
||||
$bladepass = $ent->{password};
|
||||
}
|
||||
}
|
||||
#############################################
|
||||
# Get userid/password
|
||||
#############################################
|
||||
my $mpatab = xCAT::Table->new('mpa');
|
||||
for my $nd ( keys %$mm ) {
|
||||
my $user = $bladeuser;
|
||||
my $pass = $bladepass;
|
||||
|
||||
if ( defined( $mpatab )) {
|
||||
#my ($ent) = $mpatab->getAttribs({mpa=>$_},'username','password');
|
||||
my $ent = $mpatab->getNodeAttribs($nd, ['username','password']);
|
||||
if ( defined( $ent->{password} )) { $pass = $ent->{password}; }
|
||||
if ( defined( $ent->{username} )) { $user = $ent->{username}; }
|
||||
}
|
||||
$mm->{$nd}->{username} = $user;
|
||||
$mm->{$nd}->{password} = $pass;
|
||||
}
|
||||
}
|
||||
if (%$hmc )
|
||||
{
|
||||
#############################################
|
||||
# Get HMC userid/password
|
||||
#############################################
|
||||
foreach ( keys %$hmc ) {
|
||||
( $hmc->{$_}->{username}, $hmc->{$_}->{password}) = xCAT::PPCdb::credentials( $hmc->{$_}->{name}, lc($hmc->{$_}->{'type'}), "hscroot" );
|
||||
xCAT::MsgUtils->verbose_message( $request, "user/passwd for $_ is $hmc->{$_}->{username} $hmc->{$_}->{password}");
|
||||
}
|
||||
}
|
||||
|
||||
if ( %$fsp)
|
||||
{
|
||||
#############################################
|
||||
# Get FSP userid/password
|
||||
#############################################
|
||||
foreach ( keys %$fsp ) {
|
||||
( $fsp->{$_}->{username}, $fsp->{$_}->{password}) = xCAT::PPCdb::credentials( $fsp->{$_}->{name}, lc($fsp->{$_}->{'type'}), "admin");
|
||||
xCAT::MsgUtils->verbose_message( $request, "user/passwd for $_ is $fsp->{$_}->{username} $fsp->{$_}->{password}");
|
||||
}
|
||||
}
|
||||
|
||||
if ( %$bpa)
|
||||
{
|
||||
#############################################
|
||||
# Get BPA userid/password
|
||||
#############################################
|
||||
foreach ( keys %$bpa ) {
|
||||
( $bpa->{$_}->{username}, $bpa->{$_}->{password}) = xCAT::PPCdb::credentials( $bpa->{$_}->{name}, lc($bpa->{$_}->{'type'}), "admin");
|
||||
xCAT::MsgUtils->verbose_message( $request, "user/passwd for $_ is $bpa->{$_}->{username} $bpa->{$_}->{password}");
|
||||
}
|
||||
}
|
||||
|
||||
return (%$mm,%$hmc,%$fsp,%$bpa);
|
||||
}
|
||||
##########################################################################
|
||||
# Invokes the callback with the specified message
|
||||
##########################################################################
|
||||
sub send_msg {
|
||||
|
||||
my $request = shift;
|
||||
my $ecode = shift;
|
||||
my %output;
|
||||
|
||||
#################################################
|
||||
# Called from child process - send to parent
|
||||
#################################################
|
||||
if ( exists( $request->{pipe} )) {
|
||||
my $out = $request->{pipe};
|
||||
|
||||
$output{errorcode} = $ecode;
|
||||
$output{data} = \@_;
|
||||
print $out freeze( [\%output] );
|
||||
print $out "\nENDOFFREEZE6sK4ci\n";
|
||||
}
|
||||
#################################################
|
||||
# Called from parent - invoke callback directly
|
||||
#################################################
|
||||
elsif ( exists( $request->{callback} )) {
|
||||
my $callback = $request->{callback};
|
||||
$output{errorcode} = $ecode;
|
||||
$output{data} = \@_;
|
||||
$callback->( \%output );
|
||||
}
|
||||
}
|
||||
##########################################################################
|
||||
# Collect output from the child processes
|
||||
##########################################################################
|
||||
sub child_response {
|
||||
|
||||
my $callback = shift;
|
||||
my $fds = shift;
|
||||
my @ready_fds = $fds->can_read(1);
|
||||
|
||||
foreach my $rfh (@ready_fds) {
|
||||
my $data = <$rfh>;
|
||||
|
||||
#################################
|
||||
# Read from child process
|
||||
#################################
|
||||
if ( defined( $data )) {
|
||||
while ($data !~ /ENDOFFREEZE6sK4ci/) {
|
||||
$data .= <$rfh>;
|
||||
}
|
||||
my $responses = thaw($data);
|
||||
|
||||
#############################
|
||||
# rspconfig results
|
||||
#############################
|
||||
if ( @$responses[0] =~ /^RSPCONFIG6sK4ci$/ ) {
|
||||
#shift @$responses;
|
||||
#my $ip = @$responses[0];
|
||||
#my @rsp1 = (@$responses[1]);
|
||||
#$rsp_result{$ip} = \@rsp1;
|
||||
#$ip = @$responses[2];
|
||||
#if ($ip) {
|
||||
# my @rsp2 = (@$responses[3]);
|
||||
# $rsp_result{$ip} = \@rsp2;
|
||||
#}
|
||||
next;
|
||||
}
|
||||
#############################
|
||||
# Message or verbose trace
|
||||
#############################
|
||||
foreach ( @$responses ) {
|
||||
$callback->( $_ );
|
||||
}
|
||||
next;
|
||||
}
|
||||
#################################
|
||||
# Done - close handle
|
||||
#################################
|
||||
$fds->remove($rfh);
|
||||
close($rfh);
|
||||
}
|
||||
}
|
||||
##########################################################################
|
||||
# Logon through remote FSP HTTP-interface
|
||||
##########################################################################
|
||||
sub connect {
|
||||
|
||||
my $username = shift;
|
||||
my $passwd = shift;
|
||||
my $server = shift;
|
||||
my $verbose = shift;
|
||||
my $lwp_log;
|
||||
|
||||
##################################
|
||||
# Use timeout
|
||||
##################################
|
||||
my $timeout = 10;
|
||||
|
||||
##################################
|
||||
# Redirect STDERR to variable
|
||||
##################################
|
||||
if ( $verbose ) {
|
||||
close STDERR;
|
||||
if ( !open( STDERR, '>', \$lwp_log )) {
|
||||
return( "Unable to redirect STDERR: $!" );
|
||||
}
|
||||
}
|
||||
$IO::Socket::SSL::VERSION = undef;
|
||||
eval { require Net::SSL };
|
||||
|
||||
##################################
|
||||
# Turn on tracing
|
||||
##################################
|
||||
if ( $verbose ) {
|
||||
LWP::Debug::level( '+' );
|
||||
}
|
||||
##################################
|
||||
# Create cookie
|
||||
##################################
|
||||
my $cookie = HTTP::Cookies->new();
|
||||
$cookie->set_cookie( 0,'asm_session','0','cgi-bin','','443',0,0,3600,0 );
|
||||
|
||||
##################################
|
||||
# Create UserAgent
|
||||
##################################
|
||||
my $ua = LWP::UserAgent->new();
|
||||
|
||||
##################################
|
||||
# Set options
|
||||
##################################
|
||||
my $url = "https://$server/cgi-bin/cgi?form=2";
|
||||
$ua->cookie_jar( $cookie );
|
||||
$ua->timeout( $timeout );
|
||||
|
||||
##################################
|
||||
# Submit logon
|
||||
##################################
|
||||
my $res = $ua->post( $url,
|
||||
[ user => $username,
|
||||
password => $passwd,
|
||||
lang => "0",
|
||||
submit => "Log in" ]
|
||||
);
|
||||
|
||||
##################################
|
||||
# Logon failed
|
||||
##################################
|
||||
if ( !$res->is_success() ) {
|
||||
return( $lwp_log.$res->status_line );
|
||||
}
|
||||
##################################
|
||||
# To minimize number of GET/POSTs,
|
||||
# if we successfully logon, we should
|
||||
# get back a valid cookie:
|
||||
# Set-Cookie: asm_session=3038839768778613290
|
||||
#
|
||||
##################################
|
||||
if ( $res->as_string =~ /Set-Cookie: asm_session=(\d+)/ ) {
|
||||
##############################
|
||||
# Successful logon....
|
||||
# Return:
|
||||
# UserAgent
|
||||
# Server hostname
|
||||
# UserId
|
||||
# Redirected STDERR/STDOUT
|
||||
##############################
|
||||
return( $ua,
|
||||
$server,
|
||||
$username,
|
||||
\$lwp_log );
|
||||
}
|
||||
##############################
|
||||
# Logon error
|
||||
##############################
|
||||
$res = $ua->get( $url );
|
||||
##############################
|
||||
# Check for specific failures
|
||||
# $res->status_line is like "200 OK"
|
||||
# $res->content is like <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" .....Too many users......</html>
|
||||
# $res->base is like https://41.17.4.2/cgi-bin/cgi?form=2
|
||||
##############################
|
||||
my $err;
|
||||
if ( $res->content =~ /Too many users/i ) {
|
||||
$err = "Too many users";
|
||||
}elsif ( $res->content =~ /Invalid user ID or password/i ) {
|
||||
$err = "Invalid user ID or password";
|
||||
}else{
|
||||
$err = "Logon failure with unknown reason";
|
||||
}
|
||||
|
||||
return ($lwp_log.$err);
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+57
-17
@@ -6,6 +6,7 @@ use Getopt::Long;
|
||||
use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR);
|
||||
use xCAT::Usage;
|
||||
use xCAT::DBobjUtils;
|
||||
use xCAT::FSPUtils;
|
||||
|
||||
##############################################
|
||||
# Globals
|
||||
@@ -90,13 +91,14 @@ sub mkhwconn_parse_args
|
||||
my @frame_members = ();
|
||||
if ( $ppctab)
|
||||
{
|
||||
my $typehash = xCAT::DBobjUtils->getnodetype($nodes, "ppc");
|
||||
for my $node ( @$nodes)
|
||||
{
|
||||
my $node_parent = undef;
|
||||
my $nodetype = undef;
|
||||
#my $nodetype_hash = $nodetypetab->getNodeAttribs( $node,[qw(nodetype)]);
|
||||
my $node_parent_hash = $ppctab->getNodeAttribs( $node,[qw(parent)]);
|
||||
$nodetype = $$typehash{$node};
|
||||
#$nodetype = $nodetype_hash->{nodetype};
|
||||
$nodetype = xCAT::DBobjUtils->getnodetype($node,"ppc");
|
||||
$node_parent = $node_parent_hash->{parent};
|
||||
if ( !$nodetype )
|
||||
{
|
||||
@@ -104,7 +106,7 @@ sub mkhwconn_parse_args
|
||||
next;
|
||||
} else
|
||||
{
|
||||
unless ( $nodetype =~ /^(fsp|bpa|frame|cec|hmc)$/)
|
||||
unless ( $nodetype =~ /^(blade|fsp|bpa|frame|cec|hmc)$/)
|
||||
{
|
||||
return ( usage("Node type is incorrect. \n"));
|
||||
}
|
||||
@@ -159,7 +161,7 @@ sub mkhwconn_parse_args
|
||||
if (scalar(@no_type_nodes))
|
||||
{
|
||||
my $tmp_nodelist = join ',', @no_type_nodes;
|
||||
return ( usage("Attribute nodetype.nodetype cannot be found for node(s) $tmp_nodelist"));
|
||||
return ( usage("Attribute nodetype.nodetype cannot be found for node(s) $tmp_nodelist. Please define first and try again."));
|
||||
}
|
||||
|
||||
if (scalar(@bpa_ctrled_nodes))
|
||||
@@ -285,6 +287,9 @@ sub lshwconn_parse_args
|
||||
}
|
||||
|
||||
my $nodetype;
|
||||
my @no_type_nodes = ();
|
||||
my @no_mgt_nodes = ();
|
||||
my @error_type_nodes = ();
|
||||
for my $node ( @{$request->{node}})
|
||||
{
|
||||
#my $ent = $nodetypetab->getNodeAttribs( $node, [qw(nodetype)]);
|
||||
@@ -292,11 +297,13 @@ sub lshwconn_parse_args
|
||||
my $nodehm = $nodehmtab->getNodeAttribs( $node, [qw(mgt)]);
|
||||
if ( ! $ttype)
|
||||
{
|
||||
return( ["Failed to get node type for node $node.\n"]);
|
||||
push @no_type_nodes, $node;
|
||||
next;
|
||||
}
|
||||
if ( ! $nodehm)
|
||||
{
|
||||
return( ["Failed to get nodehm.mgt value for node $node.\n"]);
|
||||
push @no_mgt_nodes, $node;
|
||||
next;
|
||||
}
|
||||
elsif ( $nodehm->{mgt} ne 'hmc')
|
||||
{
|
||||
@@ -306,7 +313,8 @@ sub lshwconn_parse_args
|
||||
and $ttype ne 'fsp' and $ttype ne 'cec'
|
||||
and $ttype ne 'bpa' and $ttype ne 'frame')
|
||||
{
|
||||
return( ["Node type $ttype is not supported for this command.\n"]);
|
||||
push @error_type_nodes, $node;
|
||||
next;
|
||||
}
|
||||
if ( ! $nodetype)
|
||||
{
|
||||
@@ -320,7 +328,19 @@ sub lshwconn_parse_args
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (scalar(@no_type_nodes)) {
|
||||
my $tmp_nodelist = join ',', @no_type_nodes;
|
||||
return( ["Failed to get node type for node(s) $tmp_nodelist. Please define first and try again\n"]);
|
||||
}
|
||||
if (scalar(@no_mgt_nodes)) {
|
||||
my $tmp_nodelist = join ',', @no_mgt_nodes;
|
||||
return( ["Failed to get nodehm.mgt value for node(s) $tmp_nodelist. Please define first and try again.\n"]);
|
||||
}
|
||||
if (scalar(@error_type_nodes)) {
|
||||
my $tmp_nodelist = join ',', @error_type_nodes;
|
||||
my $link = (scalar(@error_type_nodes) == '1')? 'is':'are';
|
||||
return( ["Node type of node(s) $tmp_nodelist $link not supported for this command.\n"]);
|
||||
}
|
||||
$request->{nodetype} = $nodetype;
|
||||
|
||||
$request->{method} = 'lshwconn';
|
||||
@@ -379,6 +399,7 @@ sub rmhwconn_parse_args
|
||||
my $newtype = xCAT::DBobjUtils::getnodetype($node);
|
||||
unless ($newtype) {
|
||||
push @no_type_nodes, $node;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($newtype =~ /^(fsp|bpa)$/ )
|
||||
@@ -422,7 +443,7 @@ sub rmhwconn_parse_args
|
||||
if (scalar(@no_type_nodes))
|
||||
{
|
||||
my $tmp_nodelist = join ',', @no_type_nodes;
|
||||
return ( usage("Attribute nodetype.nodetype cannot be found for node(s) $tmp_nodelist"));
|
||||
return ( usage("Attribute nodetype.nodetype cannot be found for node(s) $tmp_nodelist. Please define first and try again.\n"));
|
||||
}
|
||||
|
||||
if (scalar(@bpa_ctrled_nodes))
|
||||
@@ -463,9 +484,13 @@ sub mkhwconn
|
||||
# Get IP address
|
||||
############################
|
||||
my $cnode;
|
||||
my $ntype = xCAT::DBobjUtils::getnodetype($node_name);
|
||||
if ($ntype =~ /^(cec|frame)$/)
|
||||
#my $ntype = xCAT::DBobjUtils::getnodetype($node_name);
|
||||
my $ntype = $$d[4];
|
||||
if ($ntype =~ /^(cec|frame|blade)$/)
|
||||
{
|
||||
if ($ntype eq "blade") {
|
||||
delete $opt->{port};
|
||||
}
|
||||
$cnode = xCAT::DBobjUtils::getchildren($node_name, $opt->{port});
|
||||
} else {
|
||||
$cnode = $node_name;
|
||||
@@ -494,12 +519,17 @@ sub mkhwconn
|
||||
next;
|
||||
}
|
||||
|
||||
my ( undef,undef,$mtms,undef,$type) = @$d;
|
||||
my ( undef,undef,$mtms,undef,$type,$bpa) = @$d;
|
||||
my ($user, $passwd);
|
||||
if ( exists $opt->{P})
|
||||
{
|
||||
($user, $passwd) = ('HMC', $opt->{P});
|
||||
}
|
||||
elsif ($type eq "blade") {
|
||||
$user = "USERID";
|
||||
($user, $passwd) = xCAT::PPCdb::credentials($bpa, $type, $user);
|
||||
$type = "cec";
|
||||
}
|
||||
else
|
||||
{
|
||||
($user, $passwd) = xCAT::PPCdb::credentials( $node_name, $type,'HMC');
|
||||
@@ -619,7 +649,8 @@ sub lshwconn
|
||||
#my $node_ip_hash = $hosttab->getNodeAttribs( $node_name,[qw(ip)]);
|
||||
#$node_ip = $node_ip_hash->{ip};
|
||||
#$node_ip = xCAT::Utils::getNodeIPaddress( $node_name );
|
||||
$node_ip = xCAT::Utils::getIPaddress( $node_name );
|
||||
my $d = $node_hash->{$node_name};
|
||||
$node_ip = xCAT::FSPUtils::getIPaddress($request, $$d[4], $node_name );
|
||||
}
|
||||
if (!$node_ip || ($node_ip == -3))
|
||||
{
|
||||
@@ -681,7 +712,7 @@ sub rmhwconn
|
||||
my $d = $node_hash->{$node_name};
|
||||
|
||||
my ( undef,undef,undef,undef,$type) = @$d;
|
||||
|
||||
if ($type eq "blade") {$type = "cec";}
|
||||
############################
|
||||
# Get IP address
|
||||
############################
|
||||
@@ -698,10 +729,19 @@ sub rmhwconn
|
||||
|
||||
my @ips;
|
||||
foreach my $entry ( @$nodes_found ) {
|
||||
if ( $entry =~ /$mtm\*$serial/) {
|
||||
$entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
push @ips, $1;
|
||||
if ($entry =~ /type_model_serial_num=([^,]*),/) {
|
||||
my $match_mtm1 = $1;
|
||||
my $match_mtm2 = $match_mtm1;
|
||||
$match_mtm2 =~ s/\-//;
|
||||
if ($match_mtm1 =~ /$mtm\*$serial/ || $match_mtm2 =~ /$mtm\*$serial/) {
|
||||
$entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
push @ips, $1;
|
||||
}
|
||||
}
|
||||
#if ( $entry =~ /$mtm\*$serial/) {
|
||||
# $entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
# push @ips, $1;
|
||||
#}
|
||||
}
|
||||
if (!@ips)
|
||||
{
|
||||
|
||||
+378
-5
@@ -4,7 +4,7 @@ package xCAT::PPCdb;
|
||||
use strict;
|
||||
use xCAT::Table;
|
||||
use xCAT::GlobalDef;
|
||||
use xCAT_plugin::lsslp;
|
||||
|
||||
|
||||
###########################################
|
||||
# Factory defaults
|
||||
@@ -279,7 +279,7 @@ sub update_ppc {
|
||||
|
||||
if ( $ttype eq 'cec' )
|
||||
{
|
||||
my $hostname = xCAT_plugin::lsslp::gethost_from_url_or_old($tname, "FSP", $tmtm, $tsn, "", "", $tid, "","");
|
||||
my $hostname = get_host($tname, "FSP", $tmtm, $tsn, "", "", $tid, "","");
|
||||
if ($hostname ne $tname)
|
||||
{
|
||||
$hostname =~ /\-(\w)$/;
|
||||
@@ -295,7 +295,7 @@ sub update_ppc {
|
||||
}
|
||||
} elsif ( $ttype eq 'frame' )
|
||||
{
|
||||
my $hostname = xCAT_plugin::lsslp::gethost_from_url_or_old($tname, "BPA", $tmtm, $tsn, "", "", $tid, "","");
|
||||
my $hostname = get_host($tname, "BPA", $tmtm, $tsn, "", "", $tid, "","");
|
||||
if ($hostname ne $tname)
|
||||
{
|
||||
$hostname =~ /\-(\w)$/;
|
||||
@@ -799,7 +799,14 @@ sub credentials {
|
||||
if ( $user_specified)
|
||||
{ # need regx
|
||||
#($ent) = $tab->getAttribs( {hcp=>$server,username=>$user},qw(password));
|
||||
($ent) = $tab->getNodeSpecAttribs( $server, {username=>$user},qw(password));
|
||||
#($ent) = $tab->getNodeSpecAttribs( $server, {username=>$user},qw(password));
|
||||
my @output = $tab->getNodeAttribs($server, qw(username password));
|
||||
foreach my $tmp_entry (@output) {
|
||||
if ($tmp_entry->{username} =~ /^$user$/) {
|
||||
$ent = $tmp_entry;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -817,7 +824,14 @@ sub credentials {
|
||||
if ( $user_specified)
|
||||
{ # need regx
|
||||
#($ent) = $tab->getAllAttribs( {hcp=>$defaultgrp{$hwtype},username=>$user},qw(password));
|
||||
($ent) = $tab->getNodeSpecAttribs( $defaultgrp{$hwtype}, {username=>$user},qw(password));
|
||||
#($ent) = $tab->getNodeSpecAttribs( $defaultgrp{$hwtype}, {username=>$user},qw(password));
|
||||
my @output = $tab->getNodeAttribs( $defaultgrp{$hwtype}, qw(username password));
|
||||
foreach my $tmp_entry (@output) {
|
||||
if ($tmp_entry->{username} =~ /^$user$/) {
|
||||
$ent = $tmp_entry;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -909,7 +923,366 @@ sub update_credentials
|
||||
|
||||
return undef;
|
||||
}
|
||||
#############################################################################
|
||||
# used for FSP/BPA redundancy database migration
|
||||
# if return something, it means it will use the old data name
|
||||
# or new data name
|
||||
# if return undef, it means the ip is not invalid and won't make any definition
|
||||
#############################################################################
|
||||
sub get_host {
|
||||
my $nodename = shift;
|
||||
my $type = shift;
|
||||
my $mtm = shift;
|
||||
my $sn = shift;
|
||||
my $side = shift;
|
||||
my $ip = shift;
|
||||
my $cage_number = shift;
|
||||
my $parmtm = shift;
|
||||
my $parsn = shift;
|
||||
my $pname = shift;
|
||||
my $flagref = shift;
|
||||
|
||||
#######################################
|
||||
# Extract IP from URL
|
||||
#######################################
|
||||
if ($ip)
|
||||
{
|
||||
my $nets = xCAT::Utils::my_nets();
|
||||
my $avip = getip_from_iplist( $ip, $nets);
|
||||
#if ( !defined( $ip )) {
|
||||
# return undef;
|
||||
#}
|
||||
}
|
||||
# get the information of existed nodes to do the migration
|
||||
|
||||
read_from_table() unless (%::OLD_DATA_CACHE);
|
||||
|
||||
foreach my $oldnode ( keys %::OLD_DATA_CACHE )
|
||||
{
|
||||
my $tmpmtm = @{$::OLD_DATA_CACHE{$oldnode}}[0];
|
||||
my $tmpsn = @{$::OLD_DATA_CACHE{$oldnode}}[1];
|
||||
my $tmpside = @{$::OLD_DATA_CACHE{$oldnode}}[2];
|
||||
my $tmpip = @{$::OLD_DATA_CACHE{$oldnode}}[3];
|
||||
my $tmpid = @{$::OLD_DATA_CACHE{$oldnode}}[4];
|
||||
my $tmpparent = @{$::OLD_DATA_CACHE{$oldnode}}[5];
|
||||
my $tmptype = uc(@{$::OLD_DATA_CACHE{$oldnode}}[6]);
|
||||
my $unmatched = @{$::OLD_DATA_CACHE{$oldnode}}[7];
|
||||
|
||||
# used to match fsp defined by xcatsetup
|
||||
# should return fast to save time
|
||||
if (($type eq "BPA" or $type eq "FSP") and ($tmptype eq $type) and $pname and $side) {
|
||||
if ($pname eq $tmpparent and $side eq $tmpside) {
|
||||
$$flagref = 1;
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
|
||||
# match the existed nodes including old data and user defined data
|
||||
if (($type eq "BPA" or $type eq "FSP") and ($tmptype eq $type)) {
|
||||
unless ($tmpmtm) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ( $tmpmtm eq $mtm and $tmpsn eq $sn) {
|
||||
my $ifip = xCAT::Utils->isIpaddr($oldnode);
|
||||
if ( $ifip ) {# which means that the node is defined by the new lsslp
|
||||
if ( $tmpside eq $side ) {# match! which means that node is the same as the new one
|
||||
if ( $ip eq $tmpip ) { #which means that the ip is not changed
|
||||
# maybe we should check if the ip is invalid and send a warning
|
||||
$$flagref = 1;
|
||||
return $ip;
|
||||
} else { #which means that the ip is changed
|
||||
my $vip = check_ip($ip);
|
||||
if ( !$vip ) { #which means the ip is changed and valid
|
||||
# maybe we should check if the old ip is invalid and send a warning
|
||||
# even so we should keep the definition as before
|
||||
# because this case, we can't put check_ip in the end
|
||||
$$flagref = 1;
|
||||
return $oldnode;
|
||||
} else {
|
||||
return $ip;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else { # name is not a ip
|
||||
$side =~ /(\w)\-(\w)/;
|
||||
my $slot = $1;
|
||||
if ( $tmpside and $tmpside !~ /\-/ ) {# side is like A or B
|
||||
if ( $slot eq $tmpside ) {
|
||||
if ( $oldnode =~ /^Server\-/) {#judge if need to change node's name
|
||||
if ( $ip eq $tmpip ) {
|
||||
if ( $oldnode =~ /\-(A|B)$/) {
|
||||
@{$::OLD_DATA_CACHE{$oldnode}}[7] = 0;
|
||||
$$flagref = 1;
|
||||
return $oldnode;
|
||||
} else {
|
||||
@{$::OLD_DATA_CACHE{$oldnode}}[7] = 0;
|
||||
#change node name, need to record the node here
|
||||
$::UPDATE_CACHE{$mtm.'-'.$sn} = $oldnode;
|
||||
$$flagref = 1;
|
||||
return $oldnode.'-'.$slot;
|
||||
}
|
||||
} else {# not find a matched definition, but need to use the old node name
|
||||
if ($unmatched){
|
||||
$$flagref = 1;
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
} elsif ( $tmpside =~ /\-/ ) {# end of if ( $oldnode =~ /^Server\-/)
|
||||
if ( $ip eq $tmpip ) {
|
||||
@{$::OLD_DATA_CACHE{$oldnode}}[7] = 0;
|
||||
$$flagref = 1;
|
||||
return $oldnode;
|
||||
} else{
|
||||
if ($unmatched){
|
||||
$$flagref = 1;
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} elsif ( $tmpside =~ /\-/ ){
|
||||
if ( $side eq $tmpside ) {
|
||||
$$flagref = 1;
|
||||
return $oldnode;
|
||||
}
|
||||
} elsif ( !$tmpside ) {
|
||||
if ( $oldnode =~ /^Server\-/) {#judge if need to change node's name
|
||||
if ( $oldnode !~ /\-(A|B)$/ ) {
|
||||
delete $::OLD_DATA_CACHE{$oldnode};
|
||||
$$flagref = 1;
|
||||
return $oldnode."-".$slot;
|
||||
}
|
||||
}
|
||||
# if mtms could match but side not defined, we will trate
|
||||
# it as the result by rscan. And alway use its name.
|
||||
delete $::OLD_DATA_CACHE{$oldnode};
|
||||
$$flagref = 1;
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
}# end of if ($tmpmtm eq $mtm and $tmpsn eq $sn)
|
||||
|
||||
|
||||
}
|
||||
if ( ($type eq "FRAME" or $type eq "CEC") and ($type eq $tmptype)){
|
||||
if ( !$tmpmtm and !$tmpid) {
|
||||
next;
|
||||
}
|
||||
# user may define cec only with parent /id /type
|
||||
# we should match this situation
|
||||
if ( ($type eq "CEC") and $parmtm and $parsn and $cage_number ) {
|
||||
my $tpparmtm = @{$::OLD_DATA_CACHE{$tmpparent}}[0];
|
||||
my $tpparsn = @{$::OLD_DATA_CACHE{$tmpparent}}[1];
|
||||
if ( ($tpparmtm eq $parmtm) and ($tpparsn eq $parsn) and ($cage_number eq $tmpid) and ($type eq $tmptype) ) {
|
||||
$$flagref = 1;
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
|
||||
# user may define cec/frame only with mtms
|
||||
# but what we consider here is just the data in xCAT 2.6
|
||||
if ($tmpmtm eq $mtm and $tmpsn eq $sn and $tmptype eq $type) {
|
||||
if ( $oldnode =~ /^Server\-/) {#judge if need to change node's name
|
||||
if ( $oldnode =~ /(\-A)$/) {
|
||||
$nodename = s/(\-A)$//;
|
||||
# should send a warning here
|
||||
$$flagref = 1;
|
||||
return $nodename;
|
||||
}
|
||||
else {
|
||||
$$flagref = 1;
|
||||
return $oldnode;
|
||||
}
|
||||
} else {
|
||||
$$flagref = 1;
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
} # end of foreach my $oldnode ( keys %::OLD_DATA_CACHE ), not match
|
||||
}
|
||||
|
||||
# not matched, use the new name
|
||||
my $ifip = xCAT::Utils->isIpaddr($nodename);
|
||||
unless ($ifip) {
|
||||
return $nodename;
|
||||
}else {
|
||||
my $vip = check_ip($nodename);
|
||||
if ( $vip ) {#which means the ip is a valid one
|
||||
return $nodename;
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
# Get correct IP from ip list in SLP Attr
|
||||
##########################################################################
|
||||
sub getip_from_iplist
|
||||
{
|
||||
my $iplist = shift;
|
||||
my $nets = shift;
|
||||
my $inc = shift;
|
||||
|
||||
my @ips = split /,/, $iplist;
|
||||
my @ips2 = split /,/, $inc;
|
||||
if ( $inc)
|
||||
{
|
||||
for my $net (keys %$nets)
|
||||
{
|
||||
my $flag = 1;
|
||||
for my $einc (@ips2) {
|
||||
if ( $nets->{$net} eq $einc) {
|
||||
$flag = 0;
|
||||
}
|
||||
}
|
||||
delete $nets->{$net} if ($flag) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for my $ip (@ips)
|
||||
{
|
||||
next if ( $ip =~ /:/); #skip IPV6 addresses
|
||||
for my $net ( keys %$nets)
|
||||
{
|
||||
my ($n,$m) = split /\//,$net;
|
||||
if ( xCAT::Utils::isInSameSubnet( $n, $ip, $m, 1) and
|
||||
xCAT::Utils::isPingable( $ip))
|
||||
{
|
||||
return $ip;
|
||||
}
|
||||
}
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub read_from_table {
|
||||
my %idhash;
|
||||
my %typehash;
|
||||
my %iphash;
|
||||
my %vpdhash;
|
||||
if ( !defined(%::OLD_DATA_CACHE))
|
||||
{
|
||||
# find out all the existed nodes' ipaddresses
|
||||
my $hoststab = xCAT::Table->new('hosts');
|
||||
if ( $hoststab ) {
|
||||
my @ipentries = $hoststab->getAllNodeAttribs( ['node','ip'] );
|
||||
for my $ipentry ( @ipentries ) {
|
||||
$iphash{$ipentry->{node}} = $ipentry->{ip};
|
||||
}
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#find out all the existed nodes' type
|
||||
my $nodetypetab = xCAT::Table->new('nodetype');
|
||||
if ( $nodetypetab ) {
|
||||
my @typeentries = $nodetypetab->getAllNodeAttribs( ['node','nodetype'] );
|
||||
for my $typeentry ( @typeentries) {
|
||||
$typehash{$typeentry->{node}} = $typeentry->{nodetype};
|
||||
}
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
|
||||
# find out all the existed nodes' mtms and side
|
||||
my $vpdtab = xCAT::Table->new( 'vpd' );
|
||||
if ( $vpdtab ) {
|
||||
my @vpdentries = $vpdtab->getAllNodeAttribs(['node','mtm','serial','side']);
|
||||
for my $entry ( @vpdentries ) {
|
||||
@{$vpdhash{$entry->{node}}}[0] = $entry->{mtm};
|
||||
@{$vpdhash{$entry->{node}}}[1] = $entry->{serial};
|
||||
@{$vpdhash{$entry->{node}}}[2] = $entry->{side};
|
||||
}
|
||||
} else {
|
||||
return 3;
|
||||
}
|
||||
# find out all the existed nodes' attributes
|
||||
my $ppctab = xCAT::Table->new('ppc');
|
||||
if ( $ppctab ) {
|
||||
my @identries = $ppctab->getAllNodeAttribs( ['node','id','parent','nodetype'] );
|
||||
for my $entry ( @identries ) {
|
||||
next if ($entry->{nodetype} =~ /lpar/);
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[0] = @{$vpdhash{$entry->{node}}}[0];#mtm
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[1] = @{$vpdhash{$entry->{node}}}[1];#sn
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[2] = @{$vpdhash{$entry->{node}}}[2];#side
|
||||
# find node ip address, check node name first, then check hosts table
|
||||
my $ifip = xCAT::Utils->isIpaddr($entry->{node});
|
||||
if ( $ifip )
|
||||
{
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[3] = $entry->{node};#ip
|
||||
} else
|
||||
{
|
||||
if ( exists ($iphash{$entry->{node}}) ) {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[3] = $iphash{$entry->{node}};#ip
|
||||
}
|
||||
else {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[3] = "";#ip
|
||||
}
|
||||
}
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[4] = $entry->{id};#id
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[5] = $entry->{parent};#parent
|
||||
if ( exists $entry->{nodetype}) {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[6] = $entry->{nodetype};#nodetype
|
||||
} else {
|
||||
if ( exists ($typehash{$entry->{node}}) ) {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[6] = $typehash{$entry->{node}};
|
||||
} else {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[6] = "";
|
||||
}
|
||||
}
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[7] = 1;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
##########################################################################
|
||||
# Makesure the ip in SLP URL is valid
|
||||
# return 1 if valid, 0 if invalid
|
||||
##########################################################################
|
||||
sub check_ip {
|
||||
my $myip = shift;
|
||||
my $firstoctet = $myip;
|
||||
my @invalidiplist = (
|
||||
"192.168.2.144",
|
||||
"192.168.2.145",
|
||||
"192.168.2.146",
|
||||
"192.168.2.147",
|
||||
"192.168.2.148",
|
||||
"192.168.2.149",
|
||||
"192.168.3.144",
|
||||
"192.168.3.145",
|
||||
"192.168.3.146",
|
||||
"192.168.3.147",
|
||||
"192.168.3.148",
|
||||
"192.168.3.149",
|
||||
"169.254.",
|
||||
"127.0.0.0",
|
||||
"127",
|
||||
0,
|
||||
);
|
||||
$firstoctet =~ s/^(\d+)\..*/$1/;
|
||||
if ($firstoctet >= 224 and $firstoctet <= 239)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
foreach (@invalidiplist)
|
||||
{
|
||||
if ( $myip =~ /^($_)/ )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
1;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ use Getopt::Long;
|
||||
use xCAT::Usage;
|
||||
use xCAT::NodeRange;
|
||||
use xCAT::DBobjUtils;
|
||||
use xCAT::FSPUtils;
|
||||
|
||||
%::QUERY_ATTRS = (
|
||||
'savingstatus' => 1,
|
||||
@@ -179,8 +180,8 @@ sub parse_args {
|
||||
my $nodetyperef = xCAT::DBobjUtils->getnodetype($nodes, "ppc");
|
||||
my $i = 0;
|
||||
foreach my $node (@{$nodes}) {
|
||||
if (@$nodetyperef[$i] ne 'fsp' &&
|
||||
@$nodetyperef[$i] ne 'cec') {
|
||||
if ($$nodetyperef{$node} ne 'fsp' &&
|
||||
$$nodetyperef{$node} ne 'cec') {
|
||||
push @notfspnodes, $node;
|
||||
}
|
||||
$i++;
|
||||
@@ -251,7 +252,7 @@ sub renergy {
|
||||
return ([[$node, "Failed to get the FSPs for the cec $hcphost.", -1]]);
|
||||
}
|
||||
#my $hcp_ip = xCAT::Utils::getNodeIPaddress($hcphost);
|
||||
my $hcp_ip = xCAT::Utils::getIPaddress($hcphost);
|
||||
my $hcp_ip = xCAT::FSPUtils::getIPaddress($request, $hw_type, $hcphost);
|
||||
if (!defined($hcp_ip) or ($hcp_ip == -3)) {
|
||||
return ([[$node, "Failed to get IP address for $hcphost.", -1]]);
|
||||
}
|
||||
@@ -270,9 +271,13 @@ sub renergy {
|
||||
return ([[$node, "Cannot get user:password for the node. Please check table 'ppchcp' or 'ppcdirect'.", -1]]);
|
||||
}
|
||||
|
||||
# secure passwd in verbose mode
|
||||
my $tmpv = $verbose;
|
||||
$verbose = 0;
|
||||
if ($verbose) {
|
||||
push @return_msg, [$node, "Attributes of $node:\n User=$user\n Password=$password\n CEC=$cec_name\n nodetype=$hw_type\n inithcp=$hcphost\n hcps=@hcps_ip\n hcptype=$hcp_type", 0];
|
||||
}
|
||||
$verbose = $tmpv;
|
||||
|
||||
my $master = xCAT::Utils->get_site_Master();
|
||||
my $masterip = xCAT::NetworkUtils->getipaddr($master);
|
||||
@@ -333,7 +338,12 @@ sub renergy {
|
||||
|
||||
# Call the xCAT_cim_client to query or set the energy capabilities
|
||||
$cmd .= " 2>&1";
|
||||
|
||||
# secure passwd in verbose mode
|
||||
my $tmpv = $::VERBOSE;
|
||||
$::VERBOSE = 0;
|
||||
my @result = xCAT::Utils->runcmd("$cmd", -1);
|
||||
$::VERBOSE = $tmpv;
|
||||
|
||||
foreach my $line (@result) {
|
||||
chomp($line);
|
||||
|
||||
@@ -10,8 +10,9 @@ use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR);
|
||||
use xCAT::Usage;
|
||||
use Socket;
|
||||
use xCAT::PPCdb;
|
||||
|
||||
|
||||
use xCAT::MsgUtils qw(verbose_message);
|
||||
use xCAT::Utils;
|
||||
use xCAT::NetworkUtils;
|
||||
##########################################
|
||||
# Globals
|
||||
##########################################
|
||||
@@ -50,6 +51,7 @@ sub handler {
|
||||
my $server = shift;
|
||||
my $request = shift;
|
||||
my $exp = shift;
|
||||
my $flag = shift;
|
||||
|
||||
#####################################
|
||||
# Convert command to correct format
|
||||
@@ -74,7 +76,9 @@ sub handler {
|
||||
#####################################
|
||||
# Disconnect from FSP
|
||||
#####################################
|
||||
xCAT::PPCfsp::disconnect( $exp );
|
||||
unless ($flag) {
|
||||
xCAT::PPCfsp::disconnect( $exp );
|
||||
}
|
||||
return( \@outhash );
|
||||
|
||||
}
|
||||
@@ -368,7 +372,10 @@ sub process_cmd {
|
||||
# Return error
|
||||
##################################
|
||||
if ( !$res->is_success() ) {
|
||||
return( [RC_ERROR,$res->status_line] );
|
||||
my @tmpres = (RC_ERROR, $res->status_line);
|
||||
my @rs;
|
||||
push @rs, \@tmpres;
|
||||
return(\@rs );
|
||||
}
|
||||
##################################
|
||||
# Build hash of expanded menus
|
||||
@@ -384,11 +391,15 @@ sub process_cmd {
|
||||
##############################
|
||||
my $form = $menu{$cmds{$command}{$_}[0]};
|
||||
if ( !defined( $form )) {
|
||||
return( [RC_ERROR,"Cannot find '$cmds{$command}{$_}[0]' menu"] );
|
||||
my @tmpres = (RC_ERROR, "Cannot find '$cmds{$command}{$_}[0]' menu");
|
||||
my @rs;
|
||||
push @rs, \@tmpres;
|
||||
return(\@rs );
|
||||
}
|
||||
##################################
|
||||
# Run command
|
||||
##################################
|
||||
xCAT::MsgUtils->verbose_message($request, "$command :$_ for node:$server.");
|
||||
my $res = $cmds{$command}{$_}[1]($exp, $request, $form, \%menu);
|
||||
push @$res, $_;
|
||||
push @result, $res;
|
||||
@@ -1776,7 +1787,7 @@ sub get_netcfg
|
||||
# Return error
|
||||
##################################
|
||||
if ( !defined( $$form )) {
|
||||
return( [RC_ERROR,"'Network Configuration' form not found"] );
|
||||
return( [RC_ERROR,"'Network Configuration' form not found at parse"] );
|
||||
}
|
||||
|
||||
##################################
|
||||
@@ -1796,14 +1807,15 @@ sub get_netcfg
|
||||
$res = $ua->request( $data);
|
||||
$$form = HTML::Form->parse( $res->content, $res->base );
|
||||
if ( !defined( $$form )) {
|
||||
return( [RC_ERROR,"'Network Configuration' form not found"] );
|
||||
return( [RC_ERROR,"'Network Configuration' form not found at submit"] );
|
||||
}
|
||||
} elsif ( $$form->find_input('submit', 'submit', 1) ) {
|
||||
my $data = $$form->click('submit');
|
||||
sleep 5;
|
||||
$res = $ua->request( $data);
|
||||
$$form = HTML::Form->parse( $res->content, $res->base );
|
||||
if ( !defined( $$form )) {
|
||||
return( [RC_ERROR,"'Network Configuration' form not found' form not found"] );
|
||||
return( [RC_ERROR,"'Network Configuration' form not found at submit2"] );
|
||||
}
|
||||
if ( $$form->find_input('ip', 'radio', 1))
|
||||
{
|
||||
@@ -1819,7 +1831,7 @@ sub get_netcfg
|
||||
$res = $ua->request( $data);
|
||||
$$form = HTML::Form->parse( $res->content, $res->base );
|
||||
if ( !defined( $$form )) {
|
||||
return( [RC_ERROR,"'Network Configuration' form not found"] );
|
||||
return( [RC_ERROR,"'Network Configuration' form not found at submit3"] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1980,6 +1992,7 @@ sub set_netcfg
|
||||
}
|
||||
|
||||
#Click "Continue" button
|
||||
sleep 2;
|
||||
my $data = $form->click('save');
|
||||
my $res = $ua->request( $data);
|
||||
if (!$res->is_success())
|
||||
|
||||
@@ -74,6 +74,15 @@ sub parse_args {
|
||||
return(usage( "Invalid Argument: $ARGV[0]" ));
|
||||
}
|
||||
####################################
|
||||
# Check -o argument
|
||||
####################################
|
||||
if ( exists($opt{o}) ) {
|
||||
unless (exists($opt{D})){
|
||||
return(usage( "The -o flag must be used with -D flag" ));
|
||||
}
|
||||
|
||||
}
|
||||
####################################
|
||||
# Check argument for ping test
|
||||
####################################
|
||||
if ( exists($opt{D}) ) {
|
||||
@@ -560,14 +569,25 @@ sub getmacs {
|
||||
# specified
|
||||
#########################################
|
||||
if ( defined($filter) ) {
|
||||
my $matched = 1;
|
||||
foreach ( keys %$filter ) {
|
||||
if ( $att{$_} ne $filter->{$_} ) {
|
||||
$matched = 0;
|
||||
my $matched = 0;
|
||||
foreach my $key ( keys %$filter ) {
|
||||
if ( $key eq "MAC_Address" ) {
|
||||
my $mac = lc($att{$key});
|
||||
my $filter_mac = lc($filter->{$key});
|
||||
|
||||
$mac =~ s/://g;
|
||||
$filter_mac =~ s/://g;
|
||||
|
||||
if ( grep(/$filter_mac/, $mac) ) {
|
||||
$matched = 1;
|
||||
last;
|
||||
}
|
||||
} elsif ( grep(/$filter->{$key}/, $att{$key}) ) {
|
||||
$matched = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
if ( $matched == 1 ) {
|
||||
if ( $matched ) {
|
||||
push @$value,"$att{'Type'} $att{'Phys_Port_Loc'} $att{'MAC_Address'} $att{'Adapter'} $att{'Port_Group'} $att{'Phys_Port'} $att{'Logical_Port'} $att{'VLan'} $att{'VSwitch'} $att{'Curr_Conn_Speed'}";
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -16,7 +16,7 @@ sub parse_args {
|
||||
my $command = $request->{command};
|
||||
my $args = $request->{arg};
|
||||
my %opt = ();
|
||||
my @rpower = qw(on onstandby off softoff stat state reset boot of sms rackstandby exit_rackstandby lowpower resetsp);
|
||||
my @rpower = qw(on onstandby off softoff stat state reset boot of sms rackstandby exit_rackstandby lowpower resetsp cycle);
|
||||
|
||||
#############################################
|
||||
# Responds with usage statement
|
||||
@@ -40,7 +40,7 @@ sub parse_args {
|
||||
$Getopt::Long::ignorecase = 0;
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
|
||||
if ( !GetOptions( \%opt, qw(V|Verbose m:s@ t=s r=s nodeps) )) {
|
||||
if ( !GetOptions( \%opt, qw(V|Verbose m:s@ t=s T=s r=s nodeps) )) {
|
||||
return( usage() );
|
||||
}
|
||||
####################################
|
||||
@@ -83,6 +83,24 @@ sub parse_args {
|
||||
return(usage());
|
||||
}
|
||||
}
|
||||
|
||||
if( ! exists $opt{T} )
|
||||
{
|
||||
$opt{T} = "lpar"; #defaut value is lpar.
|
||||
}
|
||||
|
||||
if( $opt{T} eq "lpar") {
|
||||
$opt{T} = 0;
|
||||
} elsif($opt{T} eq "fnm") {
|
||||
$opt{T} = 1;
|
||||
if ( $request->{op} !~ /^(onstandby|state|stat)$/) {
|
||||
return(usage("The tooltype fnm only could be used with onstandby/state/stat action."));
|
||||
}
|
||||
} else {
|
||||
return( usage('Wrong value of -T option. The value can be lpar or fnm. The defaut value is lpar.'));
|
||||
}
|
||||
|
||||
|
||||
return( \%opt );
|
||||
}
|
||||
|
||||
|
||||
+35
-15
@@ -94,7 +94,7 @@ sub parse_args {
|
||||
$Getopt::Long::ignorecase = 0;
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
|
||||
if ( !GetOptions( \%opt, qw(h|help v|version V|verbose p=s d=s activate=s commit recover) )) {
|
||||
if ( !GetOptions( \%opt, qw(h|help v|version V|verbose p=s d=s activate=s commit recover bpa_acdl) )) {
|
||||
return( usage() );
|
||||
}
|
||||
|
||||
@@ -102,7 +102,10 @@ sub parse_args {
|
||||
# Option -v for version
|
||||
####################################
|
||||
if ( exists( $opt{v} )) {
|
||||
return( \$::VERSION );
|
||||
if (!defined($::VERSION)) {
|
||||
return ([xCAT::Usage->getVersion($cmd)]);
|
||||
}
|
||||
return( [$::VERSION] );
|
||||
}
|
||||
|
||||
if ( exists( $opt{h}) || $opt{help}) {
|
||||
@@ -112,6 +115,11 @@ sub parse_args {
|
||||
#################################
|
||||
#Option --activate not valid with --commit or --recover
|
||||
#################################
|
||||
if (exists($opt{bpa_acdl}) && (exists($opt{activate}) || exists($opt{commit}) ||
|
||||
exists($opt{recover}) || exists($opt{p}) || exists($opt{d}))) {
|
||||
return ( usage("Option --bpa_acdl not valid with other options "));
|
||||
}
|
||||
|
||||
if( exists( $opt{activate} ) && (exists( $opt{commit}) || exists( $opt{recover}))) {
|
||||
return( usage("Option --activate not valid with --commit or --recover ") );
|
||||
}
|
||||
@@ -149,10 +157,15 @@ sub parse_args {
|
||||
#--activate's value only can be concurrent and disruptive
|
||||
################################
|
||||
if(exists($opt{activate})) {
|
||||
if( ($opt{activate} ne "concurrent") && ($opt{activate} ne "disruptive")) {
|
||||
return (usage("--activate's value can only be concurrent or disruptive"));
|
||||
}
|
||||
|
||||
if (defined($request->{mgt}) && ($request->{mgt} =~ /xCAT::FSP/i)) {
|
||||
if (($opt{activate} ne "deferred") && ($opt{activate} ne "disruptive")) {
|
||||
return (usage("--activate's value can only be deferred or disruptive"));
|
||||
}
|
||||
} else {
|
||||
if( ($opt{activate} ne "concurrent") && ($opt{activate} ne "disruptive")) {
|
||||
return (usage("--activate's value can only be disruptive or concurrent"));
|
||||
}
|
||||
}
|
||||
if(!exists( $opt{d} )) {
|
||||
$opt{d} = "/tmp";
|
||||
}
|
||||
@@ -181,6 +194,9 @@ sub parse_args {
|
||||
} elsif( defined( $opt{ recover }) ) {
|
||||
print "recover flag\n";
|
||||
$housekeeping = "recover";
|
||||
} elsif (defined( $opt{ bpa_acdl})) {
|
||||
print "bpa_acdl flag\n";
|
||||
$housekeeping = "bpa_acdl";
|
||||
} else {
|
||||
print "no housekeeping - update mode\n";
|
||||
$housekeeping = undef;
|
||||
@@ -198,7 +214,7 @@ sub parse_args {
|
||||
####################
|
||||
#suport for "rflash", copy the rpm and xml packages from user-spcefied-directory to /install/packages_fw
|
||||
#####################
|
||||
if ( (!exists($opt{commit})) && (!exists($opt{ recover }))) {
|
||||
if ( (!exists($opt{commit})) && (!exists($opt{ recover })) && (!exists($opt{bpa_acdl}))) {
|
||||
if( preprocess_for_rflash($request, \%opt) == -1) {
|
||||
return( usage() );
|
||||
}
|
||||
@@ -517,18 +533,22 @@ sub get_lic_filenames {
|
||||
#############
|
||||
if($fff ne $2) {
|
||||
$upgrade_required = 1;
|
||||
if($activate ne "disruptive") {
|
||||
$msg = "Option --activate's value should be 'disruptive'";
|
||||
return ("", "","", $msg, -1);
|
||||
}
|
||||
} else {
|
||||
|
||||
if(($pns eq $1) && ($4 <= $active_level)) {
|
||||
$msg = $msg. "Upgrade $mtms $activate!";
|
||||
# if($activate ne "concurrent") {
|
||||
# $msg = "Option --actviate's value should be disruptive";
|
||||
# return ("", "","", $msg, -1);
|
||||
# }
|
||||
if(($pns eq $1) && ($3 > $active_level) && ($4 <= $active_level)) {
|
||||
$msg = $msg. "Upgrade $mtms $activate!";
|
||||
if($activate ne "concurrent") {
|
||||
$msg = "Option --actviate's value should be 'concurrent'";
|
||||
return ("", "","", $msg, -1);
|
||||
}
|
||||
} else {
|
||||
$msg = $msg . "Upgrade $mtms disruptively!";
|
||||
$msg = $msg . "Upgrade $mtms!";
|
||||
if($activate ne "disruptive") {
|
||||
$msg = "Option --activate's value shouldn't be concurrent, and it must be disruptive";
|
||||
$msg = "Option --activate's value should be 'disruptive'";
|
||||
return ("", "","", $msg, -1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,8 +152,6 @@ sub remote_copy_command
|
||||
my @src_file =
|
||||
@{$$config{'destDir_srcFile'}{$dest_dir}{'same_dest_name'}};
|
||||
|
||||
#Remove a file from the list if it does not exist
|
||||
#@src_file = map { $_ if -e $_; } @src_file;
|
||||
my $src_file_list = join ' ', @src_file;
|
||||
if ($src_file_list)
|
||||
{
|
||||
@@ -164,7 +162,6 @@ sub remote_copy_command
|
||||
%{$$config{'destDir_srcFile'}{$dest_dir}{'diff_dest_name'}};
|
||||
foreach my $src_file_diff_dest (keys %diff_dest_hash)
|
||||
{
|
||||
next if !-e $src_file_diff_dest;
|
||||
my $diff_basename = $diff_dest_hash{$src_file_diff_dest};
|
||||
print RSCYCCMDFILE
|
||||
"$exec_path $sync_opt $src_file_diff_dest $dest_user_host:$dest_dir/$diff_basename\n";
|
||||
|
||||
+35
-29
@@ -59,10 +59,11 @@ sub usage
|
||||
my $usagemsg3 =
|
||||
" -p <template path> [-o output file ] [-t <template count>]\n";
|
||||
my $usagemsg4 = " [-r remove templates] [-s <seednode>]\n";
|
||||
my $usagemsg5 = " [-e exactmatch] [-i ignore]\n";
|
||||
my $usagemsg5 = " [-e exactmatch] [-i ignore] [-V verbose]\n";
|
||||
my $usagemsg5A = " [-l userid] [--devicetype type_of_device]\n";
|
||||
my $usagemsg6 = " {-c <command> | -f <command file>}";
|
||||
my $usagemsg .= $usagemsg1 .= $usagemsg1a .= $usagemsg3 .= $usagemsg4 .=
|
||||
$usagemsg5 .= $usagemsg6;
|
||||
$usagemsg5 .= $usagemsg5A .= $usagemsg6;
|
||||
### end usage mesage
|
||||
|
||||
my $rsp = {};
|
||||
@@ -110,6 +111,8 @@ sub parse_and_run_sinv
|
||||
's|seed=s' => \$options{'seed_node'},
|
||||
'e|exactmatch' => \$options{'exactmatch'},
|
||||
'i|ignorefirst' => \$options{'ignorefirst'},
|
||||
'l|user=s' => \$options{'user'},
|
||||
'devicetype|devicetype=s' => \$options{'devicetype'},
|
||||
'c|cmd=s' => \$options{'sinv_cmd'},
|
||||
'f|file=s' => \$options{'sinv_cmd_file'},
|
||||
'v|version' => \$options{'version'},
|
||||
@@ -198,14 +201,36 @@ sub parse_and_run_sinv
|
||||
# strip off the program and the noderange
|
||||
#
|
||||
my @nodelist = ();
|
||||
my @cmdparts = split(' ', $cmd);
|
||||
my @cmdparts = ();
|
||||
if ($options{'devicetype'}) {
|
||||
# must split different because devices have commands with spaces
|
||||
@cmdparts = split(' ', $cmd,3);
|
||||
} else {
|
||||
@cmdparts = split(' ', $cmd);
|
||||
}
|
||||
my $cmdtype = shift @cmdparts;
|
||||
my $noderange = shift @cmdparts;
|
||||
my @cmd = ();
|
||||
if ($noderange =~ /^-/)
|
||||
if ($noderange =~ /^-/) # if imageupdate not node
|
||||
{ # no noderange
|
||||
push @cmd, $noderange; # put flag back on command
|
||||
}
|
||||
# root is sending the command
|
||||
my @envs;
|
||||
# if -l user id supplied
|
||||
if ($options{'user'}) {
|
||||
push @cmd,"-l";
|
||||
push @cmd,$options{'user'};
|
||||
push @envs,"DSH_TO_USERID=$options{'user'}";
|
||||
}
|
||||
# if device type supplied
|
||||
if ($options{'devicetype'}) {
|
||||
push @cmd,"--devicetype";
|
||||
my $switchtype = $options{'devicetype'};
|
||||
$switchtype =~ s/::/\//g;
|
||||
push @cmd,$switchtype;
|
||||
}
|
||||
|
||||
foreach my $part (@cmdparts)
|
||||
{
|
||||
|
||||
@@ -471,22 +496,11 @@ sub parse_and_run_sinv
|
||||
{
|
||||
command => [$cmdtype],
|
||||
node => \@seed,
|
||||
env => [@envs],
|
||||
arg => [@cmd]
|
||||
},
|
||||
\&$cmdoutput
|
||||
);
|
||||
if ($? > 0)
|
||||
{
|
||||
my $rsp = {};
|
||||
my $i = 0;
|
||||
foreach my $line (@cmdresult)
|
||||
{
|
||||
$rsp->{data}->[$i] = $line;
|
||||
$i++;
|
||||
}
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# write the results to the tempfile after running through xdshcoll
|
||||
$rc = &storeresults($callback);
|
||||
@@ -512,23 +526,12 @@ sub parse_and_run_sinv
|
||||
{
|
||||
command => [$cmdtype],
|
||||
node => \@nodelist,
|
||||
env => [@envs],
|
||||
arg => [@cmd]
|
||||
},
|
||||
\&$cmdoutput
|
||||
);
|
||||
|
||||
if ($? > 0)
|
||||
{
|
||||
my $rsp = {};
|
||||
my $i = 0;
|
||||
foreach my $line (@cmdresult)
|
||||
{
|
||||
$rsp->{data}->[$i] = $line;
|
||||
$i++;
|
||||
}
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# write the results to the tempfile after running through xdshcoll
|
||||
$rc = &storeresults($callback);
|
||||
@@ -1166,6 +1169,7 @@ sub writereport
|
||||
my $rsp = {};
|
||||
$ignorefirsttemplate =~ tr/a-z/A-Z/; # convert to upper
|
||||
my $firstpass = 0;
|
||||
my @allnodearray=();
|
||||
foreach my $template (sort keys %nodehash)
|
||||
{
|
||||
|
||||
@@ -1193,6 +1197,7 @@ sub writereport
|
||||
{
|
||||
my @shortnodename = split(/\./, $node);
|
||||
push @nodearray, $shortnodename[0]; # add to process list
|
||||
push @allnodearray, $shortnodename[0]; # add to total list
|
||||
$nodelist .= $shortnodename[0]; # add to print list
|
||||
$nodelist .= ',';
|
||||
}
|
||||
@@ -1250,7 +1255,8 @@ sub writereport
|
||||
my @shortnodename;
|
||||
chomp $dshnodename;
|
||||
$dshnodename =~ s/\s*//g; # remove blanks
|
||||
foreach my $nodename (@nodearray)
|
||||
#foreach my $nodename (@nodearray)
|
||||
foreach my $nodename (@allnodearray)
|
||||
{
|
||||
@shortdshnodename = split(/\./, $dshnodename);
|
||||
@shortnodename = split(/\./, $nodename);
|
||||
|
||||
Executable
+816
@@ -0,0 +1,816 @@
|
||||
package xCAT::SLP;
|
||||
use Carp;
|
||||
use IO::Select;
|
||||
use strict;
|
||||
use xCAT::Utils;
|
||||
my $ip6support = eval {
|
||||
require IO::Socket::INET6;
|
||||
require Socket6;
|
||||
1;
|
||||
};
|
||||
use Socket;
|
||||
unless ($ip6support) {
|
||||
require IO::Socket::INET;
|
||||
}
|
||||
|
||||
#TODO: somehow get at system headers to get the value, put in linux's for now
|
||||
use constant IPV6_MULTICAST_IF => 17;
|
||||
use constant IP_MULTICAST_IF => 32;
|
||||
use constant REQ_INTERVAL => 1;
|
||||
my %xid_to_srvtype_map;
|
||||
my $xid;
|
||||
my $gprlist;
|
||||
my %searchmacs;
|
||||
my %ip4neigh;
|
||||
my %ip6neigh;
|
||||
my %servicehash;
|
||||
my %sendhash;
|
||||
my $attrpy = 0;
|
||||
my $serrpy = 0;
|
||||
sub getmulticasthash {
|
||||
my $hash=0;
|
||||
my @nums = unpack("C*",shift);
|
||||
foreach my $num (@nums) {
|
||||
$hash *= 33;
|
||||
$hash += $num;
|
||||
$hash &= 0xffff;
|
||||
}
|
||||
$hash &= 0x3ff;
|
||||
$hash |= 0x1000;
|
||||
return sprintf("%04x",$hash);
|
||||
}
|
||||
|
||||
|
||||
sub dodiscover {
|
||||
my %args = @_;
|
||||
my $unicast = $args{unicast}; #should be used with -s !
|
||||
my $ipranges = $args{range};
|
||||
my $rspcount = 0;
|
||||
my $rspcount1 = 0;
|
||||
my $sendcount = 1;
|
||||
$xid = int(rand(16384))+1;
|
||||
my %rethash;
|
||||
unless ($args{'socket'}) {
|
||||
if ($ip6support) {
|
||||
$args{'socket'} = IO::Socket::INET6->new(Proto => 'udp');
|
||||
} else {
|
||||
$args{'socket'} = IO::Socket::INET->new(Proto => 'udp');
|
||||
}
|
||||
#make an extra effort to request biggest receive buffer OS is willing to give us
|
||||
if (-r "/proc/sys/net/core/rmem_max") { # we can detect the maximum allowed socket, read it.
|
||||
my $sysctl;
|
||||
open ($sysctl,"<","/proc/sys/net/core/rmem_max");
|
||||
my $maxrcvbuf=<$sysctl>;
|
||||
my $rcvbuf = $args{'socket'}->sockopt(SO_RCVBUF);
|
||||
if ($maxrcvbuf > $rcvbuf) {
|
||||
$args{'socket'}->sockopt(SO_RCVBUF,$maxrcvbuf/2);
|
||||
}
|
||||
}
|
||||
} #end of unless socket
|
||||
unless ($args{SrvTypes}) { croak "SrvTypes argument is required for xCAT::SLP::Dodiscover"; }
|
||||
unless (xCAT::Utils->isAIX()) { # AIX bug, can't set socket with SO_BROADCAST, otherwise multicast can't work.
|
||||
setsockopt($args{'socket'},SOL_SOCKET,SO_BROADCAST,1); #allow for broadcasts to be sent, we know what we are doing
|
||||
}
|
||||
my @srvtypes;
|
||||
if (ref $args{SrvTypes}) {
|
||||
@srvtypes = @{$args{SrvTypes}};
|
||||
} else {
|
||||
@srvtypes = split /,/,$args{SrvTypes};
|
||||
}
|
||||
my $interfaces = get_interfaces(%args);
|
||||
if ($args{Ip}) {
|
||||
foreach my $nic (keys %$interfaces) {
|
||||
if (${${$interfaces->{$nic}}{ipv4addrs}}[0] =~ /(\d+\.\d+\.\d+\.\d+)/) {
|
||||
unless ($args{Ip} =~ $1) {
|
||||
delete $interfaces->{$nic};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# for print information
|
||||
my @printip;
|
||||
foreach my $iface (keys %{$interfaces}) {
|
||||
foreach my $sip (@{$interfaces->{$iface}->{ipv4addrs}}) {
|
||||
my $ip = $sip;
|
||||
$ip =~ s/\/(.*)//;
|
||||
push @printip, $ip;
|
||||
}
|
||||
}
|
||||
my $printinfo = join(",", @printip);
|
||||
if ($unicast) {
|
||||
if (xCAT::Utils->isAIX()){
|
||||
send_message($args{reqcallback}, 1, "lsslp unicast is not supported on AIX");
|
||||
exit 1;
|
||||
}
|
||||
if (! -f "/usr/bin/nmap"){
|
||||
send_message($args{reqcallback}, 1, "nmap does not exist, lsslp unicast is not possible");
|
||||
exit 1;
|
||||
}
|
||||
my @servernodes;
|
||||
my @iprange = split /,/, $ipranges;
|
||||
foreach my $range (@iprange) {
|
||||
`/usr/bin/nmap $range -sn -PE -n --send-ip -T5 `;
|
||||
my $nmapres = `/usr/bin/nmap $range -PE -p 427 -n --send-ip -T5 `;
|
||||
foreach my $line (split(/\n\n/,$nmapres)) {#\n/,$nmapres)) {
|
||||
my $server;
|
||||
foreach my $sline (split(/\n/, $line)) {
|
||||
if ($sline =~ /Nmap scan report for (\d+\.\d+\.\d+\.\d+)/) {
|
||||
$server = $1;
|
||||
}
|
||||
if ($sline =~ /427/ and ($sline =~ /open/ or $sline =~ /filtered/)){
|
||||
push @servernodes, $server;
|
||||
}
|
||||
} # end of foreach line
|
||||
} # end of foreach line
|
||||
} # end of foreach pi-range
|
||||
unless (@servernodes){
|
||||
send_message($args{reqcallback}, 0, "Nmap returns nothing");
|
||||
return undef;
|
||||
}
|
||||
my $number = scalar (@servernodes);
|
||||
send_message($args{reqcallback}, 0, "Begin to do unicast to $number nodes...");
|
||||
my %rechash;
|
||||
pipe CREAD,PWRITE;
|
||||
my $pid = xCAT::Utils->xfork();
|
||||
if ( !defined($pid) ) {
|
||||
send_message($args{reqcallback}, 1, "Fork error: $!" );
|
||||
return undef;
|
||||
} elsif ( $pid == 0 ) {
|
||||
close PWRITE;
|
||||
foreach my $srvtype (@srvtypes) {
|
||||
my $packet = generate_attribute_request(%args, SrvType=>$srvtype);
|
||||
foreach my $destserver (@servernodes) {
|
||||
my $destip = inet_aton($destserver);
|
||||
my $destaddr = sockaddr_in(427,$destip);
|
||||
my $res = $args{'socket'}->send($packet,0,$destaddr);
|
||||
} # end of foreach destserver
|
||||
}# end of foreach services
|
||||
while(<CREAD>){
|
||||
chomp;
|
||||
my $destserver = $_;
|
||||
if ($destserver =~ /NowYouNeedToDie/){
|
||||
close CREAD;
|
||||
exit 0;
|
||||
}
|
||||
foreach my $srvtype (@srvtypes) {
|
||||
my $packet = generate_attribute_request(%args, SrvType=>$srvtype);
|
||||
my $destip = inet_aton($destserver);
|
||||
my $destaddr = sockaddr_in(427,$destip);
|
||||
for( my $j = 0; $j < 1; $j++) {
|
||||
my $res = $args{'socket'}->send($packet,0,$destaddr);
|
||||
} # end of foreach j++
|
||||
}# end of foreach services
|
||||
} # end of while (cread)
|
||||
} else {
|
||||
close CREAD;
|
||||
$rspcount = 0;
|
||||
my $waittime = ($args{Time}>0)?$args{Time}:300;
|
||||
my $deadline = time()+ $waittime;
|
||||
my $waitforsocket = IO::Select->new();
|
||||
$waitforsocket->add($args{'socket'});
|
||||
my $rectime = time() + 5;
|
||||
my $recvzero = 0;
|
||||
while ($deadline > time()) {
|
||||
$rspcount1 = 0;
|
||||
while ($rectime > time()) {
|
||||
while ($waitforsocket->can_read(0)) {
|
||||
my $slppacket;
|
||||
my $peer = $args{'socket'}->recv($slppacket,3000,0);
|
||||
$rechash{$peer} = $slppacket;
|
||||
} #end of can_read
|
||||
} # end of receiving
|
||||
# now begin to parse the packets
|
||||
for my $tp (keys %rechash) {
|
||||
my @restserver ;
|
||||
my $pkg = $tp; #$peerarray[$j];
|
||||
my $slpkg = $rechash{$tp}; #$pkgarray[$j];
|
||||
my( $port,$flow,$ip6n,$ip4n,$scope);
|
||||
my $peername;
|
||||
if ($ip6support) {
|
||||
( $port,$flow,$ip6n,$scope) = Socket6::unpack_sockaddr_in6_all($pkg);
|
||||
$peername = Socket6::inet_ntop(Socket6::AF_INET6(),$ip6n);
|
||||
} else {
|
||||
($port,$ip4n) = sockaddr_in($pkg);
|
||||
$peername = inet_ntoa($ip4n);
|
||||
}
|
||||
if ($peername =~ /\./) { #ipv4
|
||||
$peername =~ s/::ffff://;
|
||||
}
|
||||
if ($rethash{$peername}) {
|
||||
next; #got a dupe, discard
|
||||
}
|
||||
my $result = process_slp_packet(packet=>$slpkg,sockaddr=>$pkg,'socket'=>$args{'socket'}, peername=>$peername, callback=>$args{reqcallback});
|
||||
if ($result) {
|
||||
$rspcount++;
|
||||
$rspcount1++;
|
||||
$result->{peername} = $peername;
|
||||
$result->{scopeid} = $scope;
|
||||
$result->{sockaddr} = $pkg;
|
||||
my $hashkey;
|
||||
if ($peername =~ /fe80/) {
|
||||
$peername .= '%'.$scope;
|
||||
}
|
||||
$rethash{$peername} = $result;
|
||||
if ($args{Callback}) {
|
||||
$args{Callback}->($result);
|
||||
}
|
||||
foreach my $mynode (@servernodes) {
|
||||
unless ($mynode =~ $peername) {
|
||||
push @restserver, $mynode;
|
||||
}#end of mynode=~peername
|
||||
} # end of foreach
|
||||
@servernodes = @restserver;
|
||||
} # end of if result
|
||||
} # end of foreach processing
|
||||
foreach my $node (@servernodes) {
|
||||
syswrite PWRITE,"$node\n";
|
||||
} # end of foreach servernodes
|
||||
$recvzero++ unless ($rspcount1);
|
||||
last if ($recvzero > 2);
|
||||
} # end of while(deadline)
|
||||
syswrite PWRITE,"NowYouNeedToDie\n";
|
||||
close PWRITE;
|
||||
if (@servernodes) {
|
||||
my $miss = join(",", @servernodes);
|
||||
send_message($args{reqcallback}, 0, "Warning: can't get attributes from these nodes' replies: $miss. Please re-send unicast to these nodes.") if ($args{reqcallback});
|
||||
}
|
||||
}# end of parent process
|
||||
} else {
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback} and !$args{nomsg} );
|
||||
foreach my $srvtype (@srvtypes) {
|
||||
send_service_request_single(%args,ifacemap=>$interfaces,SrvType=>$srvtype);
|
||||
}
|
||||
unless ($args{NoWait}) { #in nowait, caller owns the responsibility..
|
||||
#by default, report all respondants within 3 seconds:
|
||||
my $waitforsocket = IO::Select->new();
|
||||
$waitforsocket->add($args{'socket'});
|
||||
my $retrytime = ($args{Retry}>0)?$args{Retry}+1:3;
|
||||
my $retryinterval = ($args{Retry}>0)?$args{Retry}:REQ_INTERVAL;
|
||||
my $waittime = ($args{Time}>0)?$args{Time}:20;
|
||||
my @peerarray;
|
||||
my @pkgarray;
|
||||
|
||||
my $startinterval = time();
|
||||
my $interval;
|
||||
my $deadline=time()+$waittime;
|
||||
my( $port,$flow,$ip6n,$ip4n,$scope);
|
||||
my $slppacket;
|
||||
my $peername;
|
||||
while ($deadline > time()) {
|
||||
########################################
|
||||
# receive untill there is none
|
||||
########################################
|
||||
while ($waitforsocket->can_read(0)) {
|
||||
my $peer = $args{'socket'}->recv($slppacket,3000,0);
|
||||
push @peerarray, $peer;
|
||||
push @pkgarray, $slppacket;
|
||||
}
|
||||
#######################################
|
||||
# process the packets
|
||||
#######################################
|
||||
for(my $j = 0; $j< scalar(@peerarray); $j++) {
|
||||
my $pkg = $peerarray[$j];
|
||||
my $slpkg = $pkgarray[$j];
|
||||
if ($ip6support) {
|
||||
( $port,$flow,$ip6n,$scope) = Socket6::unpack_sockaddr_in6_all($pkg);
|
||||
$peername = Socket6::inet_ntop(Socket6::AF_INET6(),$ip6n);
|
||||
} else {
|
||||
($port,$ip4n) = sockaddr_in($pkg);
|
||||
$peername = inet_ntoa($ip4n);
|
||||
}
|
||||
if ($rethash{$peername}) {
|
||||
next; #got a dupe, discard
|
||||
}
|
||||
my $result = process_slp_packet(packet=>$slpkg,sockaddr=>$pkg,'socket'=>$args{'socket'});
|
||||
if ($result) {
|
||||
if ($peername =~ /\./) { #ipv4
|
||||
$peername =~ s/::ffff://;
|
||||
}
|
||||
$result->{peername} = $peername;
|
||||
if ($gprlist) {
|
||||
$gprlist .= ','.$peername if(length($gprlist) < 1250);
|
||||
} else {
|
||||
$gprlist = $peername;
|
||||
}
|
||||
$result->{scopeid} = $scope;
|
||||
$result->{sockaddr} = $pkg;
|
||||
my $hashkey;
|
||||
if ($peername =~ /fe80/) {
|
||||
$peername .= '%'.$scope;
|
||||
}
|
||||
$rspcount++;
|
||||
$rspcount1++;
|
||||
$rethash{$peername} = $result;
|
||||
if ($args{Callback}) {
|
||||
$args{Callback}->($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
#############################
|
||||
# check if need to return
|
||||
#############################
|
||||
@peerarray = ();
|
||||
@pkgarray = ();
|
||||
$interval = time() - $startinterval;
|
||||
if ($args{Time} and $args{Count}) {
|
||||
if ($rspcount >= $args{Count} or $interval >= $args{Time}) {
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
last;
|
||||
}
|
||||
}
|
||||
if ($sendcount > $retrytime and $rspcount1 == 0) {
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
last;
|
||||
}
|
||||
#########################
|
||||
# send request again
|
||||
#########################
|
||||
if ( $interval > $retryinterval){#* (2**$sendcount))) { #double time
|
||||
$sendcount++;
|
||||
$startinterval = time();
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback} and !$args{nomsg});
|
||||
foreach my $srvtype (@srvtypes) {
|
||||
send_service_request_single(%args,ifacemap=>$interfaces,SrvType=>$srvtype);
|
||||
}
|
||||
$rspcount1 = 0;
|
||||
}
|
||||
}
|
||||
} #end nowait
|
||||
} #end of if( unicast )
|
||||
|
||||
foreach my $entry (keys %rethash) {
|
||||
handle_new_slp_entity($rethash{$entry});
|
||||
}
|
||||
if (xCAT::Utils->isAIX()) {
|
||||
foreach my $iface (keys %{$interfaces}) {
|
||||
foreach my $sip (@{$interfaces->{$iface}->{ipv4addrs}}) {
|
||||
my $ip = $sip;
|
||||
$ip =~ s/\/(.*)//;
|
||||
my $maskbits = $1;
|
||||
my $runcmd = `route delete 239.255.255.253 $ip`;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (\%searchmacs, $sendcount, $rspcount);
|
||||
}
|
||||
|
||||
sub process_slp_packet {
|
||||
my %args = @_;
|
||||
my $sockaddy = $args{sockaddr};
|
||||
my $socket = $args{'socket'};
|
||||
my $packet = $args{packet};
|
||||
my $parsedpacket = removeslpheader($packet);
|
||||
if ($parsedpacket->{FunctionId} == 2) {#Service Reply
|
||||
parse_service_reply($parsedpacket->{payload},$parsedpacket);
|
||||
unless (ref $parsedpacket->{service_urls} and scalar @{$parsedpacket->{service_urls}}) { return undef; }
|
||||
#send_attribute_request('socket'=>$socket,url=>$parsedpacket->{service_urls}->[0],sockaddr=>$sockaddy);
|
||||
if ($parsedpacket->{attributes}) { #service reply had ext
|
||||
return $parsedpacket; #don't bother sending attrrequest, already got it in first packet
|
||||
}
|
||||
my $srvtype = $xid_to_srvtype_map{$parsedpacket->{Xid}};
|
||||
my $packet = generate_attribute_request(%args,SrvType=>$srvtype);
|
||||
$sendhash{$args{peername}}->{package} = $packet;
|
||||
$sendhash{$args{peername}}->{sockaddy} = $sockaddy;
|
||||
$serrpy++;
|
||||
$socket->send($packet,0,$sockaddy);
|
||||
return undef;
|
||||
} elsif ($parsedpacket->{FunctionId} == 7) { #attribute reply
|
||||
$attrpy++;
|
||||
$parsedpacket->{SrvType} = $xid_to_srvtype_map{$parsedpacket->{Xid}};
|
||||
$parsedpacket->{attributes} = parse_attribute_reply($parsedpacket->{payload});
|
||||
#delete $parsedpacket->{payload};
|
||||
my $attributes = $parsedpacket->{attributes};
|
||||
my $type = ${$attributes->{'type'}}[0] ;
|
||||
return undef unless ($type) ;
|
||||
return $parsedpacket;
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
sub parse_attribute_reply {
|
||||
my $contents = shift;
|
||||
my @payload = unpack("C*",$contents);
|
||||
if ($payload[0] != 0 or $payload[1] != 0) {
|
||||
return {};
|
||||
}
|
||||
splice (@payload,0,2);
|
||||
return parse_attribute_list(\@payload);
|
||||
}
|
||||
sub parse_attribute_list {
|
||||
my $payload = shift;
|
||||
my $attrlength = ($payload->[0]<<8)+$payload->[1];
|
||||
splice(@$payload,0,2);
|
||||
my @attributes = splice(@$payload,0,$attrlength);
|
||||
my $attrstring = pack("C*",@attributes);
|
||||
my %attribs;
|
||||
#now we have a string...
|
||||
my $lastattrstring;
|
||||
while ($attrstring) {
|
||||
if ($lastattrstring eq $attrstring) { #infinite loop
|
||||
$attribs{unparsed_attribdata}=$attrstring;
|
||||
last;
|
||||
}
|
||||
$lastattrstring=$attrstring;
|
||||
if ($attrstring =~ /^\(/) {
|
||||
$attrstring =~ s/([^)]*\)),?//;
|
||||
my $attrib = $1;
|
||||
$attrib =~ s/^\(//;
|
||||
$attrib =~ s/\),?$//;
|
||||
$attrib =~ s/=(.*)$//;
|
||||
$attribs{$attrib}=[];
|
||||
my $valstring = $1;
|
||||
if (defined $valstring) {
|
||||
foreach(split /,/,$valstring) {
|
||||
push @{$attribs{$attrib}},$_;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$attrstring =~ s/([^,]*),?//;
|
||||
$attribs{$1}=[];
|
||||
}
|
||||
}
|
||||
return \%attribs;
|
||||
}
|
||||
sub generate_attribute_request {
|
||||
my %args = @_;
|
||||
my $srvtype = $args{SrvType};
|
||||
my $scope = "DEFAULT";
|
||||
if ($args{Scopes}) { $scope = $args{Scopes}; }
|
||||
my $packet = pack("C*",0,0); #no prlist
|
||||
my $service = $srvtype;
|
||||
$service =~ s!://.*!!;
|
||||
my $length = length($service);
|
||||
$packet .= pack("C*",($length>>8),($length&0xff));
|
||||
$length = length($scope);
|
||||
$packet .= $service.pack("C*",($length>>8),($length&0xff)).$scope;
|
||||
$packet .= pack("C*",0,0,0,0);
|
||||
my $header = genslpheader($packet,FunctionId=>6);
|
||||
$xid_to_srvtype_map{$xid++}=$srvtype;
|
||||
return $header.$packet;
|
||||
# $args{'socket'}->send($header.$packet,0,$args{sockaddry});
|
||||
}
|
||||
|
||||
|
||||
sub parse_service_reply {
|
||||
my $packet = shift;
|
||||
my $parsedpacket = shift;
|
||||
my @reply = unpack("C*",$packet);
|
||||
if ($reply[0] != 0 or $reply[1] != 0) {
|
||||
return ();
|
||||
}
|
||||
if ($parsedpacket->{extoffset}) {
|
||||
my @extdata = splice(@reply,$parsedpacket->{extoffset}-$parsedpacket->{currentoffset});
|
||||
$parsedpacket->{currentoffset} = $parsedpacket->{extoffset};
|
||||
parse_extension(\@extdata,$parsedpacket);
|
||||
}
|
||||
my $numurls = ($reply[2]<<8)+$reply[3];
|
||||
splice (@reply,0,4);
|
||||
while ($numurls--) {
|
||||
push @{$parsedpacket->{service_urls}},extract_next_url(\@reply);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
sub parse_extension {
|
||||
my $extdata = shift;
|
||||
my $parsedpacket = shift;
|
||||
my $extid = ($extdata->[0]<<8)+$extdata->[1];
|
||||
my $nextext = (($extdata->[2])<<16)+(($extdata->[3])<<8)+$extdata->[4];
|
||||
if ($nextext) {
|
||||
my @nextext = splice(@$extdata,$nextext-$parsedpacket->{currentoffset});
|
||||
$parsedpacket->{currentoffset} = $nextext;
|
||||
parse_extension(\@nextext,$parsedpacket);
|
||||
}
|
||||
splice(@$extdata,0,5);
|
||||
if ($extid == 2) {
|
||||
#this is defined in RFC 3059, attribute list extension
|
||||
#employed by AMM for one...
|
||||
my $urllen = ((shift @$extdata)<<8)+(shift @$extdata);
|
||||
splice @$extdata,0,$urllen; #throw this out for now..
|
||||
$parsedpacket->{attributes} = parse_attribute_list($extdata);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub extract_next_url { #section 4.3 url entries
|
||||
my $payload = shift;
|
||||
splice (@$payload,0,3); # discard reserved and lifetime which we will not bother using
|
||||
my $urllength = ((shift @$payload)<<8)+(shift @$payload);
|
||||
my @url = splice(@$payload,0,$urllength);
|
||||
my $authblocks = shift @$payload;
|
||||
unless ($authblocks == 0) {
|
||||
$payload = []; #TODO: skip/use auth blocks if needed to get at more URLs
|
||||
}
|
||||
return pack("C*",@url);
|
||||
}
|
||||
|
||||
sub send_service_request_single {
|
||||
my %args = @_;
|
||||
my $packet = generate_service_request(%args);
|
||||
my $interfaces = $args{ifacemap}; #get_interfaces(%args);
|
||||
my $socket = $args{'socket'};
|
||||
my @v6addrs;
|
||||
my $v6addr;
|
||||
if ($ip6support) {
|
||||
my $hash=getmulticasthash($args{SrvType});
|
||||
my $target = "ff02::1:$hash";
|
||||
my ($fam, $type, $proto, $name);
|
||||
($fam, $type, $proto, $v6addr, $name) =
|
||||
Socket6::getaddrinfo($target,"svrloc",Socket6::AF_INET6(),SOCK_DGRAM,0);
|
||||
push @v6addrs,$v6addr;
|
||||
($fam, $type, $proto, $v6addr, $name) =
|
||||
Socket6::getaddrinfo("ff01::1:$hash","svrloc",Socket6::AF_INET6(),SOCK_DGRAM,0);
|
||||
push @v6addrs,$v6addr;
|
||||
}
|
||||
my $ipv4mcastaddr = inet_aton("239.255.255.253"); #per rfc 2608
|
||||
my $ipv4sockaddr = sockaddr_in(427,$ipv4mcastaddr);
|
||||
foreach my $iface (keys %{$interfaces}) {
|
||||
if ($ip6support) {
|
||||
setsockopt($socket,Socket6::IPPROTO_IPV6(),IPV6_MULTICAST_IF,pack("I",$interfaces->{$iface}->{scopeidx}));
|
||||
foreach $v6addr (@v6addrs) {
|
||||
$socket->send($packet,0,$v6addr);
|
||||
}
|
||||
}
|
||||
foreach my $sip (@{$interfaces->{$iface}->{ipv4addrs}}) {
|
||||
my $ip = $sip;
|
||||
$ip =~ s/\/(.*)//;
|
||||
my $maskbits = $1;
|
||||
if (xCAT::Utils->isAIX()) {
|
||||
my $runcmd = `route add 239.255.255.253 $ip`;
|
||||
}
|
||||
my $ipn = inet_aton($ip); #we are ipv4 only, this is ok
|
||||
my $ipnum=unpack("N",$ipn);
|
||||
$ipnum= $ipnum | (2**(32-$maskbits))-1;
|
||||
my $bcastn = pack("N",$ipnum);
|
||||
my $bcastaddr = sockaddr_in(427,$bcastn);
|
||||
$socket->sockopt(SO_BROADCAST, 1) or die("sockopt: $!\n");
|
||||
$socket->send($packet,0,$bcastaddr);
|
||||
setsockopt($socket,0,IP_MULTICAST_IF,$ipn);
|
||||
$socket->send($packet,0,$ipv4sockaddr);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub get_interfaces {
|
||||
#TODO: AIX tolerance, no subprocess, include/exclude interface(s)
|
||||
my %ifacemap;
|
||||
my $payingattention=0;
|
||||
my $interface;
|
||||
my $keepcurrentiface;
|
||||
# AIX part
|
||||
if (xCAT::Utils->isAIX()) {
|
||||
$ip6support = 0;
|
||||
my $result = `ifconfig -a`;
|
||||
my @nics = $result =~ /(\w+\d+)\: flags=/g;
|
||||
my @adapter = split /\w+\d+:\s+flags=/, $result;
|
||||
for (my $i=0; $i<scalar(@adapter); $i++) {
|
||||
$_ = $adapter[$i+1];
|
||||
if ( !($_ =~ /LOOPBACK/ ) and
|
||||
$_ =~ /UP(,|>)/ and
|
||||
$_ =~ /BROADCAST/ ) {
|
||||
my @ip = split /\n/;
|
||||
for my$entry ( @ip ) {
|
||||
if ( $entry =~ /broadcast\s+/ and $entry =~ /^\s*inet\s+(\d+\.\d+\.\d+\.\d+)/) {
|
||||
my $tmpip = $1;
|
||||
if($entry =~ /netmask\s+(0x\w+)/) {
|
||||
my $mask = hex($1);
|
||||
my $co = 31;
|
||||
my $count = 0;
|
||||
while ($co+1) {
|
||||
if((($mask&(2**$co))>>$co) == 1) {
|
||||
$count++;
|
||||
}
|
||||
$co--;
|
||||
}
|
||||
$tmpip = $tmpip.'/'.$count;
|
||||
}
|
||||
push @{$ifacemap{$nics[$i]}->{ipv4addrs}},$tmpip;
|
||||
if( $nics[$i]=~ /\w+(\d+)/){
|
||||
$ifacemap{$nics[$i]}->{scopeidx} = $1+2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
my @ipoutput = `ip addr`;
|
||||
foreach my $line (@ipoutput) {
|
||||
if ($line =~ /^\d/) { # new interface, new context..
|
||||
if ($interface and not $keepcurrentiface) {
|
||||
#don't bother reporting unusable nics
|
||||
delete $ifacemap{$interface};
|
||||
}
|
||||
$keepcurrentiface=0;
|
||||
unless ($line =~ /MULTICAST/) { #don't care if it isn't multicast capable
|
||||
$payingattention=0;
|
||||
next;
|
||||
}
|
||||
$payingattention=1;
|
||||
$line =~ /^([^:]*): ([^:]*):/;
|
||||
$interface=$2;
|
||||
$ifacemap{$interface}->{scopeidx}=$1;
|
||||
}
|
||||
unless ($payingattention) { next; } #don't think about lines unless in context of paying attention.
|
||||
if ($line =~ /inet/) {
|
||||
$keepcurrentiface=1;
|
||||
}
|
||||
if ($line =~ /\s+inet\s+(\S+)\s/) { #got an ipv4 address, store it
|
||||
push @{$ifacemap{$interface}->{ipv4addrs}},$1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return \%ifacemap;
|
||||
}
|
||||
# discovery is "service request", rfc 2608
|
||||
# 0 1 2 3
|
||||
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | Service Location header (function = SrvRqst = 1) |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | length of <PRList> | <PRList> String \
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | length of <service-type> | <service-type> String \
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | length of <scope-list> | <scope-list> String \
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | length of predicate string | Service Request <predicate> \
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | length of <SLP SPI> string | <SLP SPI> String \
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
sub generate_service_request {
|
||||
my %args = @_;
|
||||
my $srvtype = $args{SrvType};
|
||||
my $scope = "DEFAULT";
|
||||
if ($args{Scopes}) { $scope = $args{Scopes}; }
|
||||
my $prlist = $gprlist;
|
||||
my $prlength = length($prlist);
|
||||
my $packet = pack("C*",($prlength>>8),($prlength&0xff));
|
||||
$packet .= $prlist;
|
||||
my $length = length($srvtype);
|
||||
$packet .= pack("C*",($length>>8),($length&0xff));
|
||||
$packet .= $srvtype;
|
||||
$length = length($scope);
|
||||
$packet .= pack("C*",($length>>8),($length&0xff));
|
||||
$packet .= $scope;
|
||||
#no ldap predicates, and no auth, so zeroes..
|
||||
$packet .= pack("C*",0,0,0,0);
|
||||
$packet .= pack("C*",0,2,0,0,0,0,0,0,0,0);
|
||||
my $extoffset = length($srvtype)+length($scope)+length($prlist)+10;
|
||||
my $header = genslpheader($packet,Multicast=>1,FunctionId=>1,ExtOffset=>$extoffset);
|
||||
$xid_to_srvtype_map{$xid++}=$srvtype;
|
||||
return $packet = $header.$packet;
|
||||
}
|
||||
# SLP header from RFC 2608
|
||||
# 0 1 2 3
|
||||
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | Version | Function-ID | Length |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | Length, contd.|O|F|R| reserved |Next Ext Offset|
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | Next Extension Offset, contd.| XID |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | Language Tag Length | Language Tag \
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
sub removeslpheader {
|
||||
my $packet = shift;
|
||||
my %parsedheader;
|
||||
my @payload = unpack("C*",$packet);
|
||||
$parsedheader{Version} = shift @payload;
|
||||
$parsedheader{FunctionId} = shift @payload;
|
||||
splice(@payload,0,3); #remove length
|
||||
splice(@payload,0,2); #TODO: parse flags
|
||||
my $nextoffset = ((shift @payload)<<16)+((shift @payload)<<8)+(shift @payload);
|
||||
$parsedheader{Xid} = ((shift @payload)<<8)+(shift @payload);
|
||||
my $langlen = ((shift @payload)<<8)+(shift @payload);
|
||||
$parsedheader{lang} = pack("C*",splice(@payload,0,$langlen));
|
||||
$parsedheader{payload} = pack("C*",@payload);
|
||||
if ($nextoffset != 0) {
|
||||
#correct offset since header will be removed
|
||||
$parsedheader{currentoffset} = 14+$langlen;
|
||||
$parsedheader{extoffset}=$nextoffset;
|
||||
}
|
||||
return \%parsedheader;
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub genslpheader {
|
||||
my $packet = shift;
|
||||
my %args = @_;
|
||||
my $flaghigh=0;
|
||||
my $flaglow=0; #this will probably never ever ever change
|
||||
if ($args{Multicast}) { $flaghigh |= 0x20; }
|
||||
my $extoffset=0;
|
||||
if ($args{ExtOffset}) {
|
||||
$extoffset = $args{ExtOffset}+16;
|
||||
}
|
||||
my @extoffset=(($extoffset>>16),(($extoffset>>8)&0xff),($extoffset&0xff));
|
||||
my $length = length($packet)+16; #our header is 16 bytes due to lang tag invariance
|
||||
if ($length > 1400) { die "Overflow not supported in xCAT SLP"; }
|
||||
return pack("C*",2, $args{FunctionId}, ($length >> 16), ($length >> 8)&0xff, $length&0xff, $flaghigh, $flaglow,@extoffset,$xid>>8,$xid&0xff,0,2)."en";
|
||||
}
|
||||
|
||||
unless (caller) {
|
||||
#time to provide unit testing/example usage
|
||||
#somewhat fancy invocation with multiple services and callback for
|
||||
#results on-the-fly
|
||||
require Data::Dumper;
|
||||
Data::Dumper->import();
|
||||
my $srvtypes = ["service:management-hardware.IBM:chassis-management-module","service:management-hardware.IBM:integrated-management-module2","service:management-hardware.IBM:management-module","service:management-hardware.IBM:cec-service-processor"];
|
||||
xCAT::SLP::dodiscover(SrvTypes=>$srvtypes,Callback=>sub { print Dumper(@_) });
|
||||
#example 2: simple invocation of a single service type
|
||||
$srvtypes = "service:management-hardware.IBM:chassis-management-module";
|
||||
print Dumper(xCAT::SLP::dodiscover(SrvTypes=>$srvtypes));
|
||||
#TODO: pass-in socket and not wait inside SLP.pm example
|
||||
}
|
||||
###########################################
|
||||
# Parse the slp resulte data
|
||||
###########################################
|
||||
sub handle_new_slp_entity {
|
||||
my $data = shift;
|
||||
delete $data->{sockaddr}; #won't need it
|
||||
my $mac = get_mac_for_addr($data->{peername});
|
||||
unless ($mac) { return; }
|
||||
$searchmacs{$mac} = $data;
|
||||
}
|
||||
###########################################
|
||||
# Get mac addresses
|
||||
###########################################
|
||||
sub get_mac_for_addr {
|
||||
my $neigh;
|
||||
my $addr = shift;
|
||||
if ($addr =~ /:/) {
|
||||
get_ipv6_neighbors();
|
||||
return $ip6neigh{$addr};
|
||||
} else {
|
||||
get_ipv4_neighbors();
|
||||
return $ip4neigh{$addr};
|
||||
}
|
||||
}
|
||||
|
||||
###########################################
|
||||
# Get ipv4 mac addresses
|
||||
###########################################
|
||||
sub get_ipv4_neighbors {
|
||||
if (xCAT::Utils->isAIX()) {
|
||||
my @ipdata = `arp -a`;
|
||||
%ip6neigh=();
|
||||
for my $entry (@ipdata) {
|
||||
if ($entry =~ /(\d+\.\d+\.\d+\.\d+)/) {
|
||||
my $ip = $1;
|
||||
#if ($entry =~ /at (\w+\:\w+\:\w+\:\w+\:\w+\:\w+)/) {
|
||||
# $ip4neigh{$ip}=$1;
|
||||
if ($entry =~ /at (\w+)\:(\w+)\:(\w+)\:(\w+)\:(\w+)\:(\w+)/) {
|
||||
#$ip4neigh{$ip}=$1.$2.$3.$4.$5.$6;
|
||||
$ip4neigh{$ip}=sprintf("%02s%02s%02s%02s%02s%02s",$1,$2,$3,$4,$5,$6);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#TODO: something less 'hacky'
|
||||
my @ipdata = `ip -4 neigh`;
|
||||
%ip6neigh=();
|
||||
foreach (@ipdata) {
|
||||
if (/^(\S*)\s.*lladdr\s*(\S*)\s/) {
|
||||
$ip4neigh{$1}=$2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
###########################################
|
||||
# Get ipv6 mac addresses
|
||||
###########################################
|
||||
sub get_ipv6_neighbors {
|
||||
#TODO: something less 'hacky'
|
||||
my @ipdata = `ip -6 neigh`;
|
||||
%ip6neigh=();
|
||||
foreach (@ipdata) {
|
||||
if (/^(\S*)\s.*lladdr\s*(\S*)\s/) {
|
||||
$ip6neigh{$1}=$2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
# Invokes the callback with the specified message
|
||||
##########################################################################
|
||||
sub send_message {
|
||||
|
||||
my $callback = shift;
|
||||
my $ecode = shift;
|
||||
my $msg = shift;
|
||||
my %output;
|
||||
|
||||
$output{errorcode} = $ecode;
|
||||
$output{data} = $msg;
|
||||
$callback->( \%output );
|
||||
}
|
||||
1;
|
||||
+118
-23
@@ -124,7 +124,7 @@ kvm_masterdata => {
|
||||
|
||||
|
||||
litetree => {
|
||||
cols => [qw(priority image directory comments disable)],
|
||||
cols => [qw(priority image directory mntopts comments disable)],
|
||||
keys => [qw(priority)],
|
||||
required => [qw(priority directory)],
|
||||
table_desc => 'Directory hierarchy to traverse to get the initial contents of node files. The files that are specified in the litefile table are searched for in the directories specified in this table.',
|
||||
@@ -132,6 +132,7 @@ litetree => {
|
||||
priority => 'This number controls what order the directories are searched. Directories are searched from smallest priority number to largest.',
|
||||
image => "The name of the image that will use this directory, as specified in the osimage table. If image is not supplied, the default is 'ALL'. 'ALL' means use it for all images.",
|
||||
directory => 'The location (hostname:path) of a directory that contains files specified in the litefile table. Variables are allowed. E.g: $noderes.nfsserver://xcatmasternode/install/$node/#CMD=uname-r#/',
|
||||
mntopts => "A comma-separated list of options to use when mounting the persistent directory. (Ex. 'soft') The default is to do a 'hard' mount.",
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
@@ -185,11 +186,12 @@ vmmaster => {
|
||||
}
|
||||
},
|
||||
vm => {
|
||||
cols => [qw(node host migrationdest storage storagemodel cfgstore memory cpus nics nicmodel bootorder clockoffset virtflags master vncport textconsole powerstate beacon datacenter guestostype othersettings vidmodel vidproto vidpassword comments disable)],
|
||||
cols => [qw(node mgr host migrationdest storage storagemodel cfgstore memory cpus nics nicmodel bootorder clockoffset virtflags master vncport textconsole powerstate beacon datacenter cluster guestostype othersettings vidmodel vidproto vidpassword comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_desc => 'Virtualization parameters',
|
||||
descriptions => {
|
||||
'node' => 'The node or static group name',
|
||||
'mgr' => 'The function manager for the virtual machine',
|
||||
'host' => 'The system that currently hosts the VM',
|
||||
'migrationdest' => 'A noderange representing candidate destinations for migration (i.e. similar systems, same SAN, or other criteria that xCAT can use',
|
||||
'storage' => 'A list of storage files or devices to be used. i.e. /cluster/vm/<nodename> or nfs://<server>/path/to/folder/',
|
||||
@@ -209,7 +211,8 @@ vm => {
|
||||
qcow2 is a sparse, copy-on-write capable format implemented at the virtualization layer rather than the filesystem level
|
||||
clonemethod=[qemu-img|reflink]
|
||||
qemu-img allows use of qcow2 to generate virtualization layer copy-on-write
|
||||
reflink uses a generic filesystem facility to clone the files on your behalf, but requires filesystem support such as btrfs ',
|
||||
reflink uses a generic filesystem facility to clone the files on your behalf, but requires filesystem support such as btrfs
|
||||
placement_affinity=[migratable|user_migratable|pinned]',
|
||||
'vncport' => 'Tracks the current VNC display port (currently not meant to be set',
|
||||
'textconsole' => 'Tracks the Psuedo-TTY that maps to the serial port or console of a VM',
|
||||
'powerstate' => "This flag is used by xCAT to track the last known power state of the VM.",
|
||||
@@ -217,19 +220,21 @@ vm => {
|
||||
'guestostype' => "This allows administrator to specify an identifier for OS to pass through to virtualization stack. Normally this should be ignored as xCAT will translate from nodetype.os rather than requiring this field be used\n",
|
||||
'beacon' => "This flag is used by xCAT to track the state of the identify LED with respect to the VM.",
|
||||
'datacenter' => "Optionally specify a datacenter for the VM to exist in (only applicable to VMWare)",
|
||||
'cluster' => 'Specify to the underlying virtualization infrastructure a cluster membership for the hypervisor.',
|
||||
'vidproto' => "Request a specific protocol for remote video access be set up. For example, spice in KVM.",
|
||||
'vidmodel' => "Model of video adapter to provide to guest. For example, qxl in KVM",
|
||||
'vidpassword' => "Password to use instead of temporary random tokens for VNC and SPICE access",
|
||||
}
|
||||
},
|
||||
hypervisor => {
|
||||
cols => [qw(node type mgr netmap defaultnet cluster datacenter preferdirect comments disable)],
|
||||
cols => [qw(node type mgr interface netmap defaultnet cluster datacenter preferdirect comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_desc => 'Hypervisor parameters',
|
||||
descriptions => {
|
||||
'node' => 'The node or static group name',
|
||||
'type' => 'The plugin associated with hypervisor specific commands such as revacuate',
|
||||
mgr => 'The virtualization specific manager of this hypervisor when applicable',
|
||||
'mgr' => 'The virtualization specific manager of this hypervisor when applicable',
|
||||
'interface' => 'The defition of interfaces for the hypervisor. The format is [networkname:interfacename:bootprotocol:IP:netmask:gateway] that split with | for each interface',
|
||||
'netmap' => 'Optional mapping of useful names to relevant physical ports. For example, 10ge=vmnic_16.0&vmnic_16.1,ge=vmnic1 would be requesting two virtual switches to be created, one called 10ge with vmnic_16.0 and vmnic_16.1 bonded, and another simply connected to vmnic1. Use of this allows abstracting guests from network differences amongst hypervisors',
|
||||
'defaultnet' => 'Optionally specify a default network entity for guests to join to if they do not specify.',
|
||||
'cluster' => 'Specify to the underlying virtualization infrastructure a cluster membership for the hypervisor.',
|
||||
@@ -237,6 +242,20 @@ hypervisor => {
|
||||
'preferdirect' => 'If a mgr is declared for a hypervisor, xCAT will default to using the mgr for all operations. If this is field is set to yes or 1, xCAT will prefer to directly communicate with the hypervisor if possible'
|
||||
}
|
||||
},
|
||||
virtsd => {
|
||||
cols => [qw(node sdtype stype location host cluster datacenter comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_desc => 'The parameters which used to create the Storage Domain',
|
||||
descriptions => {
|
||||
'node' => 'The name of the storage domain',
|
||||
'sdtype' => 'The type of storage domain. Valid values: data, iso, export',
|
||||
'stype' => 'The type of storge. Valid values: nfs, fcp, iscsi, localfs',
|
||||
'location' => 'The path of the storage',
|
||||
'host' => 'For rhev, a hypervisor host needs to be specified to manage the storage domain as SPM (Storage Pool Manager). But the SPM role will be failed over to another host when this host down.',
|
||||
'cluster' => 'A cluster of hosts',
|
||||
'datacenter' => 'A collection for all host, vm that will shared the same storages, networks.',
|
||||
}
|
||||
},
|
||||
websrv => {
|
||||
cols => [qw(node port username password comments disable)],
|
||||
keys => [qw(node)],
|
||||
@@ -323,10 +342,10 @@ deps => {
|
||||
hosts => {
|
||||
cols => [qw(node ip hostnames otherinterfaces comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_desc => 'IP address and hostnames of nodes. This info can be used to populate /etc/hosts or DNS.',
|
||||
table_desc => 'IP addresses and hostnames of nodes. This info is optional and is only used to populate /etc/hosts and DNS via makehosts and makedns. Using regular expressions in this table can be a quick way to populate /etc/hosts.',
|
||||
descriptions => {
|
||||
node => 'The node name or group name.',
|
||||
ip => 'The IP address of the node.',
|
||||
ip => 'The IP address of the node. This is only used in makehosts. The rest of xCAT uses system name resolution to resolve node names to IP addresses.',
|
||||
hostnames => 'Hostname aliases added to /etc/hosts for this node.',
|
||||
otherinterfaces => 'Other IP addresses to add for this node. Format: -<ext>:<ip>,<intfhostname>:<ip>,...',
|
||||
comments => 'Any user-written notes.',
|
||||
@@ -334,13 +353,15 @@ hosts => {
|
||||
},
|
||||
},
|
||||
ipmi => {
|
||||
cols => [qw(node bmc bmcport username password comments disable )],
|
||||
cols => [qw(node bmc bmcport taggedvlan bmcid username password comments disable )],
|
||||
keys => [qw(node)],
|
||||
table_desc => 'Settings for nodes that are controlled by an on-board BMC via IPMI.',
|
||||
descriptions => {
|
||||
node => 'The node name or group name.',
|
||||
bmc => 'The hostname of the BMC adapater.',
|
||||
bmcport => 'In systems with selectable shared/dedicated ethernet ports, this parameter can be used to specify the preferred port. 0 means use the shared port, 1 means dedicated, blank is to not assign',
|
||||
taggedvlan => 'Have bmcsetup place the BMC on the specified vlan tag on a shared netwirk interface. Some network devices may be incompatible with this option',
|
||||
bmcid => 'Unique identified data used by discovery processes to distinguish known BMCs from unrecognized BMCs',
|
||||
username => 'The BMC userid. If not specified, the key=ipmi row in the passwd table is used as the default.',
|
||||
password => 'The BMC password. If not specified, the key=ipmi row in the passwd table is used as the default.',
|
||||
comments => 'Any user-written notes.',
|
||||
@@ -421,7 +442,7 @@ mp => {
|
||||
},
|
||||
mpa => {
|
||||
cols => [qw(mpa username password comments disable)],
|
||||
keys => [qw(mpa username)],
|
||||
keys => [qw(mpa username)],
|
||||
nodecol => "mpa",
|
||||
table_desc => 'Contains info about each Management Module and how to access it.',
|
||||
descriptions => {
|
||||
@@ -533,7 +554,7 @@ noderes => {
|
||||
node => 'The node name or group name.',
|
||||
servicenode => 'A comma separated list of node names (as known by the management node) that provides most services for this node. The first service node on the list that is accessible will be used. The 2nd node on the list is generally considered to be the backup service node for this node when running commands like snmove.',
|
||||
netboot => 'The type of network booting to use for this node. Valid values: pxe or xnba for x86* architecture, yaboot for POWER architecture.',
|
||||
tftpserver => 'The TFTP server for this node (as known by this node).',
|
||||
tftpserver => 'The TFTP server for this node (as known by this node). If not set, it defaults to networks.tftpserver.',
|
||||
tftpdir => 'The directory that roots this nodes contents from a tftp and related perspective. Used for NAS offload by using different mountpoints.',
|
||||
nfsserver => 'The NFS or HTTP server for this node (as known by this node).',
|
||||
monserver => 'The monitoring aggregation point for this node. The format is "x,y" where x is the ip address as known by the management node and y is the ip address as known by the node.',
|
||||
@@ -633,7 +654,7 @@ linuximage => {
|
||||
otherpkglist => 'The fully qualified name of the file that stores non-distro package lists that will be included in the image.',
|
||||
otherpkgdir => 'The base directory where the non-distro packages are stored.',
|
||||
exlist => 'The fully qualified name of the file that stores the file names and directory names that will be excluded from the image during packimage command. It is used for diskless image only.',
|
||||
postinstall => 'The fully qualified name of the script file that will be run at the end of the packimage command. It is used for diskless image only.',
|
||||
postinstall => 'The fully qualified name of the script file that will be run at the end of the genimage command. It is used for diskless image only.',
|
||||
rootimgdir => 'The directory name where the image is stored. It is used for diskless image only.',
|
||||
kerneldir => 'The directory name where the 3rd-party kernel is stored. It is used for diskless image only.',
|
||||
nodebootif => 'The network interface the stateless/statelite node will boot over (e.g. eth0)',
|
||||
@@ -792,6 +813,7 @@ site => {
|
||||
" specify different NICs for different nodes:\n".
|
||||
" mn|eth1,eth2;service|bond0.\n\n".
|
||||
" dhcpsetup: If set to 'n', it will skip the dhcp setup process in the nodeset cmd.\n\n".
|
||||
" dhcplease: The lease time for the dhcp client. The default value is 43200.\n\n".
|
||||
" disjointdhcps: If set to '1', the .leases file on a service node only contains\n".
|
||||
" the nodes it manages. The default value is '0'.\n".
|
||||
" '0' value means include all the nodes in the subnet.\n\n".
|
||||
@@ -826,6 +848,9 @@ site => {
|
||||
" match the path in the installdir attribute.\n\n".
|
||||
" ipmidispatch: Whether or not to send ipmi hw control operations to the service\n".
|
||||
" node of the target compute nodes. Default is 'y'.\n\n".
|
||||
" hwctrldispatch: Whether or not to send hw control operations to the service\n".
|
||||
" node of the target nodes. Default is 'y'.(At present, this attribute\n".
|
||||
" only be used for IBM Flex System)\n\n".
|
||||
" ipmimaxp: The max # of processes for ipmi hw ctrl. The default is 64. Currently,\n".
|
||||
" this is only used for HP hw control.\n\n".
|
||||
" ipmiretries: The # of retries to use when communicating with BMCs. Default is 3.\n\n".
|
||||
@@ -857,22 +882,26 @@ site => {
|
||||
" the node deployment, node discovery and power operations.\n\n".
|
||||
" ntpservers: A comma delimited list of NTP servers for the cluster - often the\n".
|
||||
" xCAT management node.\n\n".
|
||||
" syspowerinterval: The number of seconds the rpower command to servers will wait\n".
|
||||
" between performing the action for each server. Currently supported\n".
|
||||
" for system p CECs and system x IPMI servers. This is used for\n".
|
||||
" controlling the power on speed in large clusters. Default is 0.\n\n".
|
||||
" syspowerinterval: For system p CECs, this is the number of seconds the rpower\n".
|
||||
" command will wait between performing the action for each CEC.\n".
|
||||
" For system x IPMI servers, this is the number of seconds the\n".
|
||||
" rpower command will wait between powering on <syspowermaxnodes>\n".
|
||||
" nodes at a time. This value is used to control the power on speed\n".
|
||||
" in large clusters. Default is 0.\n\n".
|
||||
" syspowermaxnodes: The number of servers to power on at one time before waiting\n".
|
||||
" 'syspowerinterval' seconds to continue on to the next set of\n".
|
||||
" nodes. Currently only used for IPMI servers and must be set if\n".
|
||||
" 'syspowerinterval' is set.\n\n".
|
||||
" nodes. If the noderange given to rpower includes nodes served\n".
|
||||
" by different service nodes, it will try to spread each set of\n".
|
||||
" nodes across the service nodes evenly. Currently only used for\n".
|
||||
" IPMI servers and must be set if 'syspowerinterval' is set.\n\n".
|
||||
" powerinterval: The number of seconds the rpower command to LPARs will wait between\n".
|
||||
" performing the action for each LPAR. LPARs of different HCPs\n".
|
||||
" (HMCs or FSPs) are done in parallel. This is used to limit the\n".
|
||||
" cluster boot up speed in large clusters. Default is 0. This is\n".
|
||||
" currently only used for system p hardware.\n\n".
|
||||
" ppcmaxp: The max # of processes for PPC hw ctrl. If there are more than ppcmaxp hcps,\n".
|
||||
" this parameter will take effect. It will control the max number of processes \n".
|
||||
" for PPC hardware control commands. Default is 64.\n\n".
|
||||
" ppcmaxp: The max # of processes for PPC hw ctrl. If there are more than ppcmaxp\n".
|
||||
" hcps, this parameter will take effect. It will control the max number of\n".
|
||||
" processes for PPC hardware control commands. Default is 64.\n\n".
|
||||
" ppcretry: The max # of PPC hw connection attempts to HMC before failing.\n".
|
||||
" It only takes effect on the hardware control commands through HMC. \n".
|
||||
" Default is 3.\n\n".
|
||||
@@ -908,6 +937,8 @@ site => {
|
||||
" mgmt node.\n\n".
|
||||
" timezone: (e.g. America/New_York)\n\n".
|
||||
" tftpdir: tftp directory path. Default is /tftpboot\n\n".
|
||||
" tftpflags: The flags that used to start tftpd. Default is \'-v -l -s /tftpboot \n".
|
||||
" -m /etc/tftpmapfile4xcat.conf\' if tftplfags is not set\n\n".
|
||||
" useNmapfromMN: When set to yes, nodestat command should obtain the node status\n".
|
||||
" using nmap (if available) from the management node instead of the\n".
|
||||
" service node. This will improve the performance in a flat network.\n\n".
|
||||
@@ -944,8 +975,8 @@ switch => {
|
||||
node => 'The node name or group name.',
|
||||
switch => 'The switch hostname.',
|
||||
port => 'The port number in the switch that this node is connected to. On a simple 1U switch, an administrator can generally enter the number as printed next to the ports, and xCAT will understand switch representation differences. On stacked switches or switches with line cards, administrators should usually use the CLI representation (i.e. 2/0/1 or 5/8). One notable exception is stacked SMC 8848M switches, in which you must add 56 for the proceeding switch, then the port number. For example, port 3 on the second switch in an SMC8848M stack would be 59',
|
||||
vlan => 'xCAT currently does not make use of this field, however it may do so in the future. For now, it can be used by administrators for their own purposes, but keep in mind some xCAT feature later may try to enforce this if set',
|
||||
interface => 'The interface name from the node perspective. This is not currently used by xCAT, but administrators may wish to use this for their own purposes',
|
||||
vlan => 'The ID for the tagged vlan that is created on this port using mkvlan and chvlan commands.',
|
||||
interface => 'The interface name from the node perspective. For example, eth0. For the primary nic, it can be empty, the word "primary" or "primary:ethx" where ethx is the interface name.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
@@ -966,7 +997,7 @@ vpd => {
|
||||
},
|
||||
},
|
||||
nimimage => {
|
||||
cols => [qw(imagename nimtype lpp_source spot root dump paging resolv_conf tmp home shared_home res_group nimmethod script bosinst_data installp_bundle mksysb fb_script shared_root otherpkgs image_data comments disable)],
|
||||
cols => [qw(imagename nimtype lpp_source spot root dump paging resolv_conf tmp home shared_home res_group nimmethod script bosinst_data installp_bundle mksysb fb_script shared_root otherpkgs image_data configdump comments disable)],
|
||||
keys => [qw(imagename)],
|
||||
table_desc => 'All the info that specifies a particular AIX operating system image that can be used to deploy AIX nodes.',
|
||||
descriptions => {
|
||||
@@ -991,6 +1022,7 @@ nimimage => {
|
||||
mksysb => 'The name of a NIM mksysb resource.',
|
||||
shared_root => 'A shared_root resource represents a directory that can be used as a / (root) directory by one or more diskless clients.',
|
||||
image_data => 'The name of a NIM image_data resource.',
|
||||
configdump => 'Specifies the type of system dump to be collected. The values are selective, full, and none. The default is selective.',
|
||||
comments => 'Any user-provided notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
@@ -1741,6 +1773,12 @@ my @nodeattrs = (
|
||||
tabentry => 'mp.id',
|
||||
access_tabentry => 'mp.node=attr:node',
|
||||
},
|
||||
{attr_name => 'id',
|
||||
only_if => 'mgt=ipmi',
|
||||
tabentry => 'mp.id',
|
||||
access_tabentry => 'mp.node=attr:node',
|
||||
},
|
||||
|
||||
#################
|
||||
# mpa table #
|
||||
#################
|
||||
@@ -1781,6 +1819,10 @@ my @nodeattrs = (
|
||||
######################
|
||||
# vm table #
|
||||
######################
|
||||
{attr_name => 'vmmanager',
|
||||
tabentry => 'vm.mgr',
|
||||
access_tabentry => 'vm.node=attr:node',
|
||||
},
|
||||
{attr_name => 'vmhost',
|
||||
tabentry => 'vm.host',
|
||||
access_tabentry => 'vm.node=attr:node',
|
||||
@@ -1825,6 +1867,10 @@ my @nodeattrs = (
|
||||
tabentry => 'vm.virtflags',
|
||||
access_tabentry => 'vm.node=attr:node',
|
||||
},
|
||||
{attr_name => 'vmmaster',
|
||||
tabentry => 'vm.master',
|
||||
access_tabentry => 'vm.node=attr:node',
|
||||
},
|
||||
{attr_name => 'vmvncport',
|
||||
tabentry => 'vm.vncport',
|
||||
access_tabentry => 'vm.node=attr:node',
|
||||
@@ -1837,6 +1883,29 @@ my @nodeattrs = (
|
||||
tabentry => 'vm.beacon',
|
||||
access_tabentry => 'vm.node=attr:node',
|
||||
},
|
||||
{attr_name => 'vmcluster',
|
||||
tabentry => 'vm.cluster',
|
||||
access_tabentry => 'vm.node=attr:node',
|
||||
},
|
||||
######################
|
||||
# hypervisor table #
|
||||
######################
|
||||
{attr_name => 'hosttype',
|
||||
tabentry => 'hypervisor.type',
|
||||
access_tabentry => 'hypervisor.node=attr:node',
|
||||
},
|
||||
{attr_name => 'hostinterface',
|
||||
tabentry => 'hypervisor.interface',
|
||||
access_tabentry => 'hypervisor.node=attr:node',
|
||||
},
|
||||
{attr_name => 'hostmanager',
|
||||
tabentry => 'hypervisor.mgr',
|
||||
access_tabentry => 'hypervisor.node=attr:node',
|
||||
},
|
||||
{attr_name => 'hostcluster',
|
||||
tabentry => 'hypervisor.cluster',
|
||||
access_tabentry => 'hypervisor.node=attr:node',
|
||||
},
|
||||
######################
|
||||
# websrv table #
|
||||
######################
|
||||
@@ -2092,6 +2161,11 @@ push(@{$defspec{node}->{'attrs'}}, @nodeattrs);
|
||||
tabentry => 'linuximage.crashkernelsize',
|
||||
access_tabentry => 'linuximage.imagename=attr:imagename',
|
||||
},
|
||||
{attr_name => 'usercomment',
|
||||
only_if => 'imagetype=linux',
|
||||
tabentry => 'linuximage.comments',
|
||||
access_tabentry => 'linuximage.imagename=attr:imagename',
|
||||
},
|
||||
####################
|
||||
# nimimage table#
|
||||
####################
|
||||
@@ -2125,6 +2199,11 @@ push(@{$defspec{node}->{'attrs'}}, @nodeattrs);
|
||||
tabentry => 'nimimage.dump',
|
||||
access_tabentry => 'nimimage.imagename=attr:imagename',
|
||||
},
|
||||
{attr_name => 'configdump',
|
||||
only_if => 'imagetype=NIM',
|
||||
tabentry => 'nimimage.configdump',
|
||||
access_tabentry => 'nimimage.imagename=attr:imagename',
|
||||
},
|
||||
{attr_name => 'paging',
|
||||
only_if => 'imagetype=NIM',
|
||||
tabentry => 'nimimage.paging',
|
||||
@@ -2242,10 +2321,26 @@ push(@{$defspec{node}->{'attrs'}}, @nodeattrs);
|
||||
{attr_name => 'nameservers',
|
||||
tabentry => 'networks.nameservers',
|
||||
access_tabentry => 'networks.netname=attr:netname',
|
||||
},
|
||||
{attr_name => 'ntpservers',
|
||||
tabentry => 'networks.ntpservers',
|
||||
access_tabentry => 'networks.netname=attr:netname',
|
||||
},
|
||||
{attr_name => 'logservers',
|
||||
tabentry => 'networks.logservers',
|
||||
access_tabentry => 'networks.netname=attr:netname',
|
||||
},
|
||||
{attr_name => 'dynamicrange',
|
||||
tabentry => 'networks.dynamicrange',
|
||||
access_tabentry => 'networks.netname=attr:netname',
|
||||
},
|
||||
{attr_name => 'nodehostname',
|
||||
tabentry => 'networks.nodehostname',
|
||||
access_tabentry => 'networks.netname=attr:netname',
|
||||
},
|
||||
{attr_name => 'ddnsdomain',
|
||||
tabentry => 'networks.ddnsdomain',
|
||||
access_tabentry => 'networks.netname=attr:netname',
|
||||
},
|
||||
{attr_name => 'vlanid',
|
||||
tabentry => 'networks.vlanid',
|
||||
|
||||
+128
-56
@@ -57,6 +57,7 @@ if ($^O =~ /^aix/i) {
|
||||
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
my $cachethreshold=16; #How many nodes in 'getNodesAttribs' before switching to full DB retrieval
|
||||
#TODO: dynamic tracking/adjustment, the point where cache is cost effective differs based on overall db size
|
||||
|
||||
use DBI;
|
||||
$DBI::dbi_debug=9; # increase the debug output
|
||||
@@ -203,6 +204,8 @@ sub init_dbworker {
|
||||
eval { #avoid hang by allowin client to die too
|
||||
print $currcon "*XCATBUGDETECTED*:$err:*XCATBUGDETECTED*\n";
|
||||
print $currcon "*XCATBUGDETECTED*76e9b54341\n";
|
||||
$clientset->remove($currcon);
|
||||
close($currcon);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -296,7 +299,11 @@ sub handle_dbc_request {
|
||||
$opentables{$tablename}->{$autocommit} = xCAT::Table->new(@args);
|
||||
}
|
||||
if ($opentables{$tablename}->{$autocommit}) {
|
||||
return 1;
|
||||
if ($opentables{$tablename}->{$autocommit^1}) {
|
||||
$opentables{$tablename}->{$autocommit}->{cachepeer}=$opentables{$tablename}->{$autocommit^1};
|
||||
$opentables{$tablename}->{$autocommit^1}->{cachepeer}=$opentables{$tablename}->{$autocommit};
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
@@ -309,6 +316,10 @@ sub handle_dbc_request {
|
||||
unless ($opentables{$tablename}->{$autocommit}) {
|
||||
return undef;
|
||||
}
|
||||
if ($opentables{$tablename}->{$autocommit^1}) {
|
||||
$opentables{$tablename}->{$autocommit}->{cachepeer}=$opentables{$tablename}->{$autocommit^1};
|
||||
$opentables{$tablename}->{$autocommit^1}->{cachepeer}=$opentables{$tablename}->{$autocommit};
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($functionname eq 'getAllAttribs') {
|
||||
@@ -736,6 +747,10 @@ sub new
|
||||
return undef;
|
||||
}
|
||||
} else { #direct db access mode
|
||||
if ($opentables{$self->{tabname}}->{$self->{autocommit}}) { #if we are inside the db worker and asked to create a new table that is already open, just return a reference to that table
|
||||
#generally speaking, this should cause a lot of nodelists to be shared
|
||||
return $opentables{$self->{tabname}}->{$self->{autocommit}};
|
||||
}
|
||||
$self->{dbuser}="";
|
||||
$self->{dbpass}="";
|
||||
|
||||
@@ -2043,6 +2058,7 @@ sub getNodesAttribs {
|
||||
return dbc_call($self,'getNodesAttribs',@_);
|
||||
}
|
||||
my $nodelist = shift;
|
||||
unless ($nodelist) { $nodelist = []; } #common to be invoked with undef seemingly
|
||||
my %options=();
|
||||
my @attribs;
|
||||
if (ref $_[0]) {
|
||||
@@ -2051,7 +2067,9 @@ sub getNodesAttribs {
|
||||
} else {
|
||||
@attribs = @_;
|
||||
}
|
||||
if (scalar($nodelist) > $cachethreshold) {
|
||||
my @realattribs = @attribs; #store off the requester attribute list, the cached columns may end up being a superset and we shouldn't return more than asked
|
||||
#it should also be the case that cache will be used if it already is in play even if below cache threshold. This would be desired behavior
|
||||
if (scalar(@$nodelist) > $cachethreshold) {
|
||||
$self->{_use_cache} = 0;
|
||||
$self->{nodelist}->{_use_cache}=0;
|
||||
if ($self->{tabname} eq 'nodelist') { #a sticky situation
|
||||
@@ -2072,7 +2090,7 @@ sub getNodesAttribs {
|
||||
}
|
||||
my $rethash;
|
||||
foreach (@$nodelist) {
|
||||
my @nodeentries=$self->getNodeAttribs($_,\@attribs,%options);
|
||||
my @nodeentries=$self->getNodeAttribs($_,\@realattribs,%options);
|
||||
$rethash->{$_} = \@nodeentries; #$self->getNodeAttribs($_,\@attribs);
|
||||
}
|
||||
$self->_clear_cache;
|
||||
@@ -2086,6 +2104,7 @@ sub getNodesAttribs {
|
||||
|
||||
sub _refresh_cache { #if cache exists, force a rebuild, leaving reference counts alone
|
||||
my $self = shift; #dbworker check not currently required
|
||||
if ($self->{cachepeer}->{_cachestamp}) { $self->{cachepeer}->{_cachestamp}=0; }
|
||||
if ($self->{_use_cache}) { #only do things if cache is set up
|
||||
$self->_build_cache(1); #for now, rebuild the whole thing.
|
||||
#in the future, a faster cache update may be possible
|
||||
@@ -2098,6 +2117,8 @@ sub _refresh_cache { #if cache exists, force a rebuild, leaving reference counts
|
||||
# (uses stale nodelist data and misses new nodes, the error)
|
||||
#1st noderange finishes
|
||||
#2nd noderange finishes
|
||||
} else { #even if a cache is not in use *right this second*, we need to mark any cached data that may exist as invalid, do so by suggesting the cache is from 1970
|
||||
if ($self->{_cachestamp}) { $self->{_cachestamp}=0; }
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2113,7 +2134,8 @@ sub _clear_cache { #PRIVATE FUNCTION TO EXPIRE CACHED DATA EXPLICITLY
|
||||
$self->{_cache_ref} -= 1;
|
||||
return;
|
||||
} elsif ($self->{_cache_ref} == 1) { #If it is 1, decrement to zero and carry on
|
||||
$self->{_cache_ref} = 0;
|
||||
return;
|
||||
#$self->{_cache_ref} = 0;
|
||||
}
|
||||
#it shouldn't have been zero, but whether it was 0 or 1, ensure that the cache is gone
|
||||
$self->{_use_cache}=0; # Signal slow operation to any in-flight operations that may fail with empty cache
|
||||
@@ -2130,6 +2152,7 @@ sub _build_cache { #PRIVATE FUNCTION, PLEASE DON'T CALL DIRECTLY
|
||||
return dbc_call($self,'_build_cache',@_);
|
||||
}
|
||||
my $attriblist = shift;
|
||||
my %copts = @_;
|
||||
my $refresh = not ref $attriblist; #if attriblist is not a reference, it is a refresh request
|
||||
if (not ref $attriblist) {
|
||||
$attriblist = $self->{_cached_attriblist}; #need attriblist to mean something, don't know how this didn't break horribly already
|
||||
@@ -2137,7 +2160,9 @@ sub _build_cache { #PRIVATE FUNCTION, PLEASE DON'T CALL DIRECTLY
|
||||
|
||||
if (not $refresh and $self->{_cache_ref}) { #we have active cache reference, increment counter and return
|
||||
#TODO: ensure that the cache isn't somehow still ludirously old
|
||||
$self->{_cache_ref} += 1;
|
||||
unless ($copts{noincrementref}) {
|
||||
$self->{_cache_ref} += 1;
|
||||
}
|
||||
my $currattr;
|
||||
my $cachesufficient=1;
|
||||
foreach $currattr (@$attriblist) { #if any of the requested attributes are not cached, we must rebuild
|
||||
@@ -2146,6 +2171,9 @@ sub _build_cache { #PRIVATE FUNCTION, PLEASE DON'T CALL DIRECTLY
|
||||
last;
|
||||
}
|
||||
}
|
||||
if ($self->{_cachestamp} < (time()-5)) { #NEVER use a cache older than 5 seconds
|
||||
$cachesufficient=0;
|
||||
}
|
||||
if ($cachesufficient) { return; }
|
||||
#cache is insufficient, now we must do the converse of above
|
||||
#must add any currently cached columns to new list if not requested
|
||||
@@ -2223,7 +2251,9 @@ $evalcpt->permit('require');
|
||||
sub getNodeAttribs
|
||||
{
|
||||
my $self = shift;
|
||||
if ($dbworkerpid) {
|
||||
if ($dbworkerpid) { #TODO: should this be moved outside of the DB worker entirely? I'm thinking so, but I don't dare do so right now...
|
||||
#the benefit would be the potentially computationally intensive substitution logic would be moved out and less time inside limited
|
||||
#db worker scope
|
||||
return dbc_call($self,'getNodeAttribs',@_);
|
||||
}
|
||||
my $node = shift;
|
||||
@@ -2236,7 +2266,33 @@ sub getNodeAttribs
|
||||
@attribs = @_;
|
||||
}
|
||||
my $datum;
|
||||
my $oldusecache;
|
||||
my $nloldusecache;
|
||||
if ($options{prefetchcache}) { #TODO: If this *were* split out of DB worker, this logic would have to move *into* returnany
|
||||
if ($self->{tabname} eq 'nodelist') { #a sticky situation
|
||||
my @locattribs=@attribs;
|
||||
unless (grep(/^node$/,@locattribs)) {
|
||||
push @locattribs,'node';
|
||||
}
|
||||
unless (grep(/^groups$/,@locattribs)) {
|
||||
push @locattribs,'groups';
|
||||
}
|
||||
$self->_build_cache(\@locattribs,noincrementref=>1);
|
||||
} else {
|
||||
$self->_build_cache(\@attribs,noincrementref=>1);
|
||||
$self->{nodelist}->_build_cache(['node','groups'],noincrementref=>1);
|
||||
}
|
||||
$oldusecache=$self->{_use_cache};
|
||||
$nloldusecache=$self->{nodelist}->{_use_cache};
|
||||
$self->{_use_cache}=1;
|
||||
$self->{nodelist}->{_use_cache}=1;
|
||||
}
|
||||
my @data = $self->getNodeAttribs_nosub_returnany($node, \@attribs,%options);
|
||||
if ($options{prefetchcache}) {
|
||||
$self->{_use_cache}=$oldusecache;
|
||||
$self->{nodelist}->{_use_cache}=$nloldusecache;
|
||||
#in this case, we just let the cache live, even if it is to be ignored by most invocations
|
||||
}
|
||||
#my ($datum, $extra) = $self->getNodeAttribs_nosub($node, \@attribs);
|
||||
#if ($extra) { return undef; } # return (undef,"Ambiguous query"); }
|
||||
defined($data[0])
|
||||
@@ -2258,8 +2314,9 @@ sub getNodeAttribs
|
||||
my $exp = substr($datum->{$attrib}, 1);
|
||||
chop $exp;
|
||||
my @parts = split('/', $exp, 2);
|
||||
$node =~ s/$parts[0]/$parts[1]/;
|
||||
$datum->{$attrib} = $node;
|
||||
my $retval = $node;
|
||||
$retval =~ s/$parts[0]/$parts[1]/;
|
||||
$datum->{$attrib} = $retval;
|
||||
}
|
||||
elsif ($datum->{$attrib} =~ /^\|.*\|.*\|$/)
|
||||
{
|
||||
@@ -2340,51 +2397,51 @@ sub getNodeAttribs
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
sub getNodeSpecAttribs {
|
||||
my $self = shift;
|
||||
my $node = shift;
|
||||
my %options = ();
|
||||
my @attribs = ();
|
||||
my @keys = ();
|
||||
if (ref $_[0] eq 'HASH') {
|
||||
%options = %{shift()};
|
||||
@attribs = @_;
|
||||
foreach my $key (keys %options) {
|
||||
if (!grep(/^$key$/, @attribs)) {
|
||||
push @attribs, $key;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@attribs = @_;
|
||||
}
|
||||
if ((keys (%options)) == 0) {
|
||||
my $ent = $self->getNodeAttribs($node, \@attribs);
|
||||
return $ent;
|
||||
} else {
|
||||
my $nodekey = "node";
|
||||
if (defined $xCAT::Schema::tabspec{$self->{tabname}}->{nodecol}) {
|
||||
$nodekey = $xCAT::Schema::tabspec{$self->{tabname}}->{nodecol};
|
||||
}
|
||||
$options{$nodekey} = $node;
|
||||
my $ent = $self->getAttribs(\%options, \@attribs);
|
||||
if ($ent) {
|
||||
return $ent;
|
||||
}
|
||||
my ($nodeghash) = $self->{nodelist}->getAttribs({node=>$node}, "groups");
|
||||
unless(defined($nodeghash) && defined($nodeghash->{groups})) {
|
||||
return undef;
|
||||
}
|
||||
my @nodegroups = split(/,/, $nodeghash->{groups});
|
||||
foreach my $group (@nodegroups) {
|
||||
$options{$nodekey} = $group;
|
||||
my $g_ret = $self->getAttribs(\%options, \@attribs);
|
||||
if ($g_ret) {
|
||||
return $g_ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
#sub getNodeSpecAttribs {
|
||||
# my $self = shift;
|
||||
# my $node = shift;
|
||||
# my %options = ();
|
||||
# my @attribs = ();
|
||||
# my @keys = ();
|
||||
# if (ref $_[0] eq 'HASH') {
|
||||
# %options = %{shift()};
|
||||
# @attribs = @_;
|
||||
# foreach my $key (keys %options) {
|
||||
# if (!grep(/^$key$/, @attribs)) {
|
||||
# push @attribs, $key;
|
||||
# }
|
||||
# }
|
||||
# } else {
|
||||
# @attribs = @_;
|
||||
# }
|
||||
# if ((keys (%options)) == 0) {
|
||||
# my $ent = $self->getNodeAttribs($node, \@attribs);
|
||||
# return $ent;
|
||||
# } else {
|
||||
# my $nodekey = "node";
|
||||
# if (defined $xCAT::Schema::tabspec{$self->{tabname}}->{nodecol}) {
|
||||
# $nodekey = $xCAT::Schema::tabspec{$self->{tabname}}->{nodecol};
|
||||
# }
|
||||
# $options{$nodekey} = $node;
|
||||
# my $ent = $self->getAttribs(\%options, \@attribs);
|
||||
# if ($ent) {
|
||||
# return $ent;
|
||||
# }
|
||||
# my ($nodeghash) = $self->{nodelist}->getAttribs({node=>$node}, "groups");
|
||||
# unless(defined($nodeghash) && defined($nodeghash->{groups})) {
|
||||
# return undef;
|
||||
# }
|
||||
# my @nodegroups = split(/,/, $nodeghash->{groups});
|
||||
# foreach my $group (@nodegroups) {
|
||||
# $options{$nodekey} = $group;
|
||||
# my $g_ret = $self->getAttribs(\%options, \@attribs);
|
||||
# if ($g_ret) {
|
||||
# return $g_ret;
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# return undef;
|
||||
#}
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
=head3 getNodeAttribs_nosub
|
||||
@@ -2897,6 +2954,7 @@ sub getAllNodeAttribs
|
||||
}
|
||||
my $attribq = shift;
|
||||
my $hashretstyle = shift;
|
||||
my %options=@_;
|
||||
my $rethash;
|
||||
my @results = ();
|
||||
my %donenodes
|
||||
@@ -2915,10 +2973,12 @@ sub getAllNodeAttribs
|
||||
$query = $self->{dbh}->prepare($qstring);
|
||||
$query->execute();
|
||||
xCAT::NodeRange::retain_cache(1);
|
||||
unless ($options{prefetchcache}) {
|
||||
$self->{_use_cache} = 0;
|
||||
$self->{nodelist}->{_use_cache}=0;
|
||||
$self->_clear_cache();
|
||||
$self->{nodelist}->_clear_cache();
|
||||
}
|
||||
$self->_build_cache($attribq);
|
||||
$self->{nodelist}->_build_cache(['node','groups']);
|
||||
$self->{_use_cache} = 1;
|
||||
@@ -2928,9 +2988,14 @@ sub getAllNodeAttribs
|
||||
|
||||
unless ($data->{$nodekey} =~ /^$/ || !defined($data->{$nodekey}))
|
||||
{ #ignore records without node attrib, not possible?
|
||||
my @nodes =
|
||||
xCAT::NodeRange::noderange($data->{$nodekey})
|
||||
; #expand node entry, to make groups expand
|
||||
|
||||
my @nodes;
|
||||
unless ($self->{nrcache}->{$data->{$nodekey}} and (($self->{nrcache}->{$data->{$nodekey}}->{tstamp} + 5) > time())) {
|
||||
my @cnodes = xCAT::NodeRange::noderange($data->{$nodekey});
|
||||
$self->{nrcache}->{$data->{$nodekey}}->{value} = \@cnodes;
|
||||
$self->{nrcache}->{$data->{$nodekey}}->{tstamp} = time();
|
||||
}
|
||||
@nodes = @{$self->{nrcache}->{$data->{$nodekey}}->{value}}; #expand node entry, to make groups expand
|
||||
unless (@nodes) { #in the event of an entry not in nodelist, use entry value verbatim
|
||||
@nodes = ($data->{$nodekey});
|
||||
}
|
||||
@@ -3017,6 +3082,9 @@ sub getAllAttribs
|
||||
my @attribs = @_;
|
||||
my @results = ();
|
||||
if ($self->{_use_cache}) {
|
||||
if ($self->{_cachestamp} < (time()-5)) { #NEVER use a cache older than 5 seconds
|
||||
$self->_refresh_cache();
|
||||
}
|
||||
my @results;
|
||||
my $cacheline;
|
||||
CACHELINE: foreach $cacheline (@{$self->{_tablecache}}) {
|
||||
@@ -3185,6 +3253,7 @@ sub delEntries
|
||||
$stmt->execute(@stargs);
|
||||
$stmt->finish;
|
||||
|
||||
$self->_refresh_cache(); #cache is invalid, refresh
|
||||
#notify the interested parties
|
||||
if ($notif == 1)
|
||||
{
|
||||
@@ -3243,6 +3312,9 @@ sub getAttribs
|
||||
}
|
||||
my @return;
|
||||
if ($self->{_use_cache}) {
|
||||
if ($self->{_cachestamp} < (time()-5)) { #NEVER use a cache older than 5 seconds
|
||||
$self->_refresh_cache();
|
||||
}
|
||||
my @results;
|
||||
my $cacheline;
|
||||
if (scalar(keys %keypairs) == 1 and $keypairs{node}) { #99.9% of queries look like this, optimized case
|
||||
|
||||
+60
-15
@@ -36,7 +36,7 @@ my %usage = (
|
||||
LPAR(using Direct FSP Management) specific:
|
||||
rpower <noderange> [on|off|reset|stat|state|boot|of|sms]
|
||||
Blade(using Direct FSP Management) specific:
|
||||
rpower <noderange> [on|off|cycle|state]
|
||||
rpower <noderange> [on|onstandby|off|cycle|state|sms]
|
||||
Blade(using AMM) specific:
|
||||
rpower <noderange> [cycle|softoff] [-V|--verbose]
|
||||
zVM specific:
|
||||
@@ -78,6 +78,8 @@ my %usage = (
|
||||
rinv <noderange> [deconfig [-x]]
|
||||
Blade specific:
|
||||
rinv <noderange> [mtm|serial|mac|bios|diag|mprom|mparom|firm|all]
|
||||
IBM Flex System Compute Node specific:
|
||||
rinv <noderange> [firm]
|
||||
VMware specific:
|
||||
rinv <noderange>
|
||||
zVM specific:
|
||||
@@ -114,7 +116,6 @@ my %usage = (
|
||||
rspconfig <singlenode> [textid=name]
|
||||
rspconfig <singlenode> [frame=number]
|
||||
rspconfig <singlenode> [USERID=passwd]
|
||||
rspconfig <singlenode> [HMC=passwd]
|
||||
rspconfig <noderange> [sshcfg=<enable|disable>|
|
||||
snmpcfg=<enable|disable>|
|
||||
pd1=<nonred|redwoperf|redwperf>|
|
||||
@@ -184,9 +185,9 @@ my %usage = (
|
||||
PPC specific:
|
||||
getmacs <noderange> [-F filter]
|
||||
getmacs <noderange> [-M]
|
||||
getmacs <noderange> [-V| --verbose] [-f] [-d] [--arp] | [-D [-S server] [-G gateway] [-C client]]
|
||||
getmacs <noderange> [-V| --verbose] [-f] [-d] [--arp] | [-D [-o] [-S server] [-G gateway] [-C client]]
|
||||
blade specific:
|
||||
getmacs <noderange> [-V| --verbose] [-d] [--arp]
|
||||
getmacs <noderange> [-V| --verbose] [-d] [--arp] [-i ethN|enN]
|
||||
",
|
||||
"mkvm" =>
|
||||
"Usage:
|
||||
@@ -260,9 +261,8 @@ my %usage = (
|
||||
rmvm [-p] [-f]",
|
||||
"lsslp" =>
|
||||
"Usage: lsslp [-h|--help|-v|--version]
|
||||
lsslp [<noderange>][-V|--verbose][-i ip[,ip..]][-w][-r|-x|-z][-n][-I][-s FRAME|CEC|MM|IVM|RSA|HMC|CMM][-C counts][-T timeout]
|
||||
[-t tries][-m][-e cmd][-c [timeinterval[interval,..]]][--vpdtable]
|
||||
[-M vpd|switchport][--makedhcp][--updatehost][--resetnet]",
|
||||
lsslp [<noderange>][-V|--verbose][-i ip[,ip..]][-w][-r|-x|-z][-n][-I][-s FRAME|CEC|MM|IVM|RSA|HMC|CMM|IMM2|FSP]
|
||||
[-u][--range IPranges][-t tries][--vpdtable][-C counts][-T timeout]",
|
||||
"rflash" =>
|
||||
"Usage:
|
||||
rflash [ -h|--help|-v|--version]
|
||||
@@ -270,8 +270,9 @@ my %usage = (
|
||||
rflash <noderange> -p <rpm_directory> [--activate concurrent | disruptive][-V|--verbose]
|
||||
rflash <noderange> [--commit | --recover] [-V|--verbose]
|
||||
PPC (using Direct FSP Management) specific:
|
||||
rflash <noderange> -p <rpm_directory> --activate disruptive [-d <data_directory>]
|
||||
rflash <noderange> [--commit | --recover] [-V|--verbose]",
|
||||
rflash <noderange> -p <rpm_directory> --activate <disruptive|deferred> [-d <data_directory>]
|
||||
rflash <noderange> [--commit | --recover] [-V|--verbose]
|
||||
rflash <noderange> [--bpa_acdl]",
|
||||
"mkhwconn" =>
|
||||
"Usage:
|
||||
mkhwconn [-h|--help]
|
||||
@@ -316,10 +317,24 @@ my %usage = (
|
||||
renergy noderange [-V] { all | { [savingstatus] [dsavingstatus] [cappingstatus] [cappingmaxmin] [cappingvalue] [cappingsoftmin] [averageAC] [averageDC] [ambienttemp] [exhausttemp] [CPUspeed] [syssbpower] [sysIPLtime] [fsavingstatus] [ffoMin] [ffoVmin] [ffoTurbo] [ffoNorm] [ffovalue] } }
|
||||
renergy noderange [-V] { {savingstatus}={on | off} | {dsavingstatus}={on-norm | on-maxp | off} | {fsavingstatus}={on | off} | {ffovalue}=MHZ | {cappingstatus}={on | off} | {cappingwatt}=watt | {cappingperc}=percentage }
|
||||
|
||||
Blade specific :
|
||||
renergy noderange [-V] { all | pd1all | pd2all | { [pd1status] [pd2status] [pd1policy] [pd2policy] [pd1powermodule1] [pd1powermodule2] [pd2powermodule1] [pd2powermodule2] [pd1avaiablepower] [pd2avaiablepower] [pd1reservedpower] [pd2reservedpower] [pd1remainpower] [pd2remainpower] [pd1inusedpower] [pd2inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] } }
|
||||
renergy noderange [-V] { all | { [averageDC] [capability] [cappingvalue] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] } }
|
||||
renergy noderange [-V] { {savingstatus}={on | off} | {dsavingstatus}={on-norm | on-maxp | off} }",
|
||||
BladeCenter specific :
|
||||
For Management Modules:
|
||||
renergy noderange [-V] { all | pd1all | pd2all | [pd1status] [pd2status] [pd1policy] [pd2policy] [pd1powermodule1] [pd1powermodule2] [pd2powermodule1] [pd2powermodule2] [pd1avaiablepower] [pd2avaiablepower] [pd1reservedpower] [pd2reservedpower] [pd1remainpower] [pd2remainpower] [pd1inusedpower] [pd2inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] }
|
||||
For a blade server nodes:
|
||||
renergy noderange [-V] { all | [averageDC] [capability] [cappingvalue] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] }
|
||||
renergy noderange [-V] { savingstatus={on | off} | dsavingstatus={on-norm | on-maxp | off} }
|
||||
|
||||
Flex specific :
|
||||
For Flex Management Modules:
|
||||
renergy noderange [-V] { all | [powerstatus] [powerpolicy] [powermodule] [avaiablepower] [reservedpower] [remainpower] [inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] }
|
||||
|
||||
For Flex node (power and x86):
|
||||
renergy noderange [-V] { all | [averageDC] [capability] [cappingvalue] [cappingmaxmin] [cappingmax] [cappingmin] [cappingGmin] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] }
|
||||
renergy noderange [-V] { cappingstatus={on | off} | cappingwatt=watt | cappingperc=percentage | savingstatus={on | off} | dsavingstatus={on-norm | on-maxp | off} }
|
||||
|
||||
iDataPlex specific :
|
||||
renergy noderange [-V] [ { cappingmaxmin | cappingmax | cappingmin } ] [cappingstatus] [cappingvalue] [relhistogram]
|
||||
renergy noderange [-V] { cappingstatus={on | enable | off | disable} | {cappingwatt|cappingvalue}=watt }",
|
||||
"updatenode" =>
|
||||
"Usage:
|
||||
updatenode [-h|--help|-v|--version]
|
||||
@@ -384,11 +399,36 @@ Options:
|
||||
"Usage:
|
||||
Common:
|
||||
nodeset [-h|--help|-v|--version]
|
||||
nodeset <noderange> [install|shell|boot|runcmd=bmcsetup|netboot|iscsiboot|osimage=<imagename>|statelite]",
|
||||
nodeset <noderange> [install|shell|boot|runcmd=bmcsetup|netboot|iscsiboot|osimage=<imagename>|statelite|offline]",
|
||||
"rmflexnode" =>
|
||||
"Usage:
|
||||
rmflexnode [-h|--help|-v|--version]
|
||||
rmflexnode <noderange>",
|
||||
"lsve" =>
|
||||
"Usage:
|
||||
lsve [-t type] [-m manager] [-o object]
|
||||
-t: dc - 'Data Center', cl - 'Cluster', sd - 'Storage Domain', nw - 'Network', tpl -'Template'
|
||||
-m: FQDN (Fully Qualified Domain Name) of the rhev manager
|
||||
-o: Target object to display",
|
||||
"cfgve" =>
|
||||
"Usage:
|
||||
cfgve -t dc -m manager -o object [-c -k nfs|localfs | -r]
|
||||
cfgve -t cl -m manager -o object [-c -p cpu type | -r -f]
|
||||
cfgve -t sd -m manager -o object [-c | -g | -s | -a | -b | -r -f]
|
||||
-t: sd - 'Storage Domain', nw - 'Network', tpl -'Template'
|
||||
-m: FQDN (Fully Qualified Domain Name) of the rhev manager
|
||||
-o: Target object to configure
|
||||
cfgve -t nw -m manager -o object [-c -d data center -n vlan ID | -a -l cluster| -b | -r]
|
||||
cfgve -t tpl -m manager -o object [-r]",
|
||||
"chhypervisor" =>
|
||||
"Usage:
|
||||
chhypervisor noderange [-a | -n | -p | -e | -d | -h]",
|
||||
"rmhypervisor" =>
|
||||
"Usage:
|
||||
rmhypervisor noderange [-f | -h]",
|
||||
"clonevm" =>
|
||||
"Usage:
|
||||
clonevm noderange [-t createmaster -f | -b basemaster -d | -h]",
|
||||
);
|
||||
my $vers = xCAT::Utils->Version();
|
||||
my %version = (
|
||||
@@ -413,7 +453,12 @@ my %version = (
|
||||
"lsflexnode" => "$vers",
|
||||
"mkflexnode" => "$vers",
|
||||
"rmflexnode" => "$vers",
|
||||
"nodeset" => "$vers"
|
||||
"nodeset" => "$vers",
|
||||
"lsve" => "$vers",
|
||||
"cfgve" => "$vers",
|
||||
"chhypervisor" => "$vers",
|
||||
"rmhypervisor" => "$vers",
|
||||
"clonevm" => "$vers",
|
||||
);
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
+183
-144
@@ -27,6 +27,7 @@ use Symbol;
|
||||
use Digest::SHA1 qw/sha1/;
|
||||
use IPC::Open3;
|
||||
use IO::Select;
|
||||
use xCAT::GlobalDef;
|
||||
require xCAT::RemoteShellExp;
|
||||
use warnings "all";
|
||||
require xCAT::InstUtils;
|
||||
@@ -1069,16 +1070,18 @@ sub runcmd
|
||||
my $errout;
|
||||
open (PIPE, "$cmd |");
|
||||
while (<PIPE>) {
|
||||
push @$outref, $_;
|
||||
chomp; # get rid of the newline, because the client will add one
|
||||
if ($::CALLBACK){
|
||||
$rsp->{data}->[0] = $_;
|
||||
$::CALLBACK->($rsp);
|
||||
} else {
|
||||
xCAT::MsgUtils->message("D", "$_");
|
||||
}
|
||||
$output .= $_;
|
||||
#$output .= $_;
|
||||
}
|
||||
# store the return string
|
||||
push @$outref,$output;
|
||||
#push @$outref,$output;
|
||||
}
|
||||
|
||||
# now if not streaming process errors
|
||||
@@ -2381,7 +2384,7 @@ sub my_nets
|
||||
my $n = $_->{net};
|
||||
my $if = $_->{mgtifname};
|
||||
my $nm = $_->{mask};
|
||||
if (!$n || !$if || $nm)
|
||||
if (!$n || !$if || !$nm)
|
||||
{
|
||||
next; #incomplete network
|
||||
}
|
||||
@@ -2878,139 +2881,7 @@ sub getNodeIPaddress
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 getIPaddress - Used by DFM related functions to support service vlan redundancy.
|
||||
|
||||
Arguments:
|
||||
Node name only one at a time
|
||||
Returns: ip address(s)
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example: my $c1 = xCAT::Utils::getIPaddress($nodetocheck);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub getIPaddress
|
||||
{
|
||||
require xCAT::Table;
|
||||
my $nodetocheck = shift;
|
||||
my $port = shift;
|
||||
if (isIpaddr($nodetocheck)) {
|
||||
return $nodetocheck;
|
||||
}
|
||||
my $side = "[A|B]";
|
||||
if (!defined($port)) {
|
||||
$port = "[0|1]";
|
||||
}
|
||||
|
||||
# only need to parse IP addresses for Frame/CEC/BPA/FSP
|
||||
|
||||
my $type = xCAT::DBobjUtils->getnodetype($nodetocheck);
|
||||
if ($type) {
|
||||
my @children;
|
||||
my %node_side_pairs = ();
|
||||
my $children_num = 0;
|
||||
my $parent;
|
||||
my $ppctab = xCAT::Table->new( 'ppc' );
|
||||
my $vpdtab = xCAT::Table->new( 'vpd' );
|
||||
my $mptab = xCAT::Table->new( 'mp');
|
||||
if ($type eq "bpa" or $type eq "fsp") {
|
||||
my $tmp_p = $ppctab->getNodeAttribs($nodetocheck, ['parent']);
|
||||
if ($tmp_p and $tmp_p->{parent}) {
|
||||
$parent = $tmp_p->{parent};
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
if ($mptab) {
|
||||
my $tmp_p_type = $mptab->getNodeAttribs($parent, ['nodetype']);
|
||||
if ($tmp_p_type && $tmp_p_type->{nodetype} =~ /^(cmm|mp)$/) {
|
||||
return getNodeIPaddress($nodetocheck);
|
||||
} else {
|
||||
my $p_type = xCAT::DBobjUtils->getnodetype($parent);
|
||||
if ($p_type && $p_type =~ /^(cmm|mp)$/) {
|
||||
return getNodeIPaddress($nodetocheck);
|
||||
}
|
||||
}
|
||||
}
|
||||
my $tmp_s = $vpdtab->getNodeAttribs($nodetocheck, ['side']);
|
||||
if ($tmp_s->{side} and ($tmp_s->{side} =~ /(A|B)-\d/i)) {
|
||||
$side = $1; # get side for the fsp, in order to get its brothers
|
||||
} else {
|
||||
return -3;
|
||||
}
|
||||
} elsif ($type eq "frame" or $type eq "cec") {
|
||||
$parent = $nodetocheck;
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
my $tmp_parent;
|
||||
my $tmp_node;
|
||||
my $tmp_type;
|
||||
#search for $nodetocheck's children or brothers
|
||||
for my $entry ( @ps ) {
|
||||
$tmp_parent = $entry->{parent};
|
||||
$tmp_node = $entry->{node};
|
||||
$tmp_type = $entry->{nodetype};
|
||||
if ($tmp_parent and ($tmp_parent eq $parent) ) {
|
||||
if (!defined($tmp_type)) {
|
||||
$tmp_type = xCAT::DBobjUtils->getnodetype($tmp_node);
|
||||
}
|
||||
if ($tmp_type and ($tmp_type eq 'fsp' or $tmp_type eq 'bpa')) {
|
||||
push @children, $tmp_node;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach my $tmp_n( @children) {
|
||||
my $ent = $vpdtab->getNodeAttribs($tmp_n, ['side']);
|
||||
if ($ent->{side} and $ent->{side} =~ /^$side-$port$/i) {
|
||||
my $tmp_s = $ent->{side};
|
||||
$tmp_s =~ s/a/A/;
|
||||
$tmp_s =~ s/b/B/;
|
||||
if (isIpaddr($tmp_n)) {
|
||||
$node_side_pairs{$tmp_s} = $tmp_n;
|
||||
$children_num++;
|
||||
} else {
|
||||
my $tmpip = xCAT::NetworkUtils->getipaddr($tmp_n);
|
||||
if (!$tmpip) {
|
||||
my $hoststab = xCAT::Table->new( 'hosts' );
|
||||
my $tmp = $hoststab->getNodeAttribs($tmp_n, ['ip']);
|
||||
if ($tmp->{ip}) {
|
||||
$tmpip = $tmp->{ip};
|
||||
}
|
||||
}
|
||||
if ($tmpip) {
|
||||
$node_side_pairs{$tmp_s} = $tmpip;
|
||||
$children_num++;
|
||||
}
|
||||
} # end of parse IP address for a fsp/bpa
|
||||
} # end of parse a child's side
|
||||
} #end of loop for children
|
||||
if ($children_num == 0) {
|
||||
return undef; #no children or brothers for this node.
|
||||
}
|
||||
my @keys = qw(A-0 A-1 B-0 B-1);
|
||||
my $out_strings = undef;
|
||||
foreach my $tmp (@keys) {
|
||||
if (!$node_side_pairs{$tmp}) {
|
||||
$node_side_pairs{$tmp} = '';
|
||||
}
|
||||
}
|
||||
|
||||
$out_strings = $node_side_pairs{"A-0"}.','.$node_side_pairs{"A-1"}.','.$node_side_pairs{"B-0"}.','.$node_side_pairs{"B-1"};
|
||||
|
||||
return $out_strings;
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -4027,7 +3898,7 @@ sub isSN
|
||||
return 0;
|
||||
|
||||
}
|
||||
my @nodes = $servicenodetab->getAllNodeAttribs(['tftpserver']);
|
||||
my @nodes = $servicenodetab->getAllNodeAttribs(['tftpserver'],undef,prefetchcache=>1);
|
||||
$servicenodetab->close;
|
||||
foreach my $nodes (@nodes)
|
||||
{
|
||||
@@ -4178,7 +4049,7 @@ sub getSNList
|
||||
$servicenodetab->close;
|
||||
foreach my $node (@nodes)
|
||||
{
|
||||
if ($service eq "") # want all the service nodes
|
||||
if (! defined ($service) || ($service eq "")) # want all the service nodes
|
||||
{
|
||||
push @servicenodes, $node->{node};
|
||||
}
|
||||
@@ -6440,12 +6311,18 @@ sub enablessh
|
||||
{
|
||||
|
||||
# if not a service node we need to check, before enabling
|
||||
my $sitetab = xCAT::Table->new('site');
|
||||
my $attr = "sshbetweennodes";
|
||||
my $ref = $sitetab->getAttribs({key => $attr}, 'value');
|
||||
if ($ref)
|
||||
{
|
||||
my $values = $ref->{value};
|
||||
my $values;
|
||||
if (keys %::XCATSITEVALS) {
|
||||
$values=$::XCATSITEVALS{sshbetweennodes};
|
||||
} else {
|
||||
my $sitetab = xCAT::Table->new('site');
|
||||
my $attr = "sshbetweennodes";
|
||||
my $ref = $sitetab->getAttribs({key => $attr}, 'value');
|
||||
if ($ref) {
|
||||
$values = $ref->{value};
|
||||
}
|
||||
}
|
||||
if ($values) {
|
||||
my @groups = split(/,/, $values);
|
||||
if (grep(/^ALLGROUPS$/, @groups))
|
||||
{
|
||||
@@ -6562,5 +6439,167 @@ sub pingNodeStatus {
|
||||
|
||||
return %status;
|
||||
}
|
||||
=head3 filter_nodes
|
||||
##########################################################################
|
||||
# Fliter the nodes to specific groups
|
||||
# For specific command, figure out the node lists which should be handled by blade.pm, fsp.pm or ipmi.pm
|
||||
# mp group: the nodes will be handled by blade.pm
|
||||
# fsp group: the nodes will be handled by fsp.pm
|
||||
# bmc group: the nodes will be handled by ipmi.pm
|
||||
# For rspconfig network, the NGP ppc blade will be included in the group of mp, othewise in the fsp group
|
||||
# For getmacs -D, the NGP ppc blade will be included in the group of common fsp, otherwise in the mp group
|
||||
# For renergy command, NGP blade will be moved to mp group
|
||||
##########################################################################
|
||||
=cut
|
||||
|
||||
sub filter_nodes{
|
||||
my ($class, $req, $mpnodes, $fspnodes, $bmcnodes, $nohandle) = @_;
|
||||
|
||||
my (@nodes,@args,$cmd);
|
||||
if (defined($req->{'node'})) {
|
||||
@nodes = @{$req->{'node'}};
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
if (defined($req->{'command'})) {
|
||||
$cmd = $req->{'command'}->[0];
|
||||
}
|
||||
if (defined($req->{'arg'})) {
|
||||
@args = @{$req->{'arg'}};
|
||||
}
|
||||
# get the nodes in the mp table
|
||||
my $mptabhash;
|
||||
my $mptab = xCAT::Table->new("mp");
|
||||
if ($mptab) {
|
||||
$mptabhash = $mptab->getNodesAttribs(\@nodes, ['mpa','nodetype']);
|
||||
}
|
||||
|
||||
# get the nodes in the ppc table
|
||||
my $ppctabhash;
|
||||
my $ppctab = xCAT::Table->new("ppc");
|
||||
if ($ppctab) {
|
||||
$ppctabhash = $ppctab->getNodesAttribs(\@nodes,['hcp']);
|
||||
}
|
||||
|
||||
# get the nodes in the ipmi table
|
||||
my $ipmitabhash;
|
||||
my $ipmitab = xCAT::Table->new("ipmi");
|
||||
if ($ipmitab) {
|
||||
$ipmitabhash = $ipmitab->getNodesAttribs(\@nodes,['bmc']);
|
||||
}
|
||||
|
||||
my (@mp, @ngpfsp, @ngpbmc, @commonfsp, @commonbmc, @unknow);
|
||||
|
||||
# if existing in both 'mpa' and 'ppc', a ngp power blade
|
||||
# if existing in both 'mpa' and 'ipmi', a ngp x86 blade
|
||||
# if only in 'ppc', a common power node
|
||||
# if only in 'ipmi', a common x86 node
|
||||
foreach (@nodes) {
|
||||
if (defined ($mptabhash->{$_}->[0]) && defined ($mptabhash->{$_}->[0]->{'mpa'})) {
|
||||
if (defined ($ppctabhash->{$_}->[0]) && defined ($ppctabhash->{$_}->[0]->{'hcp'})) {
|
||||
# flex power node
|
||||
push @ngpfsp, $_;
|
||||
next;
|
||||
} elsif (defined ($ipmitabhash->{$_}->[0]) && defined ($ipmitabhash->{$_}->[0]->{'bmc'})) {
|
||||
# flex x86 node
|
||||
push @ngpbmc, $_;
|
||||
next;
|
||||
}
|
||||
else {
|
||||
# Non flex blade, but blade node
|
||||
push @mp, $_;
|
||||
next;
|
||||
}
|
||||
} elsif (defined ($ppctabhash->{$_}->[0]) && defined ($ppctabhash->{$_}->[0]->{'hcp'})) {
|
||||
# common power node
|
||||
push @commonfsp, $_;
|
||||
} elsif (defined ($ipmitabhash->{$_}->[0]) && defined ($ipmitabhash->{$_}->[0]->{'bmc'})) {
|
||||
# common bmc node
|
||||
push @commonbmc, $_;
|
||||
} else {
|
||||
push @unknow, $_;
|
||||
}
|
||||
}
|
||||
|
||||
push @{$mpnodes}, @mp;#blade.pm
|
||||
push @{$fspnodes}, @commonfsp;
|
||||
push @{$bmcnodes}, @commonbmc;
|
||||
if (@args && ($cmd eq "rspconfig")) {
|
||||
if (!(grep /^(cec_off_policy|pending_power_on_side)/, @args)) {
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
if (grep /^(network=)/, @args) {
|
||||
push @{$mpnodes}, @ngpbmc;
|
||||
}
|
||||
} else {
|
||||
push @{$fspnodes}, @ngpfsp;
|
||||
}
|
||||
} elsif($cmd eq "getmacs") {
|
||||
if (@args && (grep /^-D$/,@args)) {
|
||||
push @{$fspnodes}, @ngpfsp;
|
||||
} else {
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
}
|
||||
} elsif ($cmd eq "rvitals") {
|
||||
if (@args && (grep /^lcds$/,@args)) {
|
||||
push @{$fspnodes},@ngpfsp;
|
||||
} else {
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
}
|
||||
} elsif ($cmd eq "renergy") {
|
||||
push @{$mpnodes}, @ngpbmc;
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
} else {
|
||||
push @{$fspnodes}, @ngpfsp;
|
||||
}
|
||||
|
||||
push @{$nohandle}, @unknow;
|
||||
|
||||
## TRACE_LINE print "Nodes filter: nodetype [commp:@mp,ngpp:@ngpfsp,comfsp:@commonfsp]. mpnodes [@{$mpnodes}], fspnodes [@{$fspnodes}], bmcnodes [@{$bmcnodes}]\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub version_cmp {
|
||||
my $ver_a = shift;
|
||||
if ($ver_a =~ /xCAT::Utils/)
|
||||
{
|
||||
$ver_a = shift;
|
||||
}
|
||||
my $ver_b = shift;
|
||||
my @array_a = ($ver_a =~ /([-.]|\d+|[^-.\d])/g);
|
||||
my @array_b = ($ver_b =~ /([-.]|\d+|[^-.\d])/g);
|
||||
|
||||
my ($a, $b);
|
||||
my $len_a = @array_a;
|
||||
my $len_b = @array_b;
|
||||
my $len = $len_a;
|
||||
if ( $len_b < $len_a ) {
|
||||
$len = $len_b;
|
||||
}
|
||||
for ( my $i = 0; $i < $len; $i++ ) {
|
||||
$a = $array_a[$i];
|
||||
$b = $array_b[$i];
|
||||
if ($a eq $b) {
|
||||
next;
|
||||
} elsif ( $a eq '-' ) {
|
||||
return -1;
|
||||
} elsif ( $b eq '-') {
|
||||
return 1;
|
||||
} elsif ( $a eq '.' ) {
|
||||
return -1;
|
||||
} elsif ( $b eq '.' ) {
|
||||
return 1;
|
||||
} elsif ($a =~ /^\d+$/ and $b =~ /^\d+$/) {
|
||||
if ($a =~ /^0/ || $b =~ /^0/) {
|
||||
return ($a cmp $b);
|
||||
} else {
|
||||
return ($a <=> $b);
|
||||
}
|
||||
} else {
|
||||
$a = uc $a;
|
||||
$b = uc $b;
|
||||
return ($a cmp $b);
|
||||
}
|
||||
}
|
||||
return ( $len_a <=> $len_b )
|
||||
}
|
||||
1;
|
||||
|
||||
@@ -49,6 +49,11 @@ require Exporter;
|
||||
"1305067911.467189" => "rhels6.1", #ppc64
|
||||
"1321546114.510099" => "rhels6.2", #x86_64
|
||||
"1321546739.676170" => "rhels6.2", #ppc64
|
||||
"1339641244.734735" => "rhels6.3", #ppc64
|
||||
"1339640147.274118" => "rhels6.3", #x86_64
|
||||
"1339638991.532890" => "rhels6.3", #i386
|
||||
"1359576752.435900" => "rhels6.4", #x86_64
|
||||
"1359576196.686790" => "rhels6.4", #ppc64
|
||||
"1285193176.593806" => "rhelhpc6",
|
||||
"1194015916.783841" => "fedora8",
|
||||
"1194015385.299901" => "fedora8",
|
||||
|
||||
@@ -33,12 +33,16 @@ package xCAT::data::ipmisensorevents;
|
||||
"07h,07h"=>"Processor,Processor Presence Detected",
|
||||
"07h,08h"=>"Processor,Processor Disabled",
|
||||
"07h,09h"=>"Processor,Terminator Presence Detected",
|
||||
"07h,0Ah"=>"Processor Automatically Throttled (thermal or power throttling)",
|
||||
"07h,0Bh"=>"Uncorrectable Machine check exception",
|
||||
"07h,0Ch"=>"Correctable Machine check exception",
|
||||
"08h,00h"=>"Power Supply,Presence Detected",
|
||||
"08h,01h"=>"Power Supply,Power Supply Failure Detected",
|
||||
"08h,02h"=>"Power Supply,Predictive Failure Asserted",
|
||||
"08h,03h"=>"Power Supply,Power Supply AC lost",
|
||||
"08h,04h"=>"Power Supply,AC lost or out-of-range",
|
||||
"08h,05h"=>"Power Supply,AC out-of-range, but present",
|
||||
"08h,06h"=>"Power Supply,Configuration error", #TODO: event data 3 decode?
|
||||
"09h,00h"=>"Power Unit,Power Off / Power Down",
|
||||
"09h,01h"=>"Power Unit,Power Cycle",
|
||||
"09h,02h"=>"Power Unit,240VA Power Down",
|
||||
@@ -59,6 +63,7 @@ package xCAT::data::ipmisensorevents;
|
||||
"0Ch,07h"=>"Memory,Configuration Error",
|
||||
"0Ch,08h"=>"Memory,Spare",
|
||||
"0Ch,09h"=>"Memory,Throttled",
|
||||
"0Ch,0Ah"=>"Memory,Critical Overtemperature",
|
||||
"0Dh,-"=>"Drive Slot,-",
|
||||
"0Dh,00h"=>"Drive Bay,Present",
|
||||
"0Dh,01h"=>"Drive Bay,Fault",
|
||||
@@ -71,14 +76,15 @@ package xCAT::data::ipmisensorevents;
|
||||
"0Dh,08h"=>"Drive Bay,Rebuild aborted",
|
||||
"0Eh,-"=>"POST Memory Resize,-",
|
||||
"0Fh,00h"=>"System Firmware Progress,POST Error",
|
||||
"0Fh,01h"=>"System Firmware Progress,System Firmware Hung",
|
||||
"0Fh,02h"=>"System Firmware Progress,System Firmware Progress",
|
||||
"0Fh,01h"=>"System Firmware Progress,System Firmware Hung", #TODO event data 2
|
||||
"0Fh,02h"=>"System Firmware Progress,System Firmware Progress", #TODO event data 2
|
||||
"10h,00h"=>"Event Logging Disabled,Correctable Memory Error Logging Disabled",
|
||||
"10h,01h"=>"Event Logging Disabled,Event 'Type' Logging Disabled",
|
||||
"10h,02h"=>"Event Logging Disabled,Log Area Reset/Cleared",
|
||||
"10h,03h"=>"Event Logging Disabled,All Event Logging Disabled",
|
||||
"10h,04h"=>"Event Logging Disabled,SEL Full",
|
||||
"10h,05h"=>"Event Logging Status,SEL",
|
||||
"10h,05h"=>"Event Logging Status,SEL Almost Full",
|
||||
"10h,06h"=>"Event Logging Status,Correctable Machine Check Error Logging Disabled",
|
||||
"11h,00h"=>"Watchdog 1,BIOS Watchdog Reset",
|
||||
"11h,01h"=>"Watchdog 1,OS Watchdog Reset",
|
||||
"11h,02h"=>"Watchdog 1,OS Watchdog Shut Down",
|
||||
@@ -103,14 +109,19 @@ package xCAT::data::ipmisensorevents;
|
||||
"13h,07h"=>"Critical Interrupt,Bus Correctable Error",
|
||||
"13h,08h"=>"Critical Interrupt,Bus Uncorrectable Error",
|
||||
"13h,09h"=>"Critical Interrupt,Fatal NMI (port 61h, bit 7)",
|
||||
"13h,0Ah"=>"Critical Interrupt,Bus Fatal Error",
|
||||
"13h,0Bh"=>"Critical Interrupt,Bus Degraded",
|
||||
"14h,00h"=>"Button,Power Button pressed",
|
||||
"14h,01h"=>"Button,Sleep Button pressed",
|
||||
"14h,02h"=>"Button,Reset Button pressed",
|
||||
"14h,03h"=>"Button,FRU latch open",
|
||||
"14h,04h"=>"Button,FRU service request button",
|
||||
"15h,-"=>"Module / Board,-",
|
||||
"16h,-"=>"Microcontroller / Coprocessor,-",
|
||||
"17h,-"=>"Add-in Card,-",
|
||||
"18h,-"=>"Chassis,-",
|
||||
"19h,-"=>"Chip Set,-",
|
||||
"19h,00h"=>"Chip Set,Soft Power Control Failure",
|
||||
"19h,01h"=>"Chip Set,Thermal Trip",
|
||||
"1Ah,-"=>"Other FRU,-",
|
||||
"1Bh,-"=>"Cable / Interconnect,-",
|
||||
"1Bh,00h"=>"Cable/Interconnect,Connected",
|
||||
@@ -151,6 +162,7 @@ package xCAT::data::ipmisensorevents;
|
||||
"21h,06h"=>"Slot / Connector,Slot / Connector Device Removal Request",
|
||||
"21h,07h"=>"Slot / Connector,Interlock asserted",
|
||||
"21h,08h"=>"Slot / Connector,Slot is Disabled",
|
||||
"21h,09h"=>"Slot / Connector,Slot holds spare device",
|
||||
"22h,00h"=>"System ACPI Power State,S0 / G0 working",
|
||||
"22h,01h"=>"System ACPI Power State,S1 sleeping with system h/w & processor context maintained",
|
||||
"22h,02h"=>"System ACPI Power State,S2 sleeping, processor context lost",
|
||||
@@ -195,6 +207,8 @@ package xCAT::data::ipmisensorevents;
|
||||
"29h,02h"=>"Battery,battery presense detected",
|
||||
"2Ah,00h"=>"Session Audit,Session Activated",
|
||||
"2Ah,01h"=>"Session Audit,Session Deactivated",
|
||||
"2Ah,02h"=>"Session Audit,Invalid Username or Password",
|
||||
"2Ah,03h"=>"Session Audit,Account disabled",
|
||||
"2Bh,00h"=>"Version Change,Hardware Change Occurred",
|
||||
"2Bh,01h"=>"Version Change,Firmware/Software Change occurred",
|
||||
"2Bh,02h"=>"Version Change,Hardware Incompatiblitiy",
|
||||
|
||||
+326
-326
@@ -2,8 +2,8 @@
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
This is a CP utility plugin for z/VM.
|
||||
|
||||
This is a CP utility plugin for z/VM.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -18,604 +18,604 @@ use warnings;
|
||||
|
||||
=head3 getUserId
|
||||
|
||||
Description : Get the user ID of a given node
|
||||
Arguments : Node
|
||||
Returns : UserID
|
||||
Example : my $userID = xCAT::zvmCPUtils->getUserId($node);
|
||||
Description : Get the user ID of a given node
|
||||
Arguments : Node
|
||||
Returns : UserID
|
||||
Example : my $userID = xCAT::zvmCPUtils->getUserId($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getUserId {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get user ID using VMCP
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q userid"`;
|
||||
my @results = split( ' ', $out );
|
||||
# Get user ID using VMCP
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q userid"`;
|
||||
my @results = split( ' ', $out );
|
||||
|
||||
return ( $results[0] );
|
||||
return ( $results[0] );
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getHost
|
||||
|
||||
Description : Get the z/VM host of a given node
|
||||
Arguments : Node
|
||||
Returns : z/VM host
|
||||
Example : my $host = xCAT::zvmCPUtils->getHost($node);
|
||||
Description : Get the z/VM host of a given node
|
||||
Arguments : Node
|
||||
Returns : z/VM host
|
||||
Example : my $host = xCAT::zvmCPUtils->getHost($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getHost {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get host using VMCP
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q userid"`;
|
||||
my @results = split( ' ', $out );
|
||||
my $host = $results[2];
|
||||
# Get host using VMCP
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q userid"`;
|
||||
my @results = split( ' ', $out );
|
||||
my $host = $results[2];
|
||||
|
||||
return ($host);
|
||||
return ($host);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getPrivileges
|
||||
|
||||
Description : Get the privilege class of a given node
|
||||
Arguments : Node
|
||||
Returns : Privilege class
|
||||
Example : my $class = xCAT::zvmCPUtils->getPrivileges($node);
|
||||
Description : Get the privilege class of a given node
|
||||
Arguments : Node
|
||||
Returns : Privilege class
|
||||
Example : my $class = xCAT::zvmCPUtils->getPrivileges($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getPrivileges {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get privilege class
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q priv"`;
|
||||
my @out = split( '\n', $out );
|
||||
$out[1] = xCAT::zvmUtils->trimStr( $out[1] );
|
||||
$out[2] = xCAT::zvmUtils->trimStr( $out[2] );
|
||||
my $str = " $out[1]\n $out[2]\n";
|
||||
# Get privilege class
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q priv"`;
|
||||
my @out = split( '\n', $out );
|
||||
$out[1] = xCAT::zvmUtils->trimStr( $out[1] );
|
||||
$out[2] = xCAT::zvmUtils->trimStr( $out[2] );
|
||||
my $str = " $out[1]\n $out[2]\n";
|
||||
|
||||
return ($str);
|
||||
return ($str);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getMemory
|
||||
|
||||
Description : Get the memory of a given node
|
||||
Arguments : Node
|
||||
Returns : Memory
|
||||
Example : my $memory = xCAT::zvmCPUtils->getMemory($node);
|
||||
Description : Get the memory of a given node
|
||||
Arguments : Node
|
||||
Returns : Memory
|
||||
Example : my $memory = xCAT::zvmCPUtils->getMemory($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getMemory {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get memory
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual storage"`;
|
||||
my @out = split( '=', $out );
|
||||
# Get memory
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual storage"`;
|
||||
my @out = split( '=', $out );
|
||||
|
||||
return ( xCAT::zvmUtils->trimStr( $out[1] ) );
|
||||
return ( xCAT::zvmUtils->trimStr( $out[1] ) );
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getCpu
|
||||
|
||||
Description : Get the processor(s) of a given node
|
||||
Arguments : Node
|
||||
Returns : Processor(s)
|
||||
Example : my $proc = xCAT::zvmCPUtils->getCpu($node);
|
||||
Description : Get the processor(s) of a given node
|
||||
Arguments : Node
|
||||
Returns : Processor(s)
|
||||
Example : my $proc = xCAT::zvmCPUtils->getCpu($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getCpu {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get processors
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual cpus"`;
|
||||
my $str = xCAT::zvmUtils->tabStr($out);
|
||||
# Get processors
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual cpus"`;
|
||||
my $str = xCAT::zvmUtils->tabStr($out);
|
||||
|
||||
return ($str);
|
||||
return ($str);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getNic
|
||||
|
||||
Description : Get the network interface card (NIC) of a given node
|
||||
Arguments : Node
|
||||
Returns : NIC(s)
|
||||
Example : my $nic = xCAT::zvmCPUtils->getNic($node);
|
||||
Description : Get the network interface card (NIC) of a given node
|
||||
Arguments : Node
|
||||
Returns : NIC(s)
|
||||
Example : my $nic = xCAT::zvmCPUtils->getNic($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getNic {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get NIC
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual nic"`;
|
||||
my $str = xCAT::zvmUtils->tabStr($out);
|
||||
# Get NIC
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual nic"`;
|
||||
my $str = xCAT::zvmUtils->tabStr($out);
|
||||
|
||||
return ($str);
|
||||
return ($str);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getNetworkNames
|
||||
|
||||
Description : Get a list of network names available to a given node
|
||||
Arguments : Node
|
||||
Returns : Network names
|
||||
Example : my $lans = xCAT::zvmCPUtils->getNetworkNames($node);
|
||||
Description : Get a list of network names available to a given node
|
||||
Arguments : Node
|
||||
Returns : Network names
|
||||
Example : my $lans = xCAT::zvmCPUtils->getNetworkNames($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getNetworkNames {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get network names
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q lan | egrep 'LAN|VSWITCH'"`;
|
||||
my @lines = split( '\n', $out );
|
||||
my @parms;
|
||||
my $names;
|
||||
foreach (@lines) {
|
||||
|
||||
# Trim output
|
||||
$_ = xCAT::zvmUtils->trimStr($_);
|
||||
@parms = split( ' ', $_ );
|
||||
|
||||
# Get the network name
|
||||
if ( $parms[0] eq "LAN" ) {
|
||||
|
||||
# Determine if this network is a hipersocket
|
||||
# Only hipersocket guest LANs are supported
|
||||
if ( $_ =~ m/Type: HIPERS/i ) {
|
||||
$names .= $parms[0] . ":HIPERS " . $parms[1] . " " . $parms[2] . "\n";
|
||||
} else {
|
||||
$names .= $parms[0] . ":QDIO " . $parms[1] . " " . $parms[2] . "\n";
|
||||
}
|
||||
} elsif ( $parms[0] eq "VSWITCH" ) {
|
||||
$names .= $parms[0] . " " . $parms[1] . " " . $parms[2] . "\n";
|
||||
}
|
||||
}
|
||||
# Get network names
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q lan | egrep 'LAN|VSWITCH'"`;
|
||||
my @lines = split( '\n', $out );
|
||||
my @parms;
|
||||
my $names;
|
||||
foreach (@lines) {
|
||||
|
||||
# Trim output
|
||||
$_ = xCAT::zvmUtils->trimStr($_);
|
||||
@parms = split( ' ', $_ );
|
||||
|
||||
# Get the network name
|
||||
if ( $parms[0] eq "LAN" ) {
|
||||
|
||||
# Determine if this network is a hipersocket
|
||||
# Only hipersocket guest LANs are supported
|
||||
if ( $_ =~ m/Type: HIPERS/i ) {
|
||||
$names .= $parms[0] . ":HIPERS " . $parms[1] . " " . $parms[2] . "\n";
|
||||
} else {
|
||||
$names .= $parms[0] . ":QDIO " . $parms[1] . " " . $parms[2] . "\n";
|
||||
}
|
||||
} elsif ( $parms[0] eq "VSWITCH" ) {
|
||||
$names .= $parms[0] . " " . $parms[1] . " " . $parms[2] . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
return ($names);
|
||||
return ($names);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getNetworkNamesArray
|
||||
|
||||
Description : Get an array of network names available to a given node
|
||||
Arguments : Node
|
||||
Returns : Array of networks names
|
||||
Example : my @networks = xCAT::zvmCPUtils->getNetworkNamesArray($node);
|
||||
Description : Get an array of network names available to a given node
|
||||
Arguments : Node
|
||||
Returns : Array of networks names
|
||||
Example : my @networks = xCAT::zvmCPUtils->getNetworkNamesArray($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getNetworkNamesArray {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
my @networks;
|
||||
my %netHash;
|
||||
|
||||
# Get the networks used by the node
|
||||
my $out = `ssh $node "vmcp q v nic" | egrep -i "VSWITCH|LAN"`;
|
||||
my @lines = split( '\n', $out );
|
||||
|
||||
# Loop through each line
|
||||
my $line;
|
||||
my @words;
|
||||
my $name;
|
||||
foreach(@lines) {
|
||||
# Get network name
|
||||
# Line should contain: MAC: 02-00-01-00-00-12 VSWITCH: SYSTEM VSW1
|
||||
$line = xCAT::zvmUtils->trimStr( $_ );
|
||||
@words = split( ' ', $line );
|
||||
if (@words) {
|
||||
$name = xCAT::zvmUtils->trimStr( $words[4] );
|
||||
|
||||
# If network is not 'None'
|
||||
if ($name ne 'None') {
|
||||
# Save network
|
||||
$netHash{$name} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Push networks into array
|
||||
foreach $name ( keys %netHash ) {
|
||||
push(@networks, $name);
|
||||
}
|
||||
|
||||
return @networks;
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
my @networks;
|
||||
my %netHash;
|
||||
|
||||
# Get the networks used by the node
|
||||
my $out = `ssh $node "vmcp q v nic" | egrep -i "VSWITCH|LAN"`;
|
||||
my @lines = split( '\n', $out );
|
||||
|
||||
# Loop through each line
|
||||
my $line;
|
||||
my @words;
|
||||
my $name;
|
||||
foreach(@lines) {
|
||||
# Get network name
|
||||
# Line should contain: MAC: 02-00-01-00-00-12 VSWITCH: SYSTEM VSW1
|
||||
$line = xCAT::zvmUtils->trimStr( $_ );
|
||||
@words = split( ' ', $line );
|
||||
if (@words) {
|
||||
$name = xCAT::zvmUtils->trimStr( $words[4] );
|
||||
|
||||
# If network is not 'None'
|
||||
if ($name ne 'None') {
|
||||
# Save network
|
||||
$netHash{$name} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Push networks into array
|
||||
foreach $name ( keys %netHash ) {
|
||||
push(@networks, $name);
|
||||
}
|
||||
|
||||
return @networks;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getNetwork
|
||||
|
||||
Description : Get the network info for a given node
|
||||
Arguments : Node
|
||||
Network name
|
||||
Returns : Network configuration
|
||||
Example : my $config = xCAT::zvmCPUtils->getNetwork($node, $netName);
|
||||
Description : Get the network info for a given node
|
||||
Arguments : Node
|
||||
Network name
|
||||
Returns : Network configuration
|
||||
Example : my $config = xCAT::zvmCPUtils->getNetwork($node, $netName);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getNetwork {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node, $netName ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node, $netName ) = @_;
|
||||
|
||||
# Get network info
|
||||
my $out;
|
||||
if ( $netName eq "all" ) {
|
||||
$out = `ssh -o ConnectTimeout=5 $node "vmcp q lan"`;
|
||||
} else {
|
||||
$out = `ssh -o ConnectTimeout=5 $node "vmcp q lan $netName"`;
|
||||
}
|
||||
# Get network info
|
||||
my $out;
|
||||
if ( $netName eq "all" ) {
|
||||
$out = `ssh -o ConnectTimeout=5 $node "vmcp q lan"`;
|
||||
} else {
|
||||
$out = `ssh -o ConnectTimeout=5 $node "vmcp q lan $netName"`;
|
||||
}
|
||||
|
||||
return ($out);
|
||||
return ($out);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getDisks
|
||||
|
||||
Description : Get the disk(s) of given node
|
||||
Arguments : Node
|
||||
Returns : Disk(s)
|
||||
Example : my $storage = xCAT::zvmCPUtils->getDisks($node);
|
||||
Description : Get the disk(s) of given node
|
||||
Arguments : Node
|
||||
Returns : Disk(s)
|
||||
Example : my $storage = xCAT::zvmCPUtils->getDisks($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getDisks {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get disks
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual dasd"`;
|
||||
my $str = xCAT::zvmUtils->tabStr($out);
|
||||
# Get disks
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q virtual dasd"`;
|
||||
my $str = xCAT::zvmUtils->tabStr($out);
|
||||
|
||||
return ($str);
|
||||
return ($str);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 loadVmcp
|
||||
|
||||
Description : Load Linux VMCP module on a given node
|
||||
Arguments : Node
|
||||
Returns : Nothing
|
||||
Example : xCAT::zvmCPUtils->loadVmcp($node);
|
||||
Description : Load Linux VMCP module on a given node
|
||||
Arguments : Node
|
||||
Returns : Nothing
|
||||
Example : xCAT::zvmCPUtils->loadVmcp($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub loadVmcp {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Load Linux VMCP module
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "modprobe vmcp"`;
|
||||
return;
|
||||
# Load Linux VMCP module
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "modprobe vmcp"`;
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getVswitchId
|
||||
|
||||
Description : Get the VSwitch ID(s) of given node
|
||||
Arguments : Node
|
||||
Returns : VSwitch ID(s)
|
||||
Example : my @vswitch = xCAT::zvmCPUtils->getVswitchId($node);
|
||||
Description : Get the VSwitch ID(s) of given node
|
||||
Arguments : Node
|
||||
Returns : VSwitch ID(s)
|
||||
Example : my @vswitch = xCAT::zvmCPUtils->getVswitchId($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getVswitchId {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node ) = @_;
|
||||
|
||||
# Get VSwitch
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q v nic" | grep "VSWITCH"`;
|
||||
my @lines = split( '\n', $out );
|
||||
my @parms;
|
||||
my @vswitch;
|
||||
foreach (@lines) {
|
||||
@parms = split( ' ', $_ );
|
||||
push( @vswitch, $parms[4] );
|
||||
}
|
||||
# Get VSwitch
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q v nic" | grep "VSWITCH"`;
|
||||
my @lines = split( '\n', $out );
|
||||
my @parms;
|
||||
my @vswitch;
|
||||
foreach (@lines) {
|
||||
@parms = split( ' ', $_ );
|
||||
push( @vswitch, $parms[4] );
|
||||
}
|
||||
|
||||
return @vswitch;
|
||||
return @vswitch;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 grantVSwitch
|
||||
|
||||
Description : Grant VSwitch access for a given userID
|
||||
Arguments : HCP node
|
||||
User ID
|
||||
VSWITCH ID
|
||||
Returns : Operation results (Done/Failed)
|
||||
Example : my $out = xCAT::zvmCPUtils->grantVswitch($callback, $hcp, $userId, $vswitchId);
|
||||
Description : Grant VSwitch access for a given userID
|
||||
Arguments : HCP node
|
||||
User ID
|
||||
VSWITCH ID
|
||||
Returns : Operation results (Done/Failed)
|
||||
Example : my $out = xCAT::zvmCPUtils->grantVswitch($callback, $hcp, $userId, $vswitchId);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub grantVSwitch {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $callback, $hcp, $userId, $vswitchId ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $callback, $hcp, $userId, $vswitchId ) = @_;
|
||||
|
||||
# Grant VSwitch for specified userID
|
||||
my $out = `ssh $hcp "vmcp set vswitch $vswitchId grant $userId"`;
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
# Grant VSwitch for specified userID
|
||||
my $out = `ssh $hcp "vmcp set vswitch $vswitchId grant $userId"`;
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
||||
# If return string contains 'Command complete' - Operation was successful
|
||||
my $retStr;
|
||||
if ( $out =~ m/Command complete/i ) {
|
||||
$retStr = "Done\n";
|
||||
} else {
|
||||
$retStr = "Failed\n";
|
||||
return $retStr;
|
||||
}
|
||||
# If return string contains 'Command complete' - Operation was successful
|
||||
my $retStr;
|
||||
if ( $out =~ m/Command complete/i ) {
|
||||
$retStr = "Done\n";
|
||||
} else {
|
||||
$retStr = "Failed\n";
|
||||
return $retStr;
|
||||
}
|
||||
|
||||
return $retStr;
|
||||
return $retStr;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 flashCopy
|
||||
|
||||
Description : Flash copy (Class B users only)
|
||||
Arguments : Node
|
||||
Source address
|
||||
Target address
|
||||
Returns : Operation results (Done/Failed)
|
||||
Example : my $results = xCAT::zvmCPUtils->flashCopy($node, $srcAddr, $targetAddr);
|
||||
Description : Flash copy (Class B users only)
|
||||
Arguments : Node
|
||||
Source address
|
||||
Target address
|
||||
Returns : Operation results (Done/Failed)
|
||||
Example : my $results = xCAT::zvmCPUtils->flashCopy($node, $srcAddr, $targetAddr);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub flashCopy {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node, $srcAddr, $tgtAddr ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node, $srcAddr, $tgtAddr ) = @_;
|
||||
|
||||
# Flash copy
|
||||
my $out = `ssh $node "vmcp flashcopy $srcAddr 0 end to $tgtAddr 0 end synchronous"`;
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
# Flash copy
|
||||
my $out = `ssh $node "vmcp flashcopy $srcAddr 0 end to $tgtAddr 0 end synchronous"`;
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
||||
# If return string contains 'Command complete' - Operation was successful
|
||||
my $retStr = "";
|
||||
if ( $out =~ m/Command complete/i ) {
|
||||
$retStr = "Done\n";
|
||||
} else {
|
||||
$out = xCAT::zvmUtils->tabStr($out);
|
||||
$retStr = "Failed\n$out";
|
||||
}
|
||||
# If return string contains 'Command complete' - Operation was successful
|
||||
my $retStr = "";
|
||||
if ( $out =~ m/Command complete/i ) {
|
||||
$retStr = "Done\n";
|
||||
} else {
|
||||
$out = xCAT::zvmUtils->tabStr($out);
|
||||
$retStr = "Failed\n$out";
|
||||
}
|
||||
|
||||
return $retStr;
|
||||
return $retStr;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 punch2Reader
|
||||
|
||||
Description : Write file to z/VM punch and transfer it to reader
|
||||
Arguments : HCP node
|
||||
UserID to receive file
|
||||
Source file
|
||||
Target file to be created by punch (e.g. sles.parm)
|
||||
Options, e.g. -t (Convert EBCDIC to ASCII)
|
||||
Returns : Operation results (Done/Failed)
|
||||
Example : my $rc = xCAT::zvmCPUtils->punch2Reader($hcp, $userId, $srcFile, $tgtFile, $options);
|
||||
Description : Write file to z/VM punch and transfer it to reader
|
||||
Arguments : HCP node
|
||||
UserID to receive file
|
||||
Source file
|
||||
Target file to be created by punch (e.g. sles.parm)
|
||||
Options, e.g. -t (Convert EBCDIC to ASCII)
|
||||
Returns : Operation results (Done/Failed)
|
||||
Example : my $rc = xCAT::zvmCPUtils->punch2Reader($hcp, $userId, $srcFile, $tgtFile, $options);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub punch2Reader {
|
||||
my ( $class, $hcp, $userId, $srcFile, $tgtFile, $options ) = @_;
|
||||
my ( $class, $hcp, $userId, $srcFile, $tgtFile, $options ) = @_;
|
||||
|
||||
# Punch to reader
|
||||
my $out = `ssh -o ConnectTimeout=5 $hcp "vmur punch $options -u $userId -r $srcFile -N $tgtFile"`;
|
||||
# Punch to reader
|
||||
my $out = `ssh -o ConnectTimeout=5 $hcp "vmur punch $options -u $userId -r $srcFile -N $tgtFile"`;
|
||||
|
||||
# If punch is successful -- Look for this string
|
||||
my $searchStr = "created and transferred";
|
||||
if ( !( $out =~ m/$searchStr/i ) ) {
|
||||
$out = "Failed\n";
|
||||
} else {
|
||||
$out = "Done\n";
|
||||
}
|
||||
# If punch is successful -- Look for this string
|
||||
my $searchStr = "created and transferred";
|
||||
if ( !( $out =~ m/$searchStr/i ) ) {
|
||||
$out = "Failed\n";
|
||||
} else {
|
||||
$out = "Done\n";
|
||||
}
|
||||
|
||||
return $out;
|
||||
return $out;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 purgeReader
|
||||
|
||||
Description : Purge reader (Class D users only)
|
||||
Arguments : HCP node
|
||||
UserID to purge reader
|
||||
Returns : Nothing
|
||||
Example : my $rc = xCAT::zvmCPUtils->purgeReader($hcp, $userId);
|
||||
Description : Purge reader (Class D users only)
|
||||
Arguments : HCP node
|
||||
UserID to purge reader
|
||||
Returns : Nothing
|
||||
Example : my $rc = xCAT::zvmCPUtils->purgeReader($hcp, $userId);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub purgeReader {
|
||||
my ( $class, $hcp, $userId ) = @_;
|
||||
my ( $class, $hcp, $userId ) = @_;
|
||||
|
||||
# Purge reader
|
||||
my $out = `ssh -o ConnectTimeout=5 $hcp "vmcp purge $userId rdr all"`;
|
||||
# Purge reader
|
||||
my $out = `ssh -o ConnectTimeout=5 $hcp "vmcp purge $userId rdr all"`;
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 sendCPCmd
|
||||
|
||||
Description : Send CP command to a given userID (Class C users only)
|
||||
Arguments : HCP node
|
||||
UserID to send CP command
|
||||
Returns : Nothing
|
||||
Example : xCAT::zvmCPUtils->sendCPCmd($hcp, $userId, $cmd);
|
||||
Description : Send CP command to a given userID (Class C users only)
|
||||
Arguments : HCP node
|
||||
UserID to send CP command
|
||||
Returns : Nothing
|
||||
Example : xCAT::zvmCPUtils->sendCPCmd($hcp, $userId, $cmd);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub sendCPCmd {
|
||||
my ( $class, $hcp, $userId, $cmd ) = @_;
|
||||
my ( $class, $hcp, $userId, $cmd ) = @_;
|
||||
|
||||
# Send CP command to given userID
|
||||
my $out = `ssh $hcp "vmcp send cp $userId $cmd"`;
|
||||
# Send CP command to given userID
|
||||
my $out = `ssh $hcp "vmcp send cp $userId $cmd"`;
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getNetworkLayer
|
||||
|
||||
Description : Get the network layer for a given node
|
||||
Arguments : Node
|
||||
Network name
|
||||
Returns : 2 - Layer 2
|
||||
3 - Layer 3
|
||||
-1 - Failed to get network layer
|
||||
Example : my $layer = xCAT::zvmCPUtils->getNetworkLayer($node);
|
||||
Description : Get the network layer for a given node
|
||||
Arguments : Node
|
||||
Network name
|
||||
Returns : 2 - Layer 2
|
||||
3 - Layer 3
|
||||
-1 - Failed to get network layer
|
||||
Example : my $layer = xCAT::zvmCPUtils->getNetworkLayer($node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getNetworkLayer {
|
||||
my ( $class, $node, $netName ) = @_;
|
||||
my ( $class, $node, $netName ) = @_;
|
||||
|
||||
# Exit if the network name is not given
|
||||
if ( !$netName ) {
|
||||
return -1;
|
||||
}
|
||||
# Exit if the network name is not given
|
||||
if ( !$netName ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
# Get network type (Layer 2 or 3)
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q lan $netName"`;
|
||||
if ( !$out ) {
|
||||
return -1;
|
||||
}
|
||||
# Get network type (Layer 2 or 3)
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp q lan $netName"`;
|
||||
if ( !$out ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
# Go through each line
|
||||
my $layer = 3; # Default to layer 3
|
||||
my @lines = split( '\n', $out );
|
||||
foreach (@lines) {
|
||||
# Go through each line
|
||||
my $layer = 3; # Default to layer 3
|
||||
my @lines = split( '\n', $out );
|
||||
foreach (@lines) {
|
||||
|
||||
# If the line contains ETHERNET, then it is a layer 2 network
|
||||
if ( $_ =~ m/ETHERNET/i ) {
|
||||
$layer = 2;
|
||||
}
|
||||
}
|
||||
# If the line contains ETHERNET, then it is a layer 2 network
|
||||
if ( $_ =~ m/ETHERNET/i ) {
|
||||
$layer = 2;
|
||||
}
|
||||
}
|
||||
|
||||
return $layer;
|
||||
return $layer;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getNetworkType
|
||||
|
||||
Description : Get the network type of a given network
|
||||
Arguments : HCP node
|
||||
Name of network
|
||||
Returns : Network type (VSWITCH/HIPERS/QDIO)
|
||||
Example : my $netType = xCAT::zvmCPUtils->getNetworkType($hcp, $netName);
|
||||
Description : Get the network type of a given network
|
||||
Arguments : HCP node
|
||||
Name of network
|
||||
Returns : Network type (VSWITCH/HIPERS/QDIO)
|
||||
Example : my $netType = xCAT::zvmCPUtils->getNetworkType($hcp, $netName);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getNetworkType {
|
||||
my ( $class, $hcp, $netName ) = @_;
|
||||
my ( $class, $hcp, $netName ) = @_;
|
||||
|
||||
# Get network details
|
||||
my $out = `ssh -o ConnectTimeout=5 $hcp "vmcp q lan $netName" | grep "Type"`;
|
||||
# Get network details
|
||||
my $out = `ssh -o ConnectTimeout=5 $hcp "vmcp q lan $netName" | grep "Type"`;
|
||||
|
||||
# Go through each line and determine network type
|
||||
my @lines = split( '\n', $out );
|
||||
my $netType = "";
|
||||
foreach (@lines) {
|
||||
# Go through each line and determine network type
|
||||
my @lines = split( '\n', $out );
|
||||
my $netType = "";
|
||||
foreach (@lines) {
|
||||
|
||||
# Virtual switch
|
||||
if ( $_ =~ m/VSWITCH/i ) {
|
||||
$netType = "VSWITCH";
|
||||
}
|
||||
# Virtual switch
|
||||
if ( $_ =~ m/VSWITCH/i ) {
|
||||
$netType = "VSWITCH";
|
||||
}
|
||||
|
||||
# HiperSocket guest LAN
|
||||
elsif ( $_ =~ m/HIPERS/i ) {
|
||||
$netType = "HIPERS";
|
||||
}
|
||||
# HiperSocket guest LAN
|
||||
elsif ( $_ =~ m/HIPERS/i ) {
|
||||
$netType = "HIPERS";
|
||||
}
|
||||
|
||||
# QDIO guest LAN
|
||||
elsif ( $_ =~ m/QDIO/i ) {
|
||||
$netType = "QDIO";
|
||||
}
|
||||
}
|
||||
# QDIO guest LAN
|
||||
elsif ( $_ =~ m/QDIO/i ) {
|
||||
$netType = "QDIO";
|
||||
}
|
||||
}
|
||||
|
||||
return $netType;
|
||||
return $netType;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 defineCpu
|
||||
|
||||
Description : Add processor(s) to given node
|
||||
Arguments : Node
|
||||
Returns : Nothing
|
||||
Example : my $out = xCAT::zvmCPUtils->defineCpu($node, $addr, $type);
|
||||
Description : Add processor(s) to given node
|
||||
Arguments : Node
|
||||
Returns : Nothing
|
||||
Example : my $out = xCAT::zvmCPUtils->defineCpu($node, $addr, $type);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub defineCpu {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $node, $addr, $type ) = @_;
|
||||
# Get inputs
|
||||
my ( $class, $node, $addr, $type ) = @_;
|
||||
|
||||
# Define processor(s)
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp define cpu $addr type $type"`;
|
||||
# Define processor(s)
|
||||
my $out = `ssh -o ConnectTimeout=5 $node "vmcp define cpu $addr type $type"`;
|
||||
|
||||
return ($out);
|
||||
return ($out);
|
||||
}
|
||||
|
||||
+761
-625
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# Sample postscript for HPC software additional configurations
|
||||
# AIX:
|
||||
# TBD
|
||||
#
|
||||
# Linux: for statefull (full-disk install) and stateless/statelite nodes
|
||||
# For statefull nodes: run as part of IBMhpc.postbootscript.
|
||||
# For stateless/statelite nodes: run as postscript, you will need to
|
||||
# copy this script to /install/postscripts and specify it to nodes'
|
||||
# postscripts attribute.
|
||||
#
|
||||
|
||||
|
||||
# BSR configuration on Power 775 cluster. More BSR configuration should
|
||||
# be done by PE postinstall in genimage or postbootscript in statefull install
|
||||
#chown root:bsr /dev/bsr*
|
||||
@@ -8,6 +8,7 @@ ps_dir=/xcatpost
|
||||
|
||||
# Run script to set up some basics for all HPC software
|
||||
$ps_dir/IBMhpc.postscript
|
||||
$ps_dir/IBMhpc.post
|
||||
|
||||
# Run script to install gpfs updates
|
||||
$ps_dir/gpfs_updates
|
||||
@@ -15,17 +16,12 @@ $ps_dir/gpfs_updates
|
||||
|
||||
# Run script to accept compiler license
|
||||
$ps_dir/compilers_license
|
||||
|
||||
#$ps_dir/upc_license
|
||||
|
||||
# Run script to install PE and accept license
|
||||
$ps_dir/pe_install
|
||||
|
||||
|
||||
# Run script to install ESSL and PESSL rpms
|
||||
$ps_dir/essl_install
|
||||
|
||||
$ps_dir/pe_install-1200
|
||||
|
||||
# Run script to accept LoadLeveler license, install product rpms,
|
||||
# and do some config
|
||||
$ps_dir/loadl_install
|
||||
$ps_dir/loadl_install-5103
|
||||
|
||||
|
||||
@@ -74,7 +74,12 @@ fi
|
||||
#/usr/bin/sed -i 's/SOFTRESIDENTLIMIT=.*/SOFTRESIDENTLIMIT="unlimited"/g' $installroot/etc/sysconfig/ulimit
|
||||
|
||||
#max locked memory
|
||||
echo "* soft memlock unlimited" >> $installroot/etc/security/limits.conf
|
||||
echo "* hard memlock unlimited" >> $installroot/etc/security/limits.conf
|
||||
if ! grep "max locked memory" $installroot/etc/security/limits.conf >/dev/null 2>&1 ; then
|
||||
sed -i "/# End of file/d" $installroot/etc/security/limits.conf
|
||||
echo "#max locked memory" >> $installroot/etc/security/limits.conf
|
||||
echo "* soft memlock unlimited" >> $installroot/etc/security/limits.conf
|
||||
echo "* hard memlock unlimited" >> $installroot/etc/security/limits.conf
|
||||
echo "# End of file" >> $installroot/etc/security/limits.conf
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ numactl
|
||||
libnuma1
|
||||
libpython2_6-1_0
|
||||
xinetd
|
||||
ksh
|
||||
|
||||
gcc-32bit
|
||||
gcc
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# OS packages that are useful for all IBM HPC products
|
||||
#INCLUDE:/opt/xcat/share/xcat/netboot/sles/compute.sles11.x86_64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/netboot/sles/compute.sles11.pkglist#
|
||||
|
||||
systemtap
|
||||
kernel-source
|
||||
@@ -18,6 +18,7 @@ numactl
|
||||
libnuma1
|
||||
libpython2_6-1_0
|
||||
xinetd
|
||||
ksh
|
||||
|
||||
gcc-32bit
|
||||
gcc
|
||||
|
||||
@@ -22,24 +22,17 @@ I:xlsmp.rte
|
||||
# AIX bundle package list for PE
|
||||
|
||||
# POE
|
||||
I:ppe.poe
|
||||
I:ppe.pdb
|
||||
I:ppe.rte
|
||||
#I:ppe.man
|
||||
I:ppe.loc.license
|
||||
|
||||
# needed on login node
|
||||
#I:ppe.hpct
|
||||
#I:ppedev.hpct
|
||||
|
||||
# LAPI
|
||||
I:rsct.lapi
|
||||
#I:rsct.lapi
|
||||
#I:rsct.sci
|
||||
|
||||
# MetaCluster (checkpoint/restore)
|
||||
I:mcr.rte
|
||||
I:mdcr
|
||||
|
||||
|
||||
|
||||
# AIX bundle file for ESSL and PESSL packages
|
||||
|
||||
# ESSL
|
||||
@@ -53,11 +46,7 @@ I:essl.loc.license
|
||||
|
||||
# PESSL
|
||||
I:pessl.rte.up
|
||||
I:pessl.rte.smp
|
||||
I:pessl.rte.rs1
|
||||
I:pessl.rte.mp
|
||||
I:pessl.rte.hv
|
||||
I:pessl.rte.common
|
||||
I:pessl.rte
|
||||
I:pessl.msg.en_US
|
||||
#I:pessl.msg.En_US
|
||||
|
||||
Executable → Regular
+48
-17
@@ -1,4 +1,9 @@
|
||||
#!/bin/ksh
|
||||
#!/usr/bin/ksh
|
||||
|
||||
#
|
||||
# example postscript intended to reduce OS jitter
|
||||
#
|
||||
|
||||
trap "chmod 774 /etc/rc.tcpip" INT QUIT TERM EXIT
|
||||
|
||||
#NB: WANT TO ADD THIS BACK IN AT SOME POINT - SYSTEM HANG DETECTION DEAMON
|
||||
@@ -26,7 +31,6 @@ rmitab piobe > /dev/null 2>&1
|
||||
#qdaemon:23456789:wait:/usr/bin/startsrc -sqdaemon
|
||||
rmitab qdaemon > /dev/null 2>&1
|
||||
|
||||
#do we really need wpar support now?
|
||||
rcwpars:2:once:/etc/rc.wpars > /dev/console 2>&1 # Corrals autostart
|
||||
rmitab rcwpars > /dev/null 2>&1
|
||||
|
||||
@@ -85,15 +89,19 @@ rmitab ctrmc > /dev/null 2>&1
|
||||
#dscrset:2:once:/usr/sbin/dscrctl -n -s 30 >/dev/null 2>/dev/console
|
||||
|
||||
#to disable sendmail daemon, need to comment the line in /etc/rc.tcpip that begins: start /usr/lib/sendmail
|
||||
#As of 11/16/10 John L. re-enable sendmail as some subsystems want to use this for PERCS
|
||||
#Unless someone says we need it, it's back off - 4/18/11 John L.
|
||||
grep -q "^start /usr/lib/sendmail" /etc/rc.tcpip
|
||||
if [[ $? -eq 0 ]] then
|
||||
cat /etc/rc.tcpip | sed 's/^start \/usr\/lib\/sendmail/#start \/usr\/lib\/sendmail/' > /tmp/rc.tcpip.tmpfile.$$
|
||||
cp -p /etc/rc.tcpip /etc/rc.tcpip.prev
|
||||
mv /tmp/rc.tcpip.tmpfile.$$ /etc/rc.tcpip
|
||||
# Leave enabled on login nodes
|
||||
host `hostname` | grep -qE "l[0-9]+"
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
|
||||
grep -q "^start /usr/lib/sendmail" /etc/rc.tcpip
|
||||
if [[ $? -eq 0 ]] then
|
||||
cat /etc/rc.tcpip | sed 's/^start \/usr\/lib\/sendmail/#start \/usr\/lib\/sendmail/' > /tmp/rc.tcpip.tmpfile.$$
|
||||
cp -p /etc/rc.tcpip /etc/rc.tcpip.prev
|
||||
mv /tmp/rc.tcpip.tmpfile.$$ /etc/rc.tcpip
|
||||
fi
|
||||
stopsrc -s sendmail > /dev/null 2>&1
|
||||
fi
|
||||
stopsrc -s sendmail > /dev/null 2>&1
|
||||
|
||||
|
||||
#to disable aixmibd daemon, need to comment the line in /etc/rc.tcpip that begins: start /usr/sbin/aixmibd
|
||||
@@ -123,20 +131,42 @@ if [[ $? -eq 0 ]] then
|
||||
fi
|
||||
stopsrc -s snmpmibd > /dev/null 2>&1
|
||||
|
||||
#disable the prngd daemon (the random daemon is more efficient)
|
||||
stopsrc -s prngd
|
||||
|
||||
chmod 774 /etc/rc.tcpip
|
||||
|
||||
#try to clean up some cron junk - we only touch the crontab file once (and save a backup)
|
||||
if [[ ! -f /var/spool/cron/crontabs/root.before.clean_jitter ]] then
|
||||
cp -p /var/spool/cron/crontabs/root /var/spool/cron/crontabs/root.before.clean_jitter
|
||||
|
||||
grep -v "bin\/pmcfg" /var/spool/cron/crontabs/root | grep -v "bin\/stcron" | grep -v "bin\/dumpctr" | \
|
||||
grep -v "ras\/dumpcheck" > /var/spool/cron/crontabs/root.after.clean_jitter
|
||||
|
||||
egrep -v "bin\/pmcfg|bin\/stcron|bin\/dumpctr|ras\/dumpcheck|bin\/errclear" /var/spool/cron/crontabs/root > /var/spool/cron/crontabs/root.after.clean_jitter
|
||||
|
||||
cp /var/spool/cron/crontabs/root.after.clean_jitter /var/spool/cron/crontabs/root
|
||||
fi
|
||||
|
||||
for i in $(ps -efk | grep "topasrec" | grep -v killproc | grep -v grep | awk ' {print $2} ') ; do
|
||||
kill $i
|
||||
done
|
||||
#for i in $(ps -efk | egrep "\/usr\/sbin\/cron|topasrec" | grep -v grep | awk ' { print $2} ') ; do
|
||||
# kill $i
|
||||
#done
|
||||
#
|
||||
#nohup /usr/sbin/cron > /dev/null 2>&1 &
|
||||
|
||||
CRON="/usr/sbin/cron"
|
||||
|
||||
# Find PID for cron process - check for exact pattern match on process name and it's parent PID is 1
|
||||
CRON_PID=$(ps -ef | grep ${CRON} | grep -v grep | awk '{ if ($NF = "${CRON}" && $3 == "1") { print $2 }}')
|
||||
|
||||
if [ -n "${CRON_PID}" ]
|
||||
then
|
||||
echo "Killing ${CRON} (${CRON_PID}) to re-read config file(s)"
|
||||
kill ${CRON_PID}
|
||||
fi
|
||||
|
||||
# Allow time to respawn from inittab
|
||||
sleep 1
|
||||
|
||||
# Print new cron PID
|
||||
CRON_PID=$(ps -ef | grep ${CRON} | grep -v grep | awk '{ if ($NF = "${CRON}" && $3 == "1") { print $2 }}')
|
||||
echo "New cron PID is ${CRON_PID}"
|
||||
|
||||
ls -l /etc/rc.tcpip
|
||||
telinit q
|
||||
@@ -150,6 +180,7 @@ if [[ $? -ne 0 ]] then
|
||||
echo '* cosched1 18 100 97 10' >> /etc/poe.priority
|
||||
echo '* cosched2 13 100 99.5 10' >> /etc/poe.priority
|
||||
echo '* cosched3 13 100 99 3' >> /etc/poe.priority
|
||||
echo '* cosched4 18 100 97 1' >> /etc/poe.priority
|
||||
chmod 644 /etc/poe.priority
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/ksh
|
||||
|
||||
# Cleanly reboots an AIX node
|
||||
|
||||
echo "Shutting and rebooting node NOW !!!"
|
||||
echo "shutdown -Fr" | at now
|
||||
|
||||
exit 0
|
||||
@@ -16,6 +16,22 @@ if [ $OS != "AIX" ]; then
|
||||
|
||||
if [ $NODESETSTATE == "install" ] || [ $NODESETSTATE == "boot" ]; then
|
||||
# Being run from a stateful install postscript
|
||||
|
||||
## Workaround for xlf/vacpp and upc compiler dependceies conflict issue.
|
||||
## Install a low version of xlmass manually
|
||||
## Uncomment the following lines for UPC compiler use
|
||||
#INSTALL_DIR='/install'
|
||||
#COMPILERS_DIR='post/otherpkgs/rhels6.2/ppc64/compilers'
|
||||
#mkdir -p /tmp/compilers/
|
||||
#rm -f -R /tmp/compilers/*
|
||||
#cd /tmp/compilers/
|
||||
#wget -l inf -nH -N -r --waitretry=10 --random-wait -T 60 -nH --cut-dirs=6 --reject "index.html*" --no-parent http://$SITEMASTER$INSTALL_DIR/$COMPILERS_DIR/ 2> /tmp/wget.log
|
||||
#if [ -n "`ls xlmass.lib-6.1.0*.rpm 2> /dev/null`" ] ; then
|
||||
# rpm -ivh --oldpackage xlmass.lib-6.1.0*.rpm
|
||||
#fi
|
||||
#cd $installroot/
|
||||
#rm -f -R /tmp/compilers/
|
||||
|
||||
if [ -n "$vacpp_script" ] ; then
|
||||
echo 1 | $vacpp_script
|
||||
fi
|
||||
@@ -27,6 +43,13 @@ if [ $OS != "AIX" ]; then
|
||||
if [ $NODESETSTATE == "genimage" ]; then
|
||||
# Being called from <image>.postinstall script
|
||||
# Assume we are on the same machine
|
||||
|
||||
## Worakround for xlf/vacpp and upc compiler dependceies conflict issue.
|
||||
## Install a low version of xlmass manually
|
||||
## Uncomment the following lines for UPC compiler use
|
||||
#cp -p /install/post/otherpkgs/rhels6.2/ppc64/compilers/xlmass.lib-6.1.0*.rpm $installroot/tmp
|
||||
#chroot $installroot rpm -ivh --oldpackage /tmp/xlmass.lib-6.1.0*.rpm
|
||||
|
||||
if [ -n "$vacpp_script" ] ; then
|
||||
echo 1 | chroot $installroot /$vacpp_script
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/compilers/compilers.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.rhels6.ppc64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/essl/essl.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl-5103.otherpkgs.pkglist#
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.rhels6.ppc64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.rhels6.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.rhels6.ppc64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/compilers/compilers.rhels6.pkglist#
|
||||
|
||||
@@ -47,19 +47,20 @@ installroot=$installroot $hpc/gpfs/gpfs_mmsdrfs
|
||||
|
||||
# Run script to accept compiler license
|
||||
installroot=$installroot NODESETSTATE=genimage $hpc/compilers/compilers_license
|
||||
#installroot=$installroot NODESETSTATE=genimage $hpc/compilers/upc_license
|
||||
|
||||
|
||||
# Run script to install PE and accept license
|
||||
installroot=$installroot pedir=$otherpkgs/pe NODESETSTATE=genimage $hpc/pe/pe_install
|
||||
installroot=$installroot pedir=$otherpkgs/pe NODESETSTATE=genimage $hpc/pe/pe_install-1200
|
||||
|
||||
|
||||
# Run script to install ESSL and PESSL rpms
|
||||
installroot=$installroot essldir=$otherpkgs/essl NODESETSTATE=genimage $hpc/essl/essl_install
|
||||
#installroot=$installroot essldir=$otherpkgs/essl NODESETSTATE=genimage $hpc/essl/essl_install
|
||||
|
||||
|
||||
# Run script to accept LoadLeveler license, install product rpms,
|
||||
# and do some config
|
||||
installroot=$installroot loadldir=$otherpkgs/loadl NODESETSTATE=genimage $hpc/loadl/loadl_install
|
||||
installroot=$installroot loadldir=$otherpkgs/loadl NODESETSTATE=genimage $hpc/loadl/loadl_install-5103
|
||||
|
||||
# Run script to install RSCT rpms
|
||||
installroot=$installroot rsctdir=$otherpkgs/rsct NODESETSTATE=genimage $hpc/rsct/rsct_install
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.rhels6.x86_64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.rhels6.x86_64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.x86_64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.rhels6.x86_64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl-5103.otherpkgs.pkglist#
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.rhels6.x86_64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.rhels6.x86_64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.rhels6.x86_64.pkglist#
|
||||
|
||||
@@ -59,7 +59,7 @@ installroot=$installroot pedir=$otherpkgs/pe NODESETSTATE=genimage $hpc/pe/pe_
|
||||
|
||||
# Run script to accept LoadLeveler license, install product rpms,
|
||||
# and do some config
|
||||
#installroot=$installroot loadldir=$otherpkgs/loadl NODESETSTATE=genimage $hpc/loadl/loadl_install
|
||||
installroot=$installroot loadldir=$otherpkgs/loadl NODESETSTATE=genimage $hpc/loadl/loadl_install-5103
|
||||
|
||||
# Run script to install RSCT rpms. Not available on x86_64
|
||||
#installroot=$installroot rsctdir=$otherpkgs/rsct NODESETSTATE=genimage $hpc/rsct/rsct_install
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/essl/essl.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl-5103.otherpkgs.pkglist#
|
||||
|
||||
# For full-disk (stateful) images, EDIT below to use rsct.otherpkgs
|
||||
# For diskless, rpms are installed with postinstall script
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.sles11.ppc64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/compilers/compilers.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/essl/essl.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.sles11.ppc64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/rsct/rsct.pkglist#
|
||||
|
||||
|
||||
|
||||
@@ -55,12 +55,12 @@ installroot=$installroot pedir=$otherpkgs/pe NODESETSTATE=genimage $hpc/pe/pe_
|
||||
|
||||
|
||||
# Run script to install ESSL and PESSL rpms
|
||||
installroot=$installroot essldir=$otherpkgs/essl NODESETSTATE=genimage $hpc/essl/essl_install
|
||||
# installroot=$installroot essldir=$otherpkgs/essl NODESETSTATE=genimage $hpc/essl/essl_install
|
||||
|
||||
|
||||
# Run script to accept LoadLeveler license, install product rpms,
|
||||
# and do some config
|
||||
installroot=$installroot loadldir=$otherpkgs/loadl NODESETSTATE=genimage $hpc/loadl/loadl_install
|
||||
installroot=$installroot loadldir=$otherpkgs/loadl NODESETSTATE=genimage $hpc/loadl/loadl_install-5103
|
||||
|
||||
# Run script to install RSCT rpms
|
||||
installroot=$installroot rsctdir=$otherpkgs/rsct NODESETSTATE=genimage $hpc/rsct/rsct_install
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.sles11.x86_64.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.exlist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe.exlist#
|
||||
@@ -0,0 +1,3 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/gpfs/gpfs.x86_64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.sles11.x86_64.otherpkgs.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/loadl/loadl-5103.otherpkgs.pkglist#
|
||||
@@ -0,0 +1,2 @@
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/IBMhpc.sles11.x86_64.pkglist#
|
||||
#INCLUDE:/opt/xcat/share/xcat/IBMhpc/pe/pe-1200.sles11.x86_64.pkglist#
|
||||
@@ -0,0 +1,65 @@
|
||||
#!/bin/sh
|
||||
# Sample postinstall script for building a diskless SLES11 PPC64 image
|
||||
# with all IBM HPC products
|
||||
#
|
||||
#-- this script is run after all packages from $profile.pkglist are installed
|
||||
#--
|
||||
#-- it gets these arguments:
|
||||
#--
|
||||
#-- $1 = install root (chroot directory for profile)
|
||||
#-- $2 = OS version
|
||||
#-- $3 = architecture
|
||||
#-- $4 = profile name
|
||||
#-- $5 = work dir (where genimage is located)
|
||||
#--
|
||||
#--
|
||||
installroot=$1
|
||||
osver=$2
|
||||
arch=$3
|
||||
profile=$4
|
||||
workdir=$5
|
||||
|
||||
otherpkgs=/install/post/otherpkgs/$osver/$arch
|
||||
|
||||
################
|
||||
# This script runs other postinstall scripts from the $hpc directory
|
||||
# If you have created a custom copy of ANY of these scripts,
|
||||
# make sure to change the execution path from $hpc/<product> to the location
|
||||
# you have placed your script in
|
||||
###############
|
||||
hpc=/opt/xcat/share/xcat/IBMhpc
|
||||
custom=/install/custom/netboot/sles
|
||||
installps=/install/postscripts
|
||||
|
||||
# Run default postinstall shipped with xcat
|
||||
/opt/xcat/share/xcat/netboot/sles/compute.sles11.postinstall $1 $2 $3 $4 $5
|
||||
|
||||
|
||||
# Run general IBMhpc postinstall script
|
||||
$hpc/IBMhpc.sles.postinstall $1 $2 $3 $4 $5
|
||||
|
||||
|
||||
# Run script to install gpfs updates
|
||||
installroot=$installroot NODESETSTATE=genimage $hpc/gpfs/gpfs_updates
|
||||
# Run script to update GPFS mmsdrfs file in the image
|
||||
installroot=$installroot $hpc/gpfs/gpfs_mmsdrfs
|
||||
|
||||
|
||||
# Run script to accept compiler license. x86_64 is using gcc, comment this line.
|
||||
#installroot=$installroot NODESETSTATE=genimage $hpc/compilers/compilers_license
|
||||
|
||||
|
||||
# Run script to install PE and accept license
|
||||
installroot=$installroot pedir=$otherpkgs/pe NODESETSTATE=genimage $hpc/pe/pe_install-1200
|
||||
|
||||
|
||||
# Run script to install ESSL and PESSL rpms. Not available on x86_64.
|
||||
#installroot=$installroot essldir=$otherpkgs/essl NODESETSTATE=genimage $hpc/essl/essl_install
|
||||
|
||||
|
||||
# Run script to accept LoadLeveler license, install product rpms,
|
||||
# and do some config
|
||||
installroot=$installroot loadldir=$otherpkgs/loadl NODESETSTATE=genimage $hpc/loadl/loadl_install-5103
|
||||
|
||||
# Run script to install RSCT rpms. Not available on x86_64
|
||||
#installroot=$installroot rsctdir=$otherpkgs/rsct NODESETSTATE=genimage $hpc/rsct/rsct_install
|
||||
@@ -11,14 +11,18 @@ I:essl.loc.license
|
||||
|
||||
# PESSL
|
||||
I:pessl.rte.up
|
||||
I:pessl.rte.smp
|
||||
I:pessl.rte.rs1
|
||||
I:pessl.rte.mp
|
||||
# If you are using PESSL 4.1.0 or beyond, comment pessl.rte.hv out, it's not needed.
|
||||
I:pessl.rte.hv
|
||||
I:pessl.rte.common
|
||||
I:pessl.rte
|
||||
I:pessl.msg.en_US
|
||||
|
||||
# If you are using PESSL 4.1.0 or beyond, comment pessl.rte.hv out, it's not needed.
|
||||
#I:pessl.rte.hv
|
||||
|
||||
# If you are using PESSL 4.2.0 or beyond, comment pessl.rte.smp,pessl.rte.rs1,and pessl.rte.common, they have been built into pessl.rte.up and pessl.rte.mp
|
||||
#I:pessl.rte.common
|
||||
#I:pessl.rte.smp
|
||||
#I:pessl.rte.rs1
|
||||
|
||||
#I:pessl.msg.En_US
|
||||
#I:pessl.man.en_US
|
||||
I:pessl.loc.license
|
||||
|
||||
@@ -1 +1,7 @@
|
||||
essl/ibm-java2-ppc64-jre
|
||||
|
||||
#ENV:IBM_ESSL_LICENSE_ACCEPT=yes#
|
||||
essl/essl*
|
||||
|
||||
#ENV:IBM_PESSL_LICENSE_ACCEPT=yes#
|
||||
essl/pessl*
|
||||
|
||||
@@ -8,62 +8,62 @@
|
||||
# Assumes all prerequisite software has been installed (e.g. compilers)
|
||||
|
||||
|
||||
OS=`uname`
|
||||
INSTALL_DIR='/install'
|
||||
ESSL_DIR=$essldir
|
||||
|
||||
if [ -z "$ESSL_DIR" ]; then
|
||||
# try to default
|
||||
ESSL_DIR=$INSTALL_DIR/post/otherpkgs/$OSVER/$ARCH/essl
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ $OS != "AIX" ]; then
|
||||
if [ $NODESETSTATE == "install" ] || [ $NODESETSTATE == "boot" ]; then
|
||||
# Being run from a stateful install postscript
|
||||
# Copy rpms directly from the xCAT management node and install
|
||||
mkdir -p /tmp/essl
|
||||
rm -f -R /tmp/essl/*
|
||||
cd /tmp/essl
|
||||
download_dir=`echo $ESSL_DIR | cut -d '/' -f3-`
|
||||
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=5 ftp://$SITEMASTER/$download_dir/*.rpm 2> /tmp/wget.log
|
||||
#rpm -Uvh essl.license*.rpm
|
||||
IBM_ESSL_LICENSE_ACCEPT=yes rpm -Uvh essl*.rpm
|
||||
#install_essl=`find /opt/ibmmath/essl -name install_essl -print`
|
||||
#if [ -n "$install_essl" ] ; then
|
||||
# $install_essl -y -d . -nodocs
|
||||
#fi
|
||||
#rpm -Uvh pessl.license*.rpm
|
||||
IBM_PESSL_LICENSE_ACCEPT=yes rpm -Uvh pessl*.rpm
|
||||
#install_pessl=`find /opt/ibmmath/pessl -name install_pessl -print`
|
||||
#if [ -n "$install_pessl" ] ; then
|
||||
# $install_pessl -y -d . -nodocs
|
||||
#fi
|
||||
rm -Rf /tmp/essl
|
||||
fi
|
||||
|
||||
if [ $NODESETSTATE == "genimage" ]; then
|
||||
# Being called from <image>.postinstall script
|
||||
# Assume we are on the same machine
|
||||
tmpdir=tmpessl
|
||||
mkdir $installroot/$tmpdir
|
||||
cp -p $ESSL_DIR/* $installroot/$tmpdir
|
||||
#rpm --root $installroot -Uvh $installroot/$tmpdir/essl.license*.rpm
|
||||
IBM_ESSL_LICENSE_ACCEPT=yes rpm --root $installroot -Uvh $installroot/$tmpdir/essl*.rpm
|
||||
cd $installroot
|
||||
#install_essl=`find opt/ibmmath/essl -name install_essl -print`
|
||||
#if [ -n "$install_essl" ] ; then
|
||||
# chroot $installroot /$install_essl -y -nodocs -d /$tmpdir
|
||||
#fi
|
||||
#rpm --root $installroot -Uvh $installroot/$tmpdir/pessl.license*.rpm
|
||||
IBM_PESSL_LICENSE_ACCEPT=yes rpm --root $installroot -Uvh $installroot/$tmpdir/pessl*.rpm
|
||||
#install_pessl=`find opt/ibmmath/pessl -name install_pessl -print`
|
||||
#if [ -n "$install_pessl" ] ; then
|
||||
# chroot $installroot /$install_pessl -y -nodocs -d /$tmpdir
|
||||
#fi
|
||||
rm -rf $installroot/$tmpdir
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
#OS=`uname`
|
||||
#INSTALL_DIR='/install'
|
||||
#ESSL_DIR=$essldir
|
||||
#
|
||||
#if [ -z "$ESSL_DIR" ]; then
|
||||
# # try to default
|
||||
# ESSL_DIR=$INSTALL_DIR/post/otherpkgs/$OSVER/$ARCH/essl
|
||||
#fi
|
||||
#
|
||||
#
|
||||
#
|
||||
#if [ $OS != "AIX" ]; then
|
||||
# if [ $NODESETSTATE == "install" ] || [ $NODESETSTATE == "boot" ]; then
|
||||
# # Being run from a stateful install postscript
|
||||
# # Copy rpms directly from the xCAT management node and install
|
||||
# mkdir -p /tmp/essl
|
||||
# rm -f -R /tmp/essl/*
|
||||
# cd /tmp/essl
|
||||
# download_dir=`echo $ESSL_DIR | cut -d '/' -f3-`
|
||||
# wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=5 ftp://$SITEMASTER/$download_dir/*.rpm 2> /tmp/wget.log
|
||||
# #rpm -Uvh essl.license*.rpm
|
||||
# IBM_ESSL_LICENSE_ACCEPT=yes rpm -Uvh essl*.rpm
|
||||
# #install_essl=`find /opt/ibmmath/essl -name install_essl -print`
|
||||
# #if [ -n "$install_essl" ] ; then
|
||||
# # $install_essl -y -d . -nodocs
|
||||
# #fi
|
||||
# #rpm -Uvh pessl.license*.rpm
|
||||
# IBM_PESSL_LICENSE_ACCEPT=yes rpm -Uvh pessl*.rpm
|
||||
# #install_pessl=`find /opt/ibmmath/pessl -name install_pessl -print`
|
||||
# #if [ -n "$install_pessl" ] ; then
|
||||
# # $install_pessl -y -d . -nodocs
|
||||
# #fi
|
||||
# rm -Rf /tmp/essl
|
||||
# fi
|
||||
#
|
||||
# if [ $NODESETSTATE == "genimage" ]; then
|
||||
# # Being called from <image>.postinstall script
|
||||
# # Assume we are on the same machine
|
||||
# tmpdir=tmpessl
|
||||
# mkdir $installroot/$tmpdir
|
||||
# cp -p $ESSL_DIR/* $installroot/$tmpdir
|
||||
# #rpm --root $installroot -Uvh $installroot/$tmpdir/essl.license*.rpm
|
||||
# IBM_ESSL_LICENSE_ACCEPT=yes rpm --root $installroot -Uvh $installroot/$tmpdir/essl*.rpm
|
||||
# cd $installroot
|
||||
# #install_essl=`find opt/ibmmath/essl -name install_essl -print`
|
||||
# #if [ -n "$install_essl" ] ; then
|
||||
# # chroot $installroot /$install_essl -y -nodocs -d /$tmpdir
|
||||
# #fi
|
||||
# #rpm --root $installroot -Uvh $installroot/$tmpdir/pessl.license*.rpm
|
||||
# IBM_PESSL_LICENSE_ACCEPT=yes rpm --root $installroot -Uvh $installroot/$tmpdir/pessl*.rpm
|
||||
# #install_pessl=`find opt/ibmmath/pessl -name install_pessl -print`
|
||||
# #if [ -n "$install_pessl" ] ; then
|
||||
# # chroot $installroot /$install_pessl -y -nodocs -d /$tmpdir
|
||||
# #fi
|
||||
# rm -rf $installroot/$tmpdir
|
||||
# fi
|
||||
#fi
|
||||
#
|
||||
#
|
||||
|
||||
@@ -2,3 +2,9 @@ gpfs/gpfs.base
|
||||
gpfs/gpfs.gpl
|
||||
gpfs/gpfs.gplbin*
|
||||
gpfs/gpfs.msg.en_US
|
||||
|
||||
# List additinal package names in comments to reduce image size
|
||||
# uncomment them if they are necessary for you
|
||||
#gpfs/gpfs.gnr
|
||||
#gpfs/gpfs.docs
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
gpfs/gpfs.base
|
||||
gpfs/gpfs.gpl
|
||||
gpfs/gpfs.gplbin*
|
||||
gpfs/gpfs.msg.en_US
|
||||
|
||||
# List additinal package names in comments to reduce image size
|
||||
# uncomment them if they are necessary for you
|
||||
#gpfs/gpfs.gnr
|
||||
#gpfs/gpfs.docs
|
||||
|
||||
@@ -2,3 +2,8 @@ gpfs/gpfs.base
|
||||
gpfs/gpfs.gpl
|
||||
gpfs/gpfs.gplbin*
|
||||
gpfs/gpfs.msg.en_US
|
||||
|
||||
# List additinal package names in comments to reduce image size
|
||||
# uncomment them if they are necessary for you
|
||||
#gpfs/gpfs.gnr
|
||||
#gpfs/gpfs.docs
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
gpfs/gpfs.base
|
||||
gpfs/gpfs.gpl
|
||||
gpfs/gpfs.gplbin*
|
||||
gpfs/gpfs.msg.en_US
|
||||
|
||||
# List additinal package names in comments to reduce image size
|
||||
# uncomment them if they are necessary for you
|
||||
#gpfs/gpfs.gnr
|
||||
#gpfs/gpfs.docs
|
||||
|
||||
@@ -1,132 +1,18 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
# xCAT postscript to configure GPFS on a compute node.
|
||||
# Before booting nodes with this postscript, gpfs must be up and configured correctly on the node
|
||||
# pointed to by the -p flag below. The $MASTER environment variable will be set by xCAT to
|
||||
# the service node or management node of this booting node. If you want the nodes to get their
|
||||
# GPFS configuration from a different node, replace $MASTER with that IP address.
|
||||
|
||||
# Run this script to sync the GPFS mmsdrfs file into the node images
|
||||
# Set the SOURCE, TARGETDIR, IMAGE, and SERVICE variables appropriately
|
||||
cmd="/usr/lpp/mmfs/bin/mmsdrrestore -p $MASTER -R /usr/bin/scp"
|
||||
$cmd > /dev/null 2>&1
|
||||
|
||||
# Usage: gpfs_mmsdrfs [packimage|liteimg] [syncinstall]
|
||||
# For Linux, if packimage or liteimg specified,
|
||||
# will run that command for the image if rsync updated any
|
||||
# destination files
|
||||
# If syncinstall specified, and if site.install_loc is blank,
|
||||
# sync the /install directory to the SERVICE noderange
|
||||
# if rysnc updated any destination files
|
||||
#
|
||||
# To keep your diskless images current with any GPFS changes, run this
|
||||
# script periodically from cron using the packimage/liteimg and
|
||||
# syncinstall options as required by your cluster
|
||||
#
|
||||
|
||||
# The source server:location of the mmsdrfs file. Default is this xCAT MN.
|
||||
#SOURCE=gpfsmgr:/var/mmfs/gen/mmsdrfs
|
||||
SOURCE=/var/mmfs/gen/mmsdrfs
|
||||
|
||||
# The target directory on the xCAT MN that holds the master copy
|
||||
TARGETDIR=/install/mmfs/gen
|
||||
|
||||
# The noderange for service nodes
|
||||
SERVICE=service
|
||||
|
||||
# The images to be updated (list as many as needed)
|
||||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
# EDIT HERE TO SPECIFY IMAGES TO BE UPDATED!!!
|
||||
# default is to update all images !!!
|
||||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
IMAGE[1]=ALL_IMAGES
|
||||
#IMAGE[1]=sles11-ppc64-netboot-service
|
||||
#IMAGE[2]=sles11-ppc64-netboot-compute
|
||||
|
||||
|
||||
|
||||
|
||||
# If $installroot is set, then this script was called from genimage
|
||||
# Ignore all IMAGE variables and only rsync to $installroot
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
OS=`uname`
|
||||
if [[ "$OS" != "AIX" ]]; then
|
||||
rsync -i -t $SOURCE $installroot/var/mmfs/gen/mmsdrfs
|
||||
exit
|
||||
fi
|
||||
if [[ $? != 0 ]]
|
||||
then
|
||||
echo "mmsdrrestore failed!"
|
||||
exit 2
|
||||
else
|
||||
echo "mmsdrrestore succeeded"
|
||||
fi
|
||||
|
||||
|
||||
# rsync the GPFS config file to the MN
|
||||
# DEVELOPER NOTE: Keep all code above this rsync call as short
|
||||
# and efficient as possible.
|
||||
# This script may be frequently called from cron.
|
||||
if [ ! -d $TARGETDIR ]; then
|
||||
mkdir -p $TARGETDIR
|
||||
fi
|
||||
result=`rsync -i -t $SOURCE $TARGETDIR/mmsdrfs`
|
||||
r1=`echo $result | cut -c1`
|
||||
if [ "$r1" == ">" ]; then
|
||||
OS=`uname`
|
||||
packcmd=""
|
||||
syncinstall=""
|
||||
if [ "$1" == "packimage" ] || [ "$1" == "liteimg" ]; then
|
||||
packcmd=$1
|
||||
fi
|
||||
if [ "$1" == "syncinstall" ] || [ "$2" == "syncinstall" ]; then
|
||||
if [ -z "`/opt/xcat/bin/nodels $SERVICE`" ]; then
|
||||
SERVICE=""
|
||||
fi
|
||||
installloc=`/opt/xcat/bin/gettab key=installloc site.value`
|
||||
if [ -z "$installloc" ]; then
|
||||
syncinstall="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "${IMAGE[1]}" || "${IMAGE[1]}" == "ALL_IMAGES" ]]; then
|
||||
if [ $OS = "AIX" ]; then
|
||||
imgtable="nimimage"
|
||||
else
|
||||
imgtable="linuximage"
|
||||
fi
|
||||
IMAGE=(`tabdump $imgtable | cut -d, -f1 | grep -v '#' | tr -d '"'`)
|
||||
fi
|
||||
if [ $OS = "AIX" ]; then
|
||||
# do AIX stuff
|
||||
updates=""
|
||||
for syncimage in ${IMAGE[@]}; do
|
||||
spot=`/opt/xcat/bin/gettab imagename=$syncimage nimimage.spot`
|
||||
if [ -n "$spot" ]; then
|
||||
dest=`lsnim -Z -a location $spot | grep -v '#' | cut -f2 -d':' `
|
||||
if [ -n "$dest" ]; then
|
||||
mkdir -p $dest/lpp/bos/inst_root/var/mmfs/gen
|
||||
cp $TARGETDIR/mmsdrfs $dest/lpp/bos/inst_root/var/mmfs/gen/mmsdrfs
|
||||
if [[ -n "$syncinstall" && -n "$SERVICE" ]]; then
|
||||
/opt/xcat/bin/xdcp $SERVICE $TARGETDIR/mmsdrfs $dest/lpp/bos/inst_root/var/mmfs/gen
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
shared_root=`/opt/xcat/bin/gettab imagename=$syncimage nimimage.shared_root`
|
||||
if [ -n "$shared_root" ]; then
|
||||
dest=`lsnim -Z -a location $shared_root | grep -v '#' | cut -f2 -d':' `
|
||||
if [ -n "$dest" ]; then
|
||||
mkdir -p $dest/var/mmfs/gen
|
||||
cp $TARGETDIR/mmsdrfs $dest/var/mmfs/gen/mmsdrfs
|
||||
if [[ -n "$syncinstall" && -n "$SERVICE" ]]; then
|
||||
/opt/xcat/bin/xdcp $SERVICE $TARGETDIR/mmsdrfs $dest/var/mmfs/gen
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
else # do Linux stuff
|
||||
updates=""
|
||||
for syncimage in ${IMAGE[@]}; do
|
||||
dest=`/opt/xcat/bin/gettab imagename=$syncimage linuximage.rootimgdir`
|
||||
if [ -n "$dest" ]; then
|
||||
dest=$dest/rootimg/var/mmfs/gen/mmsdrfs
|
||||
cp $TARGETDIR/mmsdrfs $dest
|
||||
if [ -n "$packcmd" ]; then
|
||||
updates="yes"
|
||||
/opt/xcat/sbin/$packcmd $syncimage
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$updates" ] && [ -n "$syncinstall" ] && [ -n "$SERVICE" ]; then
|
||||
xdcp $SERVICE -r /usr/bin/rsync -o '-e ssh -craz' /install/netboot /install/netboot
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -58,7 +58,7 @@ if [ $OS != "AIX" ]; then
|
||||
# For SLES, assume zypper is available on the system running genimage
|
||||
zypper -R $installroot ar file:$INSTALL_DIR/$UPDATES_DIR gpfs_updates
|
||||
# zypper -R $installroot install gpfs.gplbin*
|
||||
zypper -R $installroot update gpfs*
|
||||
zypper --non-interactive -R $installroot update gpfs*
|
||||
zypper -R $installroot rr gpfs_updates
|
||||
else
|
||||
# For Redhat, etc., assume yum is available on the system running genimage
|
||||
@@ -68,27 +68,26 @@ if [ $OS != "AIX" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Create an empty nsddevices script for GPFS
|
||||
# This assumes that the node is NOT an NSD server
|
||||
if [ $OS == "AIX" ]; then
|
||||
# Create the script on the node
|
||||
mkdir -p $installroot/var/mmfs/etc
|
||||
echo 'return 0' > $installroot/var/mmfs/etc/nsddevices
|
||||
chmod 744 $installroot/var/mmfs/etc/nsddevices
|
||||
else # assume Linux
|
||||
if [ $NODESETSTATE == "genimage" ]; then
|
||||
# Create the script in the image
|
||||
mkdir -p $installroot/var/mmfs/etc
|
||||
echo 'return 0' > $installroot/var/mmfs/etc/nsddevices
|
||||
chmod 744 $installroot/var/mmfs/etc/nsddevices
|
||||
else
|
||||
# Create the script on the node
|
||||
mkdir -p /var/mmfs/etc
|
||||
echo 'return 0' > /var/mmfs/etc/nsddevices
|
||||
chmod 744 /var/mmfs/etc/nsddevices
|
||||
fi
|
||||
fi
|
||||
## Create an empty nsddevices script for GPFS
|
||||
## This assumes that the node is NOT an NSD server
|
||||
#if [ $OS == "AIX" ]; then
|
||||
# # Create the script on the node
|
||||
# mkdir -p $installroot/var/mmfs/etc
|
||||
# echo 'return 0' > $installroot/var/mmfs/etc/nsddevices
|
||||
# chmod 744 $installroot/var/mmfs/etc/nsddevices
|
||||
#else # assume Linux
|
||||
# if [ $NODESETSTATE == "genimage" ]; then
|
||||
# # Create the script in the image
|
||||
# mkdir -p $installroot/var/mmfs/etc
|
||||
# echo 'return 0' > $installroot/var/mmfs/etc/nsddevices
|
||||
# chmod 744 $installroot/var/mmfs/etc/nsddevices
|
||||
# else
|
||||
# # Create the script on the node
|
||||
# mkdir -p /var/mmfs/etc
|
||||
# echo 'return 0' > /var/mmfs/etc/nsddevices
|
||||
# chmod 744 /var/mmfs/etc/nsddevices
|
||||
# fi
|
||||
#fi
|
||||
|
||||
|
||||
# Add GPFS path to profile
|
||||
@@ -104,12 +103,12 @@ else # assume Linux
|
||||
fi
|
||||
if [ ! -e $gpfsprofile.sh ]; then
|
||||
echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh
|
||||
echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh
|
||||
echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh
|
||||
# Turn off LANG support since we did not install other msg catalogs
|
||||
echo 'export LC_CTYPE=POSIX' $gpfsprofile.sh
|
||||
echo 'export LC_CTYPE=POSIX' $gpfsprofile.csh
|
||||
echo 'export LC_ALL=POSIX' $gpfsprofile.sh
|
||||
echo 'export LC_ALL=POSIX' $gpfsprofile.csh
|
||||
echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh
|
||||
echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh
|
||||
echo 'export LC_ALL=POSIX' >> $gpfsprofile.sh
|
||||
echo 'setenv LC_ALL POSIX' >> $gpfsprofile.csh
|
||||
chmod 744 $gpfsprofile.sh
|
||||
chmod 744 $gpfsprofile.csh
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#image,file,options,comments,disable
|
||||
"ALL","/var/mmfs/","persistent","for GPFS",
|
||||
"ALL","/var/mmfs/","tmpfs","for GPFS",
|
||||
"ALL","/var/adm/ras/","persistent","for GPFS",
|
||||
"ALL","/gpfs/",,"for GPFS",
|
||||
|
||||
|
@@ -0,0 +1,4 @@
|
||||
#ENV:IBM_LOADL_LICENSE_ACCEPT=yes#
|
||||
loadl/LoadL-full-license*
|
||||
#loadl/LoadL-scheduler-full*
|
||||
loadl/LoadL-resmgr-full*
|
||||
@@ -101,12 +101,12 @@ else # assume Linux
|
||||
fi
|
||||
if [ ! -e $loadlprofile.sh ]; then
|
||||
echo "export PATH=\$PATH:$linux_loadl_bin" > $loadlprofile.sh
|
||||
echo "export PATH=\$PATH:$linux_loadl_bin" > $loadlprofile.csh
|
||||
echo "setenv PATH \$PATH:$linux_loadl_bin" > $loadlprofile.csh
|
||||
# Turn off LANG support since we did not install other msg catalogs
|
||||
echo 'export LC_CTYPE=POSIX' $loadlprofile.sh
|
||||
echo 'export LC_CTYPE=POSIX' $loadlprofile.csh
|
||||
echo 'export LC_ALL=POSIX' $loadlprofile.sh
|
||||
echo 'export LC_ALL=POSIX' $loadlprofile.csh
|
||||
echo 'export LC_CTYPE=POSIX' > $loadlprofile.sh
|
||||
echo 'setenv LC_CTYPE POSIX' > $loadlprofile.csh
|
||||
echo 'export LC_ALL=POSIX' > $loadlprofile.sh
|
||||
echo 'setenv LC_ALL POSIX' > $loadlprofile.csh
|
||||
chmod 744 $loadlprofile.sh
|
||||
chmod 744 $loadlprofile.csh
|
||||
fi
|
||||
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Sample script to accept license and install LoadLeveler resmgr package
|
||||
# and perform additional customizations
|
||||
# For AIX:
|
||||
# add LL path to profile
|
||||
# create directories for LL log, spool, etc.
|
||||
# For Linux:
|
||||
# Add LL bin directory to PATH in default profile (modify "linux_loadl_bin"
|
||||
# if using a different LL bin location)
|
||||
# Create LL log directories (modify "logdir" if not using /var/loadl)
|
||||
# Change the owner of these directories (modify "loadl_admin" and
|
||||
# "loadl_group" if not using loadl:loadl)
|
||||
# If run from genimage, copy in /etc/LoadL.cfg from MN into image
|
||||
#
|
||||
|
||||
OS=`uname`
|
||||
|
||||
####
|
||||
# Linux Note: This script only installs the LoadL_resmgr_full rpm
|
||||
# To also install the LoadL_scheduler rpm, remove the "-c resmgr"
|
||||
# option from the line below
|
||||
# Also, change the bin path below to the correct directory
|
||||
####
|
||||
linux_loadl_bin=/opt/ibmll/LoadL/resmgr/full/bin
|
||||
|
||||
####
|
||||
# For AIX, the LoadLeveler lpps are listed in the loadl.bnd bundle file
|
||||
# By default, it will only install the LoadL.resmgr package
|
||||
# To install the full LoadLeveler product, edit that bundle file
|
||||
# and change the bin path below to the correct directory
|
||||
####
|
||||
aix_loadl_bin=/usr/lpp/LoadL/resmgr/full/bin
|
||||
|
||||
|
||||
logdir=/var/loadl
|
||||
loadl_admin=loadl
|
||||
loadl_group=loadl
|
||||
|
||||
|
||||
if [ $OS != "AIX" ]; then
|
||||
if [ $NODESETSTATE == "install" ] || [ $NODESETSTATE == "boot" ]; then
|
||||
groupadd $loadl_group
|
||||
useradd -g $loadl_group $loadl_admin
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Add LoadLeveler path to profile
|
||||
if [ "$OS" == "AIX" ]; then
|
||||
# add to /etc/profile
|
||||
if ! grep 'LoadL' /etc/profile > /dev/null 2>&1 ; then
|
||||
echo "export PATH=\$PATH:$aix_loadl_bin" >> /etc/profile
|
||||
fi
|
||||
# UNCOMMENT to add to /etc/inittab if not already in image
|
||||
#if ! grep 'loadl' /etc/inittab ; then
|
||||
# echo "loadl:2:once:/usr/lpp/LoadL/resmgr/full/bin/llrctl start > /dev/console 2>&1" >> /etc/inittab
|
||||
#fi
|
||||
|
||||
|
||||
else # assume Linux
|
||||
loadlprofile=/etc/profile.d/loadl
|
||||
if [ $NODESETSTATE == "genimage" ]; then
|
||||
loadlprofile=$installroot$loadlprofile
|
||||
fi
|
||||
if [ ! -e $loadlprofile.sh ]; then
|
||||
echo "export PATH=\$PATH:$linux_loadl_bin" > $loadlprofile.sh
|
||||
echo "setenv PATH \$PATH:$linux_loadl_bin" > $loadlprofile.csh
|
||||
# Turn off LANG support since we did not install other msg catalogs
|
||||
echo 'export LC_CTYPE=POSIX' > $loadlprofile.sh
|
||||
echo 'setenv LC_CTYPE POSIX' > $loadlprofile.csh
|
||||
echo 'export LC_ALL=POSIX' > $loadlprofile.sh
|
||||
echo 'setenv LC_ALL POSIX' > $loadlprofile.csh
|
||||
chmod 744 $loadlprofile.sh
|
||||
chmod 744 $loadlprofile.csh
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Create LoadLeveler Directories:
|
||||
# For stateless nodes, these directories need to be created in the image
|
||||
# since they will be in memory only, and will be lost on node reboot.
|
||||
# You may choose to modify this approach and use a more
|
||||
# persistent location.
|
||||
# For statelite, make sure the directory is writable;
|
||||
# this will also be a memory-only copy of the files unless you set
|
||||
# the directory "persistent" in the statelite table.
|
||||
if [ $NODESETSTATE != "genimage" ]; then
|
||||
# running as a postscript in a full-disk install or AIX diskless install
|
||||
installroot=""
|
||||
fi
|
||||
mkdir -p $installroot$logdir/execute
|
||||
mkdir -p $installroot$logdir/spool
|
||||
mkdir -p $installroot$logdir/log
|
||||
mkdir -p $installroot$logdir/sockets
|
||||
mkdir -p $installroot$logdir/core
|
||||
chmod 700 $installroot$logdir/spool
|
||||
chmod 1777 $installroot$logdir/execute
|
||||
chmod 775 $installroot$logdir/log
|
||||
chmod 777 $installroot$logdir/sockets
|
||||
chmod 777 $installroot$logdir/core
|
||||
|
||||
# Owner set to 'loadl' userid, change if using a different userid
|
||||
chown -R $loadl_admin:$loadl_group $installroot$logdir/
|
||||
|
||||
# UNCOMMENT to let llcompute.sh/llserver.sh to create /etc/LoadL.cfg
|
||||
#if [ "$NODESETSTATE" == "genimage" ] && [ -f /etc/LoadL.cfg ] ; then
|
||||
# cp /etc/LoadL.cfg $installroot/etc/LoadL.cfg
|
||||
#fi
|
||||
|
||||
|
||||
# UNCOMMENT to Start loadleveler during postscripts
|
||||
#if [ $NODESETSTATE != "genimage" ]; then
|
||||
# /usr/lpp/LoadL/resmgr/full/bin/llrctl start
|
||||
#fi
|
||||
|
||||
@@ -55,7 +55,7 @@ installroot=$installroot pedir=$otherpkgs/pe NODESETSTATE=genimage $hpc/pe/pe_
|
||||
|
||||
|
||||
# Run script to install ESSL and PESSL rpms
|
||||
installroot=$installroot essldir=$otherpkgs/essl NODESETSTATE=genimage $hpc/essl/essl_install
|
||||
#installroot=$installroot essldir=$otherpkgs/essl NODESETSTATE=genimage $hpc/essl/essl_install
|
||||
|
||||
|
||||
# Run script to accept LoadLeveler license, install product rpms,
|
||||
|
||||
@@ -55,7 +55,7 @@ installroot=$installroot pedir=$otherpkgs/pe NODESETSTATE=genimage $hpc/pe/pe_
|
||||
|
||||
|
||||
# Run script to install ESSL and PESSL rpms
|
||||
installroot=$installroot essldir=$otherpkgs/essl NODESETSTATE=genimage $hpc/essl/essl_install
|
||||
#installroot=$installroot essldir=$otherpkgs/essl NODESETSTATE=genimage $hpc/essl/essl_install
|
||||
|
||||
|
||||
# Run script to accept LoadLeveler license, install product rpms,
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/ksh
|
||||
|
||||
#
|
||||
# example postscript to tune ml interface for improved stability and performance
|
||||
#
|
||||
|
||||
chdev -l mlt0 -a agg_killtime=-1 2>/dev/null # allow "agg_interval" and "agg_threshold" to default
|
||||
|
||||
# The effect of the above is that complete ml route entries last forever, incomplete entries time out
|
||||
# in 40 seconds, and there are no keepalive probes for complete entries (to reduce OS jitter).
|
||||
|
||||
# The following is also recommended to improve balance across hf interfaces (assuming sequential ml
|
||||
# addressing, at least within each drawer). Note that "agg_hash" must be set PRIOR to the ml interface
|
||||
# being configured.
|
||||
|
||||
chdev -l mlt0 -a agg_hash=2 2>/dev/null
|
||||
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Checkpoint/Restart related environment setup
|
||||
|
||||
# virtualized pts support
|
||||
rm -f /dev/ptmx
|
||||
ln -s /dev/pts/ptmx /dev/ptmx
|
||||
chmod 666 /dev/ptmx
|
||||
|
||||
# unlinked file support
|
||||
for fs in ext3 ext4 nfs gpfs tmpfs; do
|
||||
FSROOTS=$(grep " $fs " /proc/mounts | cut -d ' ' -f 2)
|
||||
if [ "$FSROOTS" ]; then
|
||||
for rootfs in $FSROOTS; do
|
||||
if [ -w $rootfs ]; then
|
||||
CKPTDIR="$rootfs/lost+found"
|
||||
|
||||
[ -e $CKPTDIR ] && [ ! -d $CKPTDIR ] && rm -f $CKPTDIR
|
||||
|
||||
if [ ! -e $CKPTDIR ]; then
|
||||
mkdir -p $CKPTDIR
|
||||
[ "$?" -eq "0" ] && echo "made dir $CKPTDIR"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# Read checkpoint key from rootfs which generated by xCAT postinstall script
|
||||
if [ -f /root/.ckpt.key ]; then
|
||||
cat /root/.ckpt.key > /sys/kernel/checkpoint/checksum_key
|
||||
else
|
||||
echo 'ERROR: no checkpoint key found'
|
||||
fi
|
||||
@@ -12,6 +12,5 @@ I:ppe.loc.license
|
||||
#I:ppedev.hpct
|
||||
|
||||
# MetaCluster (checkpoint/restore)
|
||||
I:mcr.rte
|
||||
I:mdcr
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# AIX bundle package list for PE
|
||||
|
||||
# POE
|
||||
#I:ppe.man
|
||||
I:ppe.rte
|
||||
I:ppe.loc.license
|
||||
|
||||
# PE HPC toolkit, needed on login node
|
||||
#I:ppedev.hpct
|
||||
@@ -0,0 +1,10 @@
|
||||
./opt/ibmhpc/lapi/include*
|
||||
./opt/ibmhpc/lapi/pnsd/include*
|
||||
./opt/ibmhpc/lapi/samples*
|
||||
|
||||
./opt/ibmhpc/pecurrent/ppe.poe/include*
|
||||
./opt/ibmhpc/pecurrent/ppe.poe/man/*
|
||||
./opt/ibmhpc/pecurrent/ppe.poe/samples*
|
||||
./opt/ibmhpc/pecurrent/hal/include*
|
||||
./etc/opt/ibmhpc/license/*.txt
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
pe/src
|
||||
pe/ibm_openshmem_*
|
||||
pe/ppe_rte_*
|
||||
pe/ppe-rte-*
|
||||
|
||||
#ENV:IBM_PPE_RTE_LICENSE_ACCEPT=yes#
|
||||
pe/ppe_rte_license*
|
||||
|
||||
#ENV:INUCLIENTS=1#
|
||||
#ENV:INUBOSTYPE=1#
|
||||
pe/pperteman*
|
||||
pe/pperterh6x*
|
||||
pe/ppertesamples*
|
||||
|
||||
# PE HPC toolkit needed on login node
|
||||
#pe/ppedev_hpct_*
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# The following are for systems running InfiniBand networks
|
||||
# You should comment out these packages when running with HFI,
|
||||
libibverbs
|
||||
libibverbs-32bit
|
||||
@@ -0,0 +1,19 @@
|
||||
pe/src
|
||||
#pe/libbsr
|
||||
|
||||
#ENV:IBM_PPE_RTE_LICENSE_ACCEPT=yes#
|
||||
pe/ppe_rte_license*
|
||||
|
||||
pe/pperteman*
|
||||
pe/pperterh6p*
|
||||
pe/ppertesamples*
|
||||
|
||||
# PE HPC toolkit needed on login node
|
||||
# ENV:IBM_PPEDEV_LICENSE_ACCEPT=yes#
|
||||
#pe/ppedev_license*
|
||||
#pe/ppedev_hpct_*
|
||||
#pe/ppedev_runtime*
|
||||
|
||||
# Checkpoint/restart function support
|
||||
#pe/user-cr
|
||||
#pe/lxc
|
||||
@@ -0,0 +1,4 @@
|
||||
# The following are for RHEL6 systems running InfiniBand networks
|
||||
# You should comment out these packages when running with HFI,
|
||||
libibverbs.ppc
|
||||
libibverbs.ppc64
|
||||
@@ -0,0 +1,14 @@
|
||||
pe/src
|
||||
|
||||
#ENV:IBM_PPE_RTE_LICENSE_ACCEPT=yes#
|
||||
pe/ppe_rte_license*
|
||||
|
||||
pe/pperteman*
|
||||
pe/pperterh6x*
|
||||
pe/ppertesamples*
|
||||
|
||||
# PE HPC toolkit needed on login node
|
||||
# ENV:IBM_PPEDEV_LICENSE_ACCEPT=yes#
|
||||
#pe/ppedev_license*
|
||||
#pe/ppedev_hpct_*
|
||||
#pe/ppedev_runtime*
|
||||
@@ -0,0 +1,14 @@
|
||||
pe/src
|
||||
|
||||
#ENV:IBM_PPE_RTE_LICENSE_ACCEPT=yes#
|
||||
pe/ppe_rte_license*
|
||||
|
||||
pe/pperteman*
|
||||
pe/ppertesles11p*
|
||||
pe/ppertesamples*
|
||||
|
||||
# PE HPC toolkit needed on login node
|
||||
# ENV:IBM_PPEDEV_LICENSE_ACCEPT=yes#
|
||||
#pe/ppedev_license*
|
||||
#pe/ppedev_hpct_*
|
||||
#pe/ppedev_runtime*
|
||||
@@ -0,0 +1,4 @@
|
||||
# The following are for SLES11 systems running InfiniBand networks
|
||||
# You should comment out these packages when running with HFI,
|
||||
libibverbs
|
||||
libibverbs-32bit
|
||||
@@ -0,0 +1,14 @@
|
||||
pe/src
|
||||
|
||||
#ENV:IBM_PPE_RTE_LICENSE_ACCEPT=yes#
|
||||
pe/ppe_rte_license*
|
||||
|
||||
pe/pperteman*
|
||||
pe/ppertesles11x*
|
||||
pe/ppertesamples*
|
||||
|
||||
# PE HPC toolkit needed on login node
|
||||
# ENV:IBM_PPEDEV_LICENSE_ACCEPT=yes#
|
||||
#pe/ppedev_license*
|
||||
#pe/ppedev_hpct_*
|
||||
#pe/ppedev_runtime*
|
||||
Executable → Regular
+2
-3
@@ -1,4 +1,3 @@
|
||||
|
||||
# The following are for systems running InfiniBand networks
|
||||
##############
|
||||
# Temporary for xCAT 2.6:
|
||||
@@ -6,5 +5,5 @@
|
||||
# but you will also then need to use the xCAT 2.6 pe_install script
|
||||
# that does a force install of pe. The current pe packages prereq
|
||||
# these libibverbs packages.
|
||||
libibverbs.ppc
|
||||
libibverbs.ppc64
|
||||
libibverbs
|
||||
libibverbs-32bit
|
||||
@@ -1,20 +1,13 @@
|
||||
# AIX bundle package list for PE
|
||||
|
||||
# POE
|
||||
I:ppe.poe
|
||||
I:ppe.pdb
|
||||
I:ppe.rte
|
||||
#I:ppe.man
|
||||
I:ppe.loc.license
|
||||
|
||||
# needed on login node
|
||||
#I:ppe.hpct
|
||||
#I:ppedev.hpct
|
||||
|
||||
# LAPI
|
||||
I:rsct.lapi
|
||||
#I:rsct.lapi
|
||||
#I:rsct.sci
|
||||
|
||||
# MetaCluster (checkpoint/restore)
|
||||
I:mcr.rte
|
||||
I:mdcr
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user