ãã®èšäºã§ã¯ãä»®æ³ãã·ã³ã¡ããªãã¯ã®åéãåŠçãä¿åã«äœ¿çšãããã³ã³ããŒãã³ãã«ã€ããŠèª¬æããVPCãããžã§ã¯ãã§ãããã®ã³ã³ããŒãã³ãã䜿çšããæ¹æ³ã®äŸã瀺ããŸãã
ã¡ããªãã¯ãšãã®åæåŠçãååŸããã«ã¯ã OpenStack Ceilometerã³ã³ããŒãã³ãã責任ãè² ããŸãã
é·ãéããã¹ãŠã®åºæ¬çãªãã¬ã¡ããªæ©èœãæäŸããå¯äžã®OpenStackã³ã³ããŒãã³ãã§ããã
ãã®åŸãéçºè ã¯Ceilometeræ©èœãããã€ãã®è£œåã«åå²ããŸããã
- Aodh-ã¢ã©ãŒããµãŒãã¹ã
- Gnocchi-éèšããã枬å®å€ã®ã¹ãã¬ãŒãžãµãŒãã¹ã
- Panko-ã€ãã³ãã«é¢ããæ å ±ãä¿åãããµãŒãã¹ã
- Ceilometerã¯ã枬å®åéãµãŒãã¹ã§ãã
AodhãšPankoã¯ãã®èšäºã®ç¯å²å€ã§ãã
枬å®ã³ã¬ã¯ã·ã§ã³-OpenStack Ceilometer
Ceilometerã¯ãCPUãRAMããããã¯ãŒã¯ã€ã³ã¿ãŒãã§ã€ã¹ããã£ã¹ã¯ã枩床å€ã®äœ¿çšã«é¢ãã枬å®å€ãããŸããŸãªãœãŒã¹ããåéã§ããŸãã
- ãã€ããŒãã€ã¶ãŒããçŽæ¥ïŒ KVM ã Hyper-V ã XEN ã VMware ïŒ;
- ã¡ãã»ãŒãžãã¥ãŒïŒ RabbitMQ ã ZeroMQ ã Kafka ïŒãã;
- REST APIãä»ããŠä»ã®OpenStackã³ã³ããŒãã³ããããŒãªã³ã°ããããšã«ãã
- SNMPãŸãã¯IPMIã䜿çšããŠæ©åšãããŒãªã³ã°ããã
Ceilometerã¯ä»¥åãåéããããã£ã¡ã³ã·ã§ã³ãã¡ããªãã¯ãããã³ãªãœãŒã¹ãæäœããããã®APIãæäŸããŠããŸããã ãã ãã OpenStack Ocataã®ãªãªãŒã¹ä»¥éãCeilometerã®ã¡ã€ã³ããã¯ãšã³ãã¯Gnocchiã§ãã£ãããã察å¿ããæ©èœã¯ãã®ã³ã³ããŒãã³ãããåé€ãããŸãããGnocchiã¯ãããããã¹ãŠã®ãªããžã§ã¯ããæäœããç¬èªã®å®å šæ©èœAPIãåããŠããŸãã
æ°å¹Žåã«OpenStack JunoãªãªãŒã¹ã®Ceilometerã䜿çšããŠã¿ãŸããã
VPCãããžã§ã¯ãã®è«æ±ã®æåã®ããŒãžã§ã³ã§ã¯ãã¬ããŒããéä¿¡ããŸãããã¬ããŒãã¯ããŠãŒãã£ãªãã£ããã°ã©ã ãšãæšæºã®OpenStack KeystoneããŒã¯ã³ã䜿çšããŠæ¿èªããããŠãŒã¶ãŒã®äž¡æ¹ãå©çšã§ããŸããã
åœæã®Ceilometerã®äž»ãªããã¯ãšã³ãã¯ãSQLããŒã¿ããŒã¹ãšMongoDBã§ããã æ®å¿µãªããã6ãæ䜿çšããåŸã®äž¡æ¹ã®ãªãã·ã§ã³ã¯è² è·ã«å¯ŸåŠããã®ããããŸããã ããã¯ãåéãããããŒã¿ã®æ§é ãããŸãã«ãããããã€ã³ããã¯ã¹ä»ãã§ããã詳现ãããããã§ãã
åãã£ã¡ã³ã·ã§ã³ã¯ãéèšãå€æŽãªãã§å ã®åœ¢åŒã§ä¿åãããŸããã 倧éã®ããŒã¿ã§ã¯ãäžå®æéã®ãµã³ããªã³ã°æž¬å®ã®åçŽãªæäœã«éåžžã«é·ãæéããããå§ãããµãŒãã¹ã䜿çšã§ããªããªããŸããã
2014幎ã«ã¢ãŒããã¯ãã£äžã®åé¡ãå æããããã«ãOpenStackã®ãã¬ã¡ããªãµãŒãã¹éçºè ããŒã ã¯ãGnocchiãšåŒã°ããæ°ãããããžã§ã¯ããç«ã¡äžããŸããã çç±ã®è©³çŽ°ãªèª¬æãšéžæããã解決æ¹æ³ã¯ãGnocchi-Julien Danjouã®äž»èŠéçºè ã®ããã°ã®ã¬ãã¥ãŒããŒãã«ãããŸãïŒ OpenStack Ceilometer and the Gnocchi experiment ã
Ceilometerã®ã¢ãŒããã¯ãã£
Ceilometerã®ã¢ãŒããã¯ãã£ã¯ãå³ã«æ確ã«ç€ºãããŠããŸãã
ãã€ããŒãã€ã¶ãŒãã€ã³ã¹ããŒã«ãããŠããåãã¹ãã«ã¯ãä»®æ³ãã·ã³ããããŒã¿ãåéããCeilometer Agent Computeã³ã³ããŒãã³ãããããŸãã ãã®å ŽåãåéãããããŒã¿ã¯ãã¡ãã»ãŒãžãã¥ãŒãä»ããŠäžå€®ã®CeilometerãšãŒãžã§ã³ãéç¥ã«éä¿¡ãããŸãã
ç©çãã¹ãã®ããŒãã«é¢ããããŒã¿ãåéããå¿ èŠãããå Žåã¯ããããã«SNMPãšãŒãžã§ã³ããã€ã³ã¹ããŒã«ããŠäœ¿çšã§ããŸãã ãã®å ŽåãããŒã¿åéã¯äžå€®ãšãŒãžã§ã³ãCeilometer Agent Centralã«ãã£ãŠå®è¡ãããŸãã
åŠçåŸããã®ããŒã¿ã¯Ceilometer Agent Notification Agentã«è»¢éãããéžæãããããã¯ãšã³ãã«éä¿¡ãããŠä¿ç®¡ãããŸãã
äžå€®ã®Ceilometer Agent Notificationã¯ãã¡ãã»ãŒãžãã¥ãŒããªãã¹ã³ããããšã«ãããä»ã®OpenStackã³ã³ããŒãã³ãã«é¢ããã€ãã³ããåéããããšãã§ããŸãã ããã¯ããµãŒããŒããã£ã¹ã¯ããŸãã¯ããŒãã®äœæãå€æŽããŸãã¯åé€ã«é¢ããæ å ±ã远跡ããã³ä¿åããå¿ èŠãããå Žåã«åœ¹ç«ã¡ãŸãã
æè¿ãŸã§ïŒããæ£ç¢ºã«ã¯ãä»å¹Ž2æã«è¡ãããOpenStack Ocataã®ãªãªãŒã¹åïŒãCeilometer Agent Notificationããã³Ceilometer Agent Centralãšãšãã«ãã³ã³ãããŒã«ãã¹ãã«ãã1ã€ã®ã³ã³ããŒãã³ãã§ããCeilometer Collectorãã€ã³ã¹ããŒã«ããå¿ èŠããããŸããã
ãã®ã³ã³ããŒãã³ãã¯äœ¿çšãããªããªããŸããã ãã®æ©èœã¯ãã¹ãŠãCeilometer Agent Notificationã«ãã£ãŠå®è¡ãããŸãã
Ceilometerã®ã»ããã¢ãã
äž»ãªCeilometeræ§æãã¡ã€ã«ã¯æ¬¡ã®ãšããã§ãã
- ceilometer.conf-ãã¹ãŠã®åºæ¬çãªCeilometerãã©ã¡ãŒã¿ãŒïŒãã®ã³ã°ãã¡ãã»ãŒãžãã¥ãŒã®äœ¿çšãèªèšŒãCeilometerããã»ã¹ã®èª¿æŽãªã©ïŒãèšè¿°ãããã¡ã€ã«ã
- pipeline.yaml-åéããæ å ±ãšå Žæã説æãããã¡ã€ã«ã
- gnocchi_resources.yaml -CeilometerãšGnocchiãªããžã§ã¯ãã®å¯Ÿå¿ã®èª¬æïŒããã«ã€ããŠã¯åŸã§èª¬æããŸãïŒã
䜿çšå¯èœãªãã¹ãŠã®ãªãã·ã§ã³ãå«ãceilometer.confãã¡ã€ã«ãã³ãã¬ãŒãã¯ãå ¬åŒããã¥ã¡ã³ãCeilometer Configuration Optionsã䜿çšããŠããŠã³ããŒããŸãã¯çæã§ããŸãã
pipeline.yamlãã¡ã€ã«ã¯ç¬ç«ããŠå®æããå¿ èŠããããŸãã
äŸïŒ
--- sources: # - interval: 600 # () meters: # - memory.usage # () - memory.resident # , () name: memory_meters # sinks: # - memory.sink # - interval: 600 # () meters: # - disk.device.read.bytes # - disk.device.write.bytes # name: disk_meters # sinks: # - disk_sink # sinks: # - name: memory_sink # ( "memory_meters") publishers: # , - gnocchi:// # Gnocchi - name: disk_sink # ( "memory_meters") publishers: # - gnocchi:// # Gnocchi ( )
ãã®ãã¡ã€ã«ã§ã¯ãåéãããããŒã¿ã®å€æãè¿œå ã§æå®ã§ããŸãã ããšãã°ã memory.usageããã³memory.residentã¡ããªãã¯ã®åä¿¡å€ããã¹ãŠã¡ã¬ãã€ããããããã€ãã«å€æã§ããŸãã åæã«ããããã®ã¡ããªãã¯ã®ååãå€æŽãã枬å®åäœãè¿œå ããŸãã
ãããè¡ãã«ã¯ã memory_sinkã³ã³ã·ã¥ãŒããŒã次ã®ããã«ç·šéããå¿ èŠããããŸãã
sinks: - name: memory_sink transformers: - name: "unit_conversion" # unit_conversion parameters: source: map_from: name: "memory\\.(usage|resident)" # target: map_to: name: "memory.\\1.kilobytes" # scale: "volume * 1024.0" # unit: "KB" # publishers: - gnocchi://
ãã®ãã¡ã€ã«ã®åœ¢åŒããã³ãã®ä»ã®å€æã®é©çšã«é¢ãã詳现æ å ±ã¯ãå ¬åŒããã¥ã¡ã³ãã ããŒã¿åŠçãšãã€ãã©ã€ã³ãã«èšèŒãããŠããŸãã
次ã«ãGnocchiãããžã§ã¯ãã«ã€ããŠæ€èšããŸããããã«ãããåéãã枬å®å€ãéèšåœ¢åŒã§ä¿åãããããã䜿çšããããã®APIãæäŸã§ããŸãã
ããŒã¿ã¹ãã¬ãŒãž-ãã§ãã
Gnocchiãããžã§ã¯ãã¯æç³»åããŒã¿ããŒã¹ã§ãã
2017幎5æäžæ¬ã«ãGnocchiéçºè ã¯ãã®ãããžã§ã¯ããOpenStackã€ã³ãã©ã¹ãã©ã¯ãã£ããæ€åããããšã決å®ããããšã«æ³šæããŠãã ããã
ã³ãŒãããŒã¹ã¯GitHubã«ç§»æ€ãããŠããã GitHub Issuesã¡ã«ããºã ã¯ãã°ãã©ãã«ãŒãšããŠäœ¿çšãããŠããŸãã äž»ãªçç±ã®1ã€ã¯ãGnocchiãCeilometerã®ããã¯ãšã³ããšããŠã ãã§ãªããä»ã®ãœãªã¥ãŒã·ã§ã³ã«é©ããããæ®éçãªè£œåãšããŠäœçœ®ä»ããããšã§ãã ããšãã°ãGnocchiãªããžããªã«ã¯ãæ¢ã«CollectdããããŒã¿ãä¿åããããã®ãã©ã°ã€ã³ãšGrafanaã§ã°ã©ãåããããã®ãã©ã°ã€ã³ãæ¢ã«ãããŸãã
Gnocchiã®ããã€ã¹ãšæ©èœããã詳现ã«æ€èšããŠãã ããã
ãã§ããã¢ãŒããã¯ãã£
ãã§ããã¯ã2ã€ã®äž»èŠãªã³ã³ããŒãã³ãã§æ§æãããŠããŸãã
- ããŒã¿ãä¿åããã³æŽæ°ããããã®API ïŒããšãã°ãCeilometerããããŸãã¯æåã§ïŒãããã³éçŽããŒã¿ã®åä¿¡ã
- Metricdã¯ãåä¿¡ããã°ããã§ãŸã ãœãŒããããŠããªãããŒã¿ãåŠçããéžæããã¹ãã¬ãŒãžïŒ Ceph ã Redis ã OpenStack SwiftããŸãã¯ããŒã«ã«ãã¡ã€ã«ã·ã¹ãã ïŒã«æ£ãã圢åŒã§ä¿åããããŒã¢ã³ã§ãã
ããŒãžã§ã³3.1ãããGnocchiã¯åŠçæžã¿ããŒã¿ãšçããŒã¿çšã®ããŸããŸãªã¿ã€ãã®ã¹ãã¬ãŒãžã®ãµããŒããå°å ¥ããŸããã ãã®åé¢ã«ãããããããããªééçŽããŒã¿ãé«éã¹ãã¬ãŒãžïŒããšãã°ãGnocchiããŒãžã§ã³4.0ã§ãµããŒããããRedisãªã©ïŒã«é 眮ããããŒã¿ãããä¿¡é Œæ§ã®é«ãã¹ã±ãŒã©ãã«ãªããã¯ãšã³ãïŒããšãã°ãCephã Gnocchiã®æåã®ããŒãžã§ã³ïŒã
Gnocchiã§ã¯ãçŽæ¥çãªããŒã¿ã¹ãã¬ãŒãžã«å ããŠãã¡ããªãã¯ã€ã³ããã¯ã¹ãšãã®ã¡ã¿ããŒã¿ãæ ŒçŽãããŠããSQLããŒã¿ããŒã¹ãå¿ èŠã§ãã ããã«ã¯MySQLãŸãã¯PostgreSQLã䜿çšã§ããŸãã Gnocchiã¯ãç¬èªã®ã¢ãããŒãã䜿çšããŠæž¬å®å€ãä¿åããŸããããã¯ããªã¹ããããŠãããã¹ãŠã®ãã¯ãããžãŒãæç³»åã®åœ¢åŒã§ããŒã¿ãä¿åããæ©èœãæäŸããªãããã§ãã
Gnocchiã«ããŒã¿ãä¿åãã
æ°ããããŒã¿ãåä¿¡ãããšãå€ã¯å ã®åœ¢åŒã§ä¿åãããŸããã 代ããã«ãäœæãããã¢ãŒã«ã€ãããªã·ãŒã«åŸã£ãŠããŠãŒã¶ãŒãéžæããã¡ãœããïŒãã®äŸã§ã¯ã¡ãœããã®æå°ãæ倧ãå¹³åïŒã䜿çšããŠéèšãããæå®ããã粟床ïŒãã®äŸã§ã¯3600ç§ïŒã§ä¿åãããŸãã
python-gnocchiclientã³ã³ãœãŒã«ã¯ã©ã€ã¢ã³ãã䜿çšããŠã¢ãŒã«ã€ãããªã·ãŒãäœæã§ããŸãã ããšãã°ã3ã€ã®éçŽã¡ãœããïŒæå°ãæ倧ãå¹³åãããã³ããŒã¿ã®æ ŒçŽæ¹æ³ã®2ã€ã®å®çŸ©ïŒãå«ãmemory_policyãšããããªã·ãŒãäœæããŸãã æåã®å®çŸ©ã§ã¯ã7æ¥éã«ããã£ãŠ1æéã®ç²ŸåºŠã§ããŒã¿ãä¿åãããšããŠããŸãã 2çªç®ã®æ¹æ³ã§ã¯ã1幎é1æ¥ã®ç²ŸåºŠã§ããŒã¿ãä¿åããŸãã
ããã«ãããã¯ãŠã£ã³ããŠã®å€ã72ã§ããããšã瀺ããŸããããã«ãããçŸåšäœæãããŠããã¡ããªãã¯ã ãã§ãªããäœããã®çç±ã§å€ãã¡ããªãã¯ã72æ¥ä»¥å ä¿åã§ããŸãã
controller:~# gnocchi archive-policy create memory_policy \ > -b 72 \ > -m min -m max -m mean \ > -d 'granularity:1h,timespan:7d' \ > -d 'granularity:1d,timespan:365d'
å¿çãšããŠãäœæãããããªã·ãŒã®èª¬æãååŸããŸãã
+---------------------+-------------------------------------------------------------------------+ | Field | Value | +---------------------+-------------------------------------------------------------------------+ | aggregation_methods | max, min, mean | | back_window | 72 | | definition | - points: 168, granularity: 1:00:00, timespan: 7 days, 0:00:00 | | | - points: 365, granularity: 1 day, 0:00:00, timespan: 365 days, 0:00:00 | | name | memory_policy | +---------------------+-------------------------------------------------------------------------+
å®çŸ©ã«å¯ŸããŠãã€ã³ããèªåçã«èšç®ãããŠããããšã«æ³šæããŠãã ããã ãã®å€ã¯åŒã«ãã£ãŠèšç®ãããŸãïŒ
ãã€ã³ã=ã¿ã€ã ã¹ãã³/ç²åºŠ
ä¿åãããã¡ããªãã¯ã®å€ãå ããå Žæãèšç®ããå¿ èŠããããŸãã
Gnocchiéçºè 㯠ã次ã®åŒã䜿çšããŠå¿ èŠãªå Žæãèšç®ããããšããå§ãããŸãã
ãµã€ãºïŒãã€ãåäœïŒ= 8 *ãã€ã³ã*éèšæ¹æ³
æ å ±ã¯åžžã«å§çž®åœ¢åŒã§ä¿åããããããæå®ãããåŒã¯ææªã®å Žåã®å Žæã®èšç®ã§ãã ãã®åŒã䜿çšããŠãmemory_policyã¢ãŒã«ã€ãããªã·ãŒã®ã¹ããŒã¹éãèšç®ã§ããŸãã æåã®æ±ºå®ïŒ7æ¥éã§1æéã®ç²ŸåºŠïŒã§ã¯ã4032ãã€ããååŸããŸãã
4032ïŒãã€ãïŒ= 8 * 168 * 3
ãããŠã2çªç®ã®å®çŸ©ïŒå¹ŽéãéããŠ1æ¥ã®ç²ŸåºŠïŒã®å Žåã8760ãã€ããåŸãããŸãã
8760ïŒãã€ãïŒ= 8 * 365 * 3
ååŸããå€ã¯ã memory_policyããªã·ãŒã«åŸã£ãŠä¿åããã1ã€ã®ã¡ããªãã¯ã®äœ¿çšæžã¿ã¹ããŒã¹ãåæ ããŠããŸãã
ããšãã°ã2000åã®ä»®æ³ãã·ã³ã®memory.usageãšmemory.residentã®2ã€ã®ã¡ããªãã¯ã®åéãéå§ããå Žåã以äžãå¿ èŠã§ãã
2000 * 2 * 4032ïŒãã€ãïŒ= 16.128 MBïŒ7æ¥éïŒ
2000 * 2 * 8760ïŒãã€ãïŒ= 35.04 MBïŒ1幎éïŒ
ãã§ããã®ãªãœãŒã¹
Gnocchiã«ä¿åããããã¹ãŠã®ã¡ããªãã¯ã¯ãããã€ãã®ãªãœãŒã¹ãåç §ããŸãã ãªãœãŒã¹ã¯ãè€æ°ã®ã¡ããªãã¯ãå«ãããšãã§ããæœè±¡ãªããžã§ã¯ãã§ããããã®ãªãœãŒã¹ã®ã¿ã€ãã§èª¬æãããŠããè¿œå ã®ãã£ãŒã«ããæã€ããšãã§ããŸãã
ãªããžã§ã¯ãã¡ããªãã¯-ãªãœãŒã¹-ãªãœãŒã¹ã¿ã€ãã®é¢ä¿ã¯æ¬¡ã®ããã«ãªããŸãã
ããšãã°ãã¿ã€ãinstance_memoryã®ãªãœãŒã¹ã®ã»ããããããŸã ã ãã®ã¿ã€ãã®åãªãœãŒã¹ã«ã¯ã memory.usageããã³memory.residentã¡ããªãã¯ãå«ãŸããŸã ã
2000å°ã®ä»®æ³ãã·ã³ããã¡ããªãã¯ãåéãããšã instance_memoryãªãœãŒã¹ã®æ°ã2000ã«ãªããŸãã
ãã®ãããªãªãœãŒã¹ã®å Žåãè¿œå æ å ±ãããšãã°ãä»®æ³ãã·ã³ãå®è¡ãããŠãããã€ããŒãã€ã¶ãŒã®ãã¹ãåããŸãã¯ä»®æ³ãã·ã³ã®äœæå ã®ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã€ã¡ãŒãžïŒ OpenStack GlanceãµãŒãã¹ã«æ ŒçŽãããŠããïŒã®èå¥åãæ ŒçŽãããšåœ¹ç«ã€å ŽåããããŸãã
consoleã³ãã³ãã䜿çšããŠã instance_memoryãªãœãŒã¹ã¿ã€ããäœæããŸã ã 説æãããŠããè¿œå ã®host ã image_refãã£ãŒã«ããæå®ããŠããã¹ãåãšã€ã¡ãŒãžèå¥åãä¿åãã ãã¹ããã£ãŒã«ããå¿ é ã«ããŸãã
controller:~# gnocchi resource-type create instance_memory \ > -a host:string:true:min_length=0:max_length=255 \ > -a image_ref:string:false:min_length=0:max_length=255
å¿çãšããŠãäœæããããªãœãŒã¹ã¿ã€ãã®èª¬æãååŸããŸãã
+----------------------+-----------------------------------------------------------+ | Field | Value | +----------------------+-----------------------------------------------------------+ | attributes/host | max_length=255, min_length=0, required=True, type=string | | attributes/image_ref | max_length=255, min_length=0, required=False, type=string | | name | instance_memory | | state | active | +----------------------+-----------------------------------------------------------+
åæ§ã«ã instance_cpuããã³instance_diskãªãœãŒã¹ã¿ã€ããäœæããŸã ã æåã®ãã£ãŒã«ãã«ã¯instance_memoryãšåãè¿œå ãã£ãŒã«ããããã2çªç®ã®ãã£ãŒã«ãã«ã¯ãã£ã¹ã¯ãæ¥ç¶ãããŠãããµãŒããŒã®èå¥åã瀺ãinstance_idãã£ãŒã«ãããããŸã ã
controller:~# gnocchi resource-type create instance_cpu \ > -a host:string:true:min_length=0:max_length=255 \ > -a image_ref:string:false:min_length=0:max_length=255 +----------------------+-----------------------------------------------------------+ | Field | Value | +----------------------+-----------------------------------------------------------+ | attributes/host | max_length=255, min_length=0, required=True, type=string | | attributes/image_ref | max_length=255, min_length=0, required=False, type=string | | name | instance_cpu | | state | active | +----------------------+-----------------------------------------------------------+ controller:~# gnocchi resource-type create instance_disk \ > -a instance_id:uuid:true +------------------------+--------------------------+ | Field | Value | +------------------------+--------------------------+ | attributes/instance_id | required=True, type=uuid | | name | instance_disk | | state | active | +------------------------+--------------------------+
ããã§ãäœæããããªãœãŒã¹ã¿ã€ãã䜿çšããŠCeilometerã¡ããªãã¯ã®Gnocchiãžã®ä¿åãéå§ããæ¹æ³ãç解ããŸãããã
Ceilometer + Gnocchiã®æ§æ
Ceilometerãããã¯ãšã³ããšããŠGnocchiã®äœ¿çšãéå§ããã«ã¯ã次ã®ãã®ãå¿ èŠã§ãã
1. meter_dispatchersãªãã·ã§ã³ãceilometer.confãã¡ã€ã«ã«è¿œå ããŸãã
[DEFAULT] meter_dispatchers = gnocchi
2. Ceilometerã¡ããªãã¯ãšGnocchiãªãœãŒã¹ã¿ã€ãã®å¯Ÿå¿ãèšè¿°ãããªãœãŒã¹ã¿ã€ãã®è¿œå ãã£ãŒã«ãã瀺ãgnocchi_resources.yamlãã¡ã€ã«ãäœæããŸãã
--- resources: - resource_type: instance_memory # metrics: - 'memory.usage' # - 'memory.resident' # attributes: host: resource_metadata.instance_host # image_ref: resource_metadata.image_ref # - resource_type: instance_disk # metrics: - 'disk.device.read.bytes' # - 'disk.device.write.bytes' # attributes: instance_id: resource_metadata.instance_id # id - resource_type: instance_cpu # metrics: - 'cpu_util' # attributes: host: resource_metadata.instance_host # image_ref: resource_metadata.image_ref #
Ceilometerãèµ·åãããšãããŒã¿ã®åéãšGnocchiãžã®éä¿¡ãéå§ãããŸãïŒ ããã¥ã¡ã³ãã«åŸã£ãŠæ§æãããŠããå Žå ïŒã
次ã®ã³ãã³ãã䜿çšããŠãæ°ããããŒã¿ã®åŠçã¹ããŒã¿ã¹ãç£èŠããéžæããã¹ãã¬ãŒãžã«éèšåœ¢åŒã§ä¿åã§ããŸãã
controller:~# gnocchi status +-----------------------------------------------------+-------+ | Field | Value | +-----------------------------------------------------+-------+ | storage/number of metric having measures to process | 93 | | storage/total number of measures to process | 93 | +-----------------------------------------------------+-------+
äžèšã®çµè«ã§ã¯ãGnocchi-metricdã93åã®ã¡ããªãã¯ã«åæ£ãã93åã®æž¬å®ãåŠçããããšãããããŸãã
ãã®ã³ãã³ãã䜿çšãããšãGnocchi-metricdã³ã³ããŒãã³ããçä¿¡ã¡ããªãã¯ãåŠçãããã©ãããç£èŠã§ããŸãã
åŠçé床ã¯ãGnocchiã¡ããªãã¯ããã»ã¹ã®æ°ãšéžæããããŒã¿ãŠã§ã¢ããŠã¹ã®ããã©ãŒãã³ã¹ã«çŽæ¥äŸåããŸãã
éçŽãããæ å ±ã衚瀺ãã
åä¿¡ãã枬å®å€ãåŠçããŠä¿åãããšãGnocchiã®ãªãœãŒã¹ãšæž¬å®å€ã«ã¢ã¯ã»ã¹ã§ããããã«ãªããŸãã
instance_memoryã¿ã€ãã§ãªãœãŒã¹ãå°åºããåºåã3ã€ã®ãªãœãŒã¹ã«å¶éãããªãœãŒã¹èªäœã®èå¥åããã®ã¿ã€ããä»®æ³ãã·ã³ã®ãã¹ãåãããã³ã€ã¡ãŒãžã®èå¥åã®4åã®ã¿ã衚瀺ããŸãã
controller:~# gnocchi resource list --type instance_memory --limit 3 --column id --column type --column host --column image_ref +--------------------------------------+-----------------+-----------+--------------------------------------+ | id | type | host | image_ref | +--------------------------------------+-----------------+-----------+--------------------------------------+ | 945ad3cc-2617-4b19-a681-5a1cb96d71e1 | instance_memory | compute00 | 3456e843-b7fe-42be-8c4c-0c7d1c2d09c7 | | e33c895f-e38a-4f8e-be07-8fe0d7c8275f | instance_memory | compute02 | 27bbfeb7-0706-4d11-bb59-f98d6b08dc1c | | 023fed66-3fdd-43b6-b02e-325da55b62cc | instance_memory | compute04 | f0f5e0aa-4615-462e-8340-b8258aae90e2 | +--------------------------------------+-----------------+-----------+--------------------------------------+
ãªãœãŒã¹945ad3cc-2617-4b19-a681-5a1cb96d71e1ã®ã¡ããªãã¯ãšã¿ã€ãã®åã衚瀺ããŸãã
controller:~# gnocchi resource show --column metrics --column type 945ad3cc-2617-4b19-a681-5a1cb96d71e1 +---------+-------------------------------------------------------+ | Field | Value | +---------+-------------------------------------------------------+ | metrics | memory.resident: f56b76ad-5ce8-49fe-975f-6e5da412df31 | | | memory.usage: aa757f46-52b9-40de-898c-524dfe29b7bc | | type | sel_instance | +---------+-------------------------------------------------------+
ã¡ããªãã¯aa757f46-52b9-40de-898c-524dfe29b7bcã枬å®ããããã®å¹³åå€ãã 2017幎8æ25æ¥ã®12:00ãã18:00ã®ééã§ã1æéã®ç²ŸåºŠã§èŠãŠã¿ãŸãããã
controller:~# gnocchi measures show --aggregation mean --granularity 3600 --start 2017-08-25T12:00 --stop 2017-08-25T18:00 aa757f46-52b9-40de-898c-524dfe29b7bc +---------------------------+-------------+---------------+ | timestamp | granularity | value | | +---------------------------+-------------+---------------+ | 2017-08-25T12:00:00+00:00 | 3600.0 | 2231.75 | | 2017-08-25T13:00:00+00:00 | 3600.0 | 2238.66666667 | | 2017-08-25T14:00:00+00:00 | 3600.0 | 2248.58333333 | | 2017-08-25T15:00:00+00:00 | 3600.0 | 2259.08333333 | | 2017-08-25T16:00:00+00:00 | 3600.0 | 2240.41666667 | | 2017-08-25T17:00:00+00:00 | 3600.0 | 2249.66666667 | +---------------------------+-------------+---------------+
éçŽãããæ å ±ã¯ãã³ã³ãœãŒã«ãŠãŒãã£ãªãã£ã ãã§ãªããREST APIã䜿çšããŠååŸã§ããŸãã ããã€ãã®äŸãèŠãŠã¿ãŸãããã
2017幎8æ28æ¥ãã24æéã®ç²ŸåºŠã§ãã¿ã€ãinstance_memoryã®ãªãœãŒã¹ã®memory.usageã¡ããªãã¯ã®å€ãååŸããŸãã
controller:~# curl -XGET \ > -H 'Content-Type: application/json' \ > -H 'X-Auth-Token: KEYSTONE_TOKEN' \ > 'controller:8041/v1/resource/instance_memory/684f5b56-2c06-485a-ae1a-66ab5c4175fb/metric/memory.usage/measures?start=2017-08-28&granularity=86400' \ > | python -m json.tool [ [ "2017-08-28T00:00:00+00:00", 86400.0, 2645.9444444444443 ], [ "2017-08-29T00:00:00+00:00", 86400.0, 2671.625 ], [ "2017-08-30T00:00:00+00:00", 86400.0, 2681.5438596491226 ] ]
ãã¹ããã£ãŒã«ãã®å€ããcompute19ãã§2017幎8æ29æ¥ä»¥éã«äœæãããinstance_memoryã¿ã€ãã®ãªãœãŒã¹ãæ€çŽ¢ããŸãã
controller:~# curl -XPOST \ > -H 'Content-Type: application/json' \ > -H 'X-Auth-Token: KEYSTONE_TOKEN' \ > 'controller:8041/v1/search/resource/instance_memory \ > -d '{ > "and": [ > { > "=": { > "host": "compute19" > } > }, > { > ">": { > "started_at": "2017-08-29" > } > } > ] > }' \ > | python -m json.tool [ { "created_by_project_id": "99288fd3d178459f808c1e8bc2cf9e49", "created_by_user_id": "7dd0582d38aa471bbe8995f63a1293a9", "creator": "7dd0582d38aa471bbe8995f63a1293a9:99288fd3d178459f808c1e8bc2cf9e49", "ended_at": null, "host": "compute19", "id": "9052e237-ad17-47be-8aa5-10aacbf6717f", "image_ref": "e12ef13d-783c-4030-9251-ad2c8e270453", "metrics": { "memory.resident": "365db8ce-f4f7-4e59-ac9f-03dcdfe81195", "memory.usage": "084157b7-09d3-45e7-a869-fad62062025a" }, "original_resource_id": "9052e237-ad17-47be-8aa5-10aacbf6717f", "project_id": "99288fd3d178459f808c1e8bc2cf9e49", "revision_end": null, "revision_start": "2017-08-30T20:35:19.214598+00:00", "started_at": "2017-08-30T20:35:19.214577+00:00", "type": "instance_memory", "user_id": "7dd0582d38aa471bbe8995f63a1293a9" } ]
compute19ãã¹ãã§å®è¡ãããŠããä»®æ³ãã·ã³ã«ã€ããŠãæ倧1æéã®ç²ŸåºŠã§memory.residentã¡ããªãã¯ã®æ倧å€ã«ããéèšãååŸããŸãã ã¡ããªãã¯ã¯ãããžã§ã¯ãèå¥åã«ãã£ãŠäœç³»åãããŸãïŒ
controller:~# curl -XPOST \ > -H 'Content-Type: application/json' \ > -H 'X-Auth-Token: KEYSTONE_TOKEN' \ > 'controller:8041/v1/aggregation/resource/instance_memory/metric/memory.resident&aggregation=max&granularity=3600&groupby=project_id' \ > -d '{ > "=": { > "host": "compute19" > } > }' \ > | python -m json.tool [ { "group": { "project_id": "eef577b17cfe4432b7769d0078dbb625" }, "measures": [ [ "2017-08-29T09:00:00+00:00", 3600, 735 ], [ "2017-08-30T11:00:00+00:00", 3600, 949 ] ] }, { "group": { "project_id": "b998dbbb9b02474c9dc49ffc289eae8c" }, "measures": [ [ "2017-08-29T09:00:00+00:00", 3600, 612 ], [ "2017-08-30T11:00:00+00:00", 3600, 642 ] ] } ]
REST APIã®ãã®ä»ã®äœ¿çšäŸã¯ã å ¬åŒããã¥ã¡ã³ãã«èšèŒãããŠããŸã ã
VPCãµãŒãã¹ã®çµ±èš
çŸåšã VPCãµãŒãã¹ã§èª¬æãããŠããã³ã³ããŒãã³ãã䜿çšããŠããŸãã
ãŠãŒã¶ãŒã¯ãä»®æ³ãã·ã³ã®æ¬¡ã®ã¡ããªãã¯ã䜿çšã§ããŸãã
- CPU䜿çšçãïŒ ïŒ cpu_util ïŒ;
- RAM䜿çšéïŒMB åäœ ïŒïŒ memory.usage ïŒã
ãã©ã€ãææšïŒ
- èªã¿åãããã³æžã蟌ã¿ã®ãã€ãæ°/ cïŒ disk.device.read.bytes ã disk.device.write.byte sïŒ;
- 1ç§ãããã®èªã¿åãããã³æžã蟌ã¿èŠæ±ã®æ°ïŒ disk.device.read.requests ã disk.device.write.requests ïŒã
ãããã¯ãŒã¯ã€ã³ã¿ãŒãã§ã€ã¹ã®ã¡ããªãã¯ïŒ
- çä¿¡ããã³çºä¿¡ãã©ãã£ãã¯ã®ãããæ°/ cïŒ network.incoming.bits ã network.outgoing.bits ïŒ;
- 1ç§ãããã®çä¿¡ããã³çºä¿¡ãã©ãã£ãã¯ã®ãã±ããæ°ïŒ network.incoming.packets ã network.outgoing.packets ïŒã
ãã¹ãŠã®ããŒã¿ã¯ãREST APIãŸãã¯Gnocchiã³ã³ãœãŒã«ã¯ã©ã€ã¢ã³ããä»ããŠããŸãã¯ãµãŒããŒã³ã³ãããŒã«ããã«ã®çµã¿èŸŒã¿ã°ã©ãã®åœ¢åŒã§åä¿¡ã§ããŸãã
CPU䜿çšçã°ã©ã
RAM䜿çšéã°ã©ã
ãã£ã¹ã¯è² è·ã°ã©ã
ãããã¯ãŒã¯ã€ã³ã¿ãŒãã§ã€ã¹ã®è² è·ãã£ãŒã
ãããã«
ãã®èšäºã§ã¯ãOpenStackãªããžã§ã¯ãã«é¢ããçµ±èšãåéãä¿åã衚瀺ããããã®2ã€ã®ã³ã³ããŒãã³ãã調ã¹ãŸããã
ã質åãããã°ãã³ã¡ã³ãããŠãã ããã
ç¬èªã®ããŒã¿ãäœæã§ãããµãŒãã¹ãšããŠgnocchiãè©ŠããŠã¿ããå Žåã¯ãããã«ã€ããŠãåãåãããã ããã
CeilometerãŸãã¯Gnocchiã䜿çšããŠèªåã®çµéšãå ±æããŠããã ããã°å¹žãã§ãã