Compare commits

...

437 Commits

Author SHA1 Message Date
Zexi Li
73246a90b7 Merge pull request #12614 from zhaoxiangchun/automated-cherry-pick-of-#12613-upstream-release-3.8
Automated cherry pick of #12613: fix(monitor): monitor host query fix
2021-11-05 18:37:14 +08:00
zhaoxiangchun
5cf2937871 fix(monitor): monitor host query fix 2021-11-05 14:14:49 +08:00
Zexi Li
a7064c792e Merge pull request #12610 from ioito/automated-cherry-pick-of-#12609-upstream-release-3.8
Automated cherry pick of #12609: fix(region): avoid cidr change 0.0.0.0/0
2021-11-05 10:40:07 +08:00
Qu Xuan
d797eb3144 fix(region): avoid cidr change 0.0.0.0/0 2021-11-05 10:04:46 +08:00
Zexi Li
a3fa8463dd Merge pull request #12601 from tb365/automated-cherry-pick-of-#12600-upstream-release-3.8
Automated cherry pick of #12600: support gcp regional lb sync
2021-11-05 01:15:33 +08:00
Zexi Li
ddc7c4ffb6 feat(region,host): create or update server add machine option (#12606) 2021-11-04 22:27:00 +08:00
tb365
9a94f03e11 support gcp regional lb sync 2021-11-04 16:59:09 +08:00
Zexi Li
194998499b Merge pull request #12596 from zhaoxiangchun/automated-cherry-pick-of-#12595-upstream-release-3.8
Automated cherry pick of #12595: fix(monitor): monitor alert support:{level} filter
2021-11-04 16:25:12 +08:00
zhaoxiangchun
d435034e6d fix(monitor): add monitor sheild {expired} state 2021-11-04 16:20:21 +08:00
zhaoxiangchun
d51ea4d961 fix(monitor): onecloud notifier send sys when user_ids and robot_ids length == 0 2021-11-04 16:20:21 +08:00
zhaoxiangchun
8381a3f1f2 fix(monitor): monitor alert support:{level} filter 2021-11-04 16:20:21 +08:00
Zexi Li
df141ff513 Merge pull request #12599 from rainzm/automated-cherry-pick-of-#12598-upstream-release-3.8
Automated cherry pick of #12598: fix(notify): init system tenant_id for robot without tenant_id
2021-11-03 22:56:08 +08:00
rainzm
09854f51c3 fix(notify): init system tenant_id for robot without tenant_id 2021-11-03 19:58:54 +08:00
Zexi Li
f0fd038faa Merge pull request #12594 from rainzm/automated-cherry-pick-of-#12593-upstream-release-3.8
Automated cherry pick of #12593: fix(region): avoid syncing when starting or stoping esxi vm
2021-11-03 18:08:38 +08:00
Zexi Li
c9c2c8e478 Merge pull request #12591 from rainzm/automated-cherry-pick-of-#12590-upstream-release-3.8
Automated cherry pick of #12590: fix(esxi): avoid uplink dvpg
2021-11-03 18:07:14 +08:00
rainzm
25a9086f98 fix(region): avoid syncing when starting or stoping esxi vm 2021-11-03 18:02:46 +08:00
Zexi Li
b736a6d483 Merge pull request #12588 from zexi/automated-cherry-pick-of-#12585-upstream-release-3.8
Automated cherry pick of #12585: feat(region,host): implement server change disk storage
2021-11-03 17:14:00 +08:00
rainzm
d3c8315b81 fix(esxi): avoid uplink dvpg 2021-11-03 17:04:41 +08:00
Zexi Li
bad21c8698 feat(region,host): implement server change disk storage 2021-11-03 11:44:54 +08:00
Jian Qiu
f42bce4184 fix: disable MFA by default (#12587) 2021-11-03 01:41:08 +08:00
Zexi Li
a0e31df7be Merge pull request #12562 from swordqiu/automated-cherry-pick-of-#12561-upstream-release-3.8
Automated cherry pick of #12561: fix: delayed probing GPU on host init and add disable_gpu option
2021-11-03 00:00:56 +08:00
Zexi Li
e4e1469114 Merge pull request #12578 from rainzm/automated-cherry-pick-of-#12577-upstream-release-3.8
Automated cherry pick of #12577: fix(region): delete instance snapshot itself after deleting subsnapshots
2021-11-02 23:47:50 +08:00
Zexi Li
982430a025 Merge pull request #12582 from ioito/automated-cherry-pick-of-#12581-upstream-release-3.8
Automated cherry pick of #12581: fix(region): cdn purge
2021-11-02 23:46:34 +08:00
Zexi Li
e1fd572f0e Merge pull request #12584 from rainzm/automated-cherry-pick-of-#12583-upstream-release-3.8
Automated cherry pick of #12583: fix(notify): init ProjectId for robots without ProjectId
2021-11-02 23:45:19 +08:00
rainzm
4938bd8b4f fix(notify): init ProjectId for robots without ProjectId 2021-11-02 20:19:37 +08:00
Qu Xuan
5f5f02ac07 fix(region): cdn purge 2021-11-02 19:26:58 +08:00
rainzm
101502895e fix(region): delete instance snapshot itself after deleting subsnapshots 2021-11-02 10:28:56 +08:00
Zexi Li
8ecd6b5967 Merge pull request #12569 from swordqiu/automated-cherry-pick-of-#12568-upstream-release-3.8
Automated cherry pick of #12568: fix: clean up region data
2021-11-01 20:29:19 +08:00
Zexi Li
e0aaf54316 Merge pull request #12572 from ioito/automated-cherry-pick-of-#12571-upstream-release-3.8
Automated cherry pick of #12571: fix(region): avoid panic when query is nil
2021-11-01 20:28:39 +08:00
Zexi Li
07ea3fa160 Merge pull request #12575 from rainzm/automated-cherry-pick-of-#12574-upstream-release-3.8
Automated cherry pick of #12574: Flag for installing agent
2021-11-01 20:27:25 +08:00
rainzm
d36f8103dd feat(region): add have-agent action for guest 2021-11-01 19:41:54 +08:00
rainzm
15af5feed5 feat(cloudproxy): add purge-forward for proxy endpoint 2021-11-01 19:41:54 +08:00
Qu Xuan
d9165e540e fix(region): avoid panic when query is nil 2021-11-01 16:31:36 +08:00
Zexi Li
3d15d0ffde Merge pull request #12560 from rainzm/automated-cherry-pick-of-#12559-upstream-release-3.8
Automated cherry pick of #12559: fixes for notify
2021-11-01 10:07:34 +08:00
Zexi Li
5bc85cc8a9 Merge pull request #12565 from rainzm/automated-cherry-pick-of-#12564-upstream-release-3.8
Automated cherry pick of #12564: fix(region): init timerQueue correctly
2021-11-01 10:05:53 +08:00
Qiu Jian
5b55749dbd fix: clean up region data 2021-10-30 22:08:10 +08:00
rainzm
0d0c52ddb1 fix(region): init timerQueue correctly 2021-10-30 18:01:34 +08:00
Qiu Jian
d766d5a979 fix: delayed probing GPU on host init and add disable_gpu option 2021-10-30 11:51:45 +08:00
rainzm
2798b9e592 feat(notify): add WebconsoleDisable for topic 2021-10-29 19:35:41 +08:00
rainzm
b67dd5200a fix(notify): init robot project info 2021-10-29 19:35:41 +08:00
Zexi Li
3c7c40e71a Merge pull request #12557 from ioito/automated-cherry-pick-of-#12556-upstream-release-3.8
Automated cherry pick of #12556: fix(region): avoid empty ip addr for vm
2021-10-29 15:22:59 +08:00
Zexi Li
77ed62fbf0 Merge pull request #12555 from ioito/automated-cherry-pick-of-#12554-upstream-release-3.8
Automated cherry pick of #12554: fix(region): filter vpcs by zone
2021-10-29 15:21:17 +08:00
Qu Xuan
8e982788fe fix(region): avoid empty ip addr for vm 2021-10-29 14:55:14 +08:00
Qu Xuan
35cba00416 fix(region): filter vpcs by zone 2021-10-29 14:34:39 +08:00
Zexi Li
58e8f9dd03 Merge pull request #12549 from swordqiu/automated-cherry-pick-of-#12548-upstream-release-3.8
Automated cherry pick of #12548: fix: apigateway request api_server option directly from keystone
2021-10-29 11:08:32 +08:00
Qiu Jian
a663c5ce87 fix: apigateway request api_server option directly from keystone 2021-10-28 23:54:28 +08:00
Zexi Li
6a661d3eae Merge pull request #12547 from ioito/automated-cherry-pick-of-#12546-upstream-release-3.8
Automated cherry pick of #12546: fix(host): cephx closed
2021-10-28 21:01:31 +08:00
Qu Xuan
928bb282ac fix(host): cephx closed 2021-10-28 20:17:10 +08:00
Zexi Li
928e2902a1 Merge pull request #12541 from ioito/automated-cherry-pick-of-#12540-upstream-release-3.8
Automated cherry pick of #12540: fix(host): avoid storage attach not report error
2021-10-28 18:25:51 +08:00
Zexi Li
eeec217220 Merge pull request #12545 from rainzm/automated-cherry-pick-of-#12544-upstream-release-3.8
Automated cherry pick of #12544: fix(notify): be compatible with Chinese when generating names
2021-10-28 18:24:25 +08:00
rainzm
8ab7b49f05 fix(notify): be compatible with Chinese when generating names 2021-10-28 17:12:37 +08:00
Qu Xuan
4c00be06a2 fix(host): avoid storage attach not report error 2021-10-28 17:00:41 +08:00
Zexi Li
06dcc0b6d9 Merge pull request #12536 from ioito/automated-cherry-pick-of-#12535-upstream-release-3.8
Automated cherry pick of #12535: fix(region): validate update
2021-10-28 16:36:39 +08:00
Zexi Li
881f4085ea Merge pull request #12532 from ioito/automated-cherry-pick-of-#12531-upstream-release-3.8
Automated cherry pick of #12531: fix(region): add cdn domain
2021-10-28 10:03:28 +08:00
Zexi Li
37223ce58a Merge pull request #12534 from ioito/automated-cherry-pick-of-#12533-upstream-release-3.8
Automated cherry pick of #12533: Hotfix/qx waf app tags sync
2021-10-28 09:55:35 +08:00
Zexi Li
aa80106b84 Merge pull request #12539 from ioito/automated-cherry-pick-of-#12538-upstream-release-3.8
Automated cherry pick of #12538: fix(apigateway): api_server changed
2021-10-28 09:53:25 +08:00
Qu Xuan
d8f0cc6b4a fix(apigateway): api_server changed 2021-10-27 19:38:27 +08:00
Qu Xuan
57244dcbd0 fix(region): validate update 2021-10-27 17:55:23 +08:00
yunion-ci-robot
6e7d07f47e Merge pull request #12513 from zhaoxiangchun/automated-cherry-pick-of-#12495-upstream-release-3.8
Automated cherry pick of #12495: fix(cloudcommon): update db_dispatcher set order by to sqlchemy.SQuery
2021-10-27 17:28:45 +08:00
Qu Xuan
e90f89efa8 fix(region): add waf and app tags sync 2021-10-27 17:04:26 +08:00
Qu Xuan
7756028da0 fix(region): waf and app tags sync 2021-10-27 17:04:26 +08:00
Qu Xuan
fe66a6e907 fix(region): add cdn domain 2021-10-27 15:38:25 +08:00
Zexi Li
7e68d87c60 Merge pull request #12480 from tb365/automated-cherry-pick-of-#12469-upstream-release-3.8
Automated cherry pick of #12469: eip bind aws server fix
2021-10-27 10:00:47 +08:00
Zexi Li
7f1f9e21d8 Merge pull request #12528 from zhaoxiangchun/automated-cherry-pick-of-#12527-upstream-release-3.8
Automated cherry pick of #12527: feat(monitor,cloudmon): add azure rds,redis,lb metric
2021-10-26 19:34:29 +08:00
Zexi Li
b773be0f73 Merge pull request #12519 from tb365/automated-cherry-pick-of-#12517-upstream-release-3.8
Automated cherry pick of #12517: cn-southwest-2 default bgp type 5_sbgp
2021-10-26 19:32:35 +08:00
Zexi Li
777920cd29 Merge pull request #12524 from ioito/automated-cherry-pick-of-#12523-upstream-release-3.8
Automated cherry pick of #12523: fix(region): openstack eip sync
2021-10-26 19:16:08 +08:00
zhaoxiangchun
00cb7fb015 feat(monitor,cloudmon): add azure rds,redis,lb metric
1.支持azure相关资源监控
2021-10-26 17:39:19 +08:00
Qu Xuan
8b1aa2e675 fix(region): openstack eip sync 2021-10-26 15:36:02 +08:00
yunion-ci-robot
3940d23b21 Merge pull request #12522 from rainzm/automated-cherry-pick-of-#12476-upstream-release-3.8
Automated cherry pick of #12476: Webhook/extend
2021-10-26 15:18:45 +08:00
rainzm
c874e90985 feat(notify): configure the new resource and its translation 2021-10-26 14:47:24 +08:00
rainzm
5a71c664d1 feat(region): add some resources to create deleted webhook notifications 2021-10-26 14:47:24 +08:00
rainzm
17aeab6b4e feat(notify): add Action sync_create, sync_update, sync_delete 2021-10-26 14:47:24 +08:00
rainzm
b73d206365 feat(notify): update topic 2021-10-26 14:47:24 +08:00
Zexi Li
722855f8f1 Merge pull request #12521 from zexi/automated-cherry-pick-of-#12520-upstream-release-3.8
Automated cherry pick of #12520: fix(region): cdn generated code
2021-10-26 11:01:57 +08:00
Zexi Li
5f0c1cfd49 fix(region): cdn generated code 2021-10-26 11:01:27 +08:00
tb365
6b115aa28b cn-southwest-2 default bgp type 5_sbgp 2021-10-26 09:30:28 +08:00
Zexi Li
fee8a08fb9 Merge pull request #12511 from zexi/automated-cherry-pick-of-#12510-upstream-release-3.8
Automated cherry pick of #12510: fix(baremetal): TaskWorkerCount options not init
2021-10-25 15:34:55 +08:00
zhaoxiangchun
0a6daca02d fix(cloudcommon): update db_dispatcher set order by to sqlchemy.SQuery
1. 支持对使用了聚合函数的field进行orderby 操作,如:sum(amount) as
   amount
2021-10-25 14:22:15 +08:00
Zexi Li
eafd63ed99 fix(baremetal): TaskWorkerCount options not init 2021-10-25 12:03:55 +08:00
yunion-ci-robot
0c6d7f1534 Merge pull request #12506 from ioito/automated-cherry-pick-of-#12505-upstream-release-3.8
Automated cherry pick of #12505: fix(region): qcloud classic nic and storage sync
2021-10-24 16:57:09 +08:00
Qu Xuan
55db52bc3a fix(region): qcloud classic nic and storage sync 2021-10-22 18:30:52 +08:00
Zexi Li
4365c22e31 Merge pull request #12499 from ioito/automated-cherry-pick-of-#12498-upstream-release-3.8
Automated cherry pick of #12498: fix(region): hide rbd disk secret
2021-10-22 16:50:59 +08:00
Qu Xuan
904f00cc55 fix(region): hide rbd disk secret 2021-10-22 15:38:33 +08:00
Zexi Li
5350c65fdd Merge pull request #12497 from ioito/automated-cherry-pick-of-#12496-upstream-release-3.8
Automated cherry pick of #12496: fix(host): ceph snap delete
2021-10-22 15:26:55 +08:00
Qu Xuan
5be6a18f2b fix(host): ceph snap delete 2021-10-22 15:01:29 +08:00
Zexi Li
798f5e638e Merge pull request #12492 from ioito/automated-cherry-pick-of-#12491-upstream-release-3.8
Automated cherry pick of #12491: fix(region): set storage with snapshot id when change vm disk config
2021-10-22 13:13:09 +08:00
Zexi Li
29cdd2154c Merge pull request #12490 from ioito/automated-cherry-pick-of-#12486-upstream-release-3.8
Automated cherry pick of #12486: fix(host): struct disk create params
2021-10-22 11:51:41 +08:00
Qu Xuan
98a31154e5 fix(region): set storage with snapshot id when change vm disk config 2021-10-22 11:47:04 +08:00
yunion-ci-robot
14431ff1dc Merge pull request #12488 from zexi/automated-cherry-pick-of-#12487-upstream-release-3.8
Automated cherry pick of #12487: fix(host): disk snapshot file locking off
2021-10-22 11:41:16 +08:00
Qu Xuan
00c4490ec8 fix(host): struct disk create params 2021-10-22 11:33:42 +08:00
Zexi Li
c3f37211a2 fix(host): disk snapshot file locking off 2021-10-22 11:21:16 +08:00
Zexi Li
1b741f18fc Merge pull request #12472 from tb365/automated-cherry-pick-of-#12471-upstream-release-3.8
Automated cherry pick of #12471: host count add filters
2021-10-21 20:09:05 +08:00
Zexi Li
de876d1736 Merge pull request #12482 from ioito/automated-cherry-pick-of-#12481-upstream-release-3.8
Automated cherry pick of #12481: fix(host): same mountpoint rbd storage
2021-10-21 17:11:19 +08:00
Qu Xuan
65786781e1 fix(host): same mountpoint rbd storage 2021-10-21 14:36:25 +08:00
tb365
8cc318ac34 eip bind aws server fix 2021-10-21 11:57:29 +08:00
Zexi Li
22a7f0a748 Merge pull request #12479 from zexi/automated-cherry-pick-of-#12477-upstream-release-3.8
Automated cherry pick of #12477: fix(baremetal): rebuild root calculate root disk partitions incorrect
2021-10-21 11:27:53 +08:00
Zexi Li
23bde8e519 fix(baremetal): rebuild root calculate root disk partitions incorrect 2021-10-21 01:07:11 +08:00
tb365
8345f0ab8f host count add filters 2021-10-20 17:29:25 +08:00
Zexi Li
3b5c84f5e0 Merge pull request #12458 from zexi/automated-cherry-pick-of-#12457-upstream-release-3.8
Automated cherry pick of #12457: fix(baremetal): add task_worker_count option
2021-10-19 22:42:09 +08:00
Zexi Li
505303c708 Merge pull request #12461 from ioito/automated-cherry-pick-of-#12460-upstream-release-3.8
Automated cherry pick of #12460: optimized(region): improve img convert speed
2021-10-19 22:38:45 +08:00
Zexi Li
34c96d68ac Merge pull request #12468 from ioito/automated-cherry-pick-of-#12467-upstream-release-3.8
Automated cherry pick of #12467: fix(region): sync cdn domain origins
2021-10-19 22:31:39 +08:00
Zexi Li
68b341561c Merge pull request #12465 from swordqiu/automated-cherry-pick-of-#12464-upstream-release-3.8
Automated cherry pick of #12464: fix: glance depends s3fs
2021-10-19 22:29:53 +08:00
Qu Xuan
bd1cb2fc1d fix(region): sync cdn domain origins 2021-10-19 16:11:24 +08:00
Qiu Jian
69d66eef67 fix: glance depends s3fs 2021-10-19 12:30:06 +08:00
Qu Xuan
0a140753be optimized(region): improve img convert speed 2021-10-19 10:56:21 +08:00
Zexi Li
fe54f42735 fix(baremetal): add task_worker_count option 2021-10-18 22:43:44 +08:00
Zexi Li
1e53b7a995 Merge pull request #12456 from ioito/automated-cherry-pick-of-#12455-upstream-release-3.8
Automated cherry pick of #12455: fix(region): tag list for natgateways
2021-10-18 22:16:39 +08:00
Qu Xuan
40a9c4723f fix(region): tag list for natgateways 2021-10-18 19:05:55 +08:00
Zexi Li
b880951a01 Merge pull request #12349 from tb365/automated-cherry-pick-of-#12347-upstream-release-3.8
Automated cherry pick of #12347: ctyun api updates
2021-10-18 18:20:03 +08:00
Zexi Li
a0c176936e Merge pull request #12453 from ioito/automated-cherry-pick-of-#12452-upstream-release-3.8
Automated cherry pick of #12452: fix(region): capacities overflow with azure
2021-10-18 17:20:38 +08:00
Zexi Li
09c02afdac Merge pull request #12439 from ioito/automated-cherry-pick-of-#12438-upstream-release-3.8
Automated cherry pick of #12438: fix(region): allow account sync when auto sync enabled
2021-10-18 17:20:12 +08:00
Qu Xuan
3acb2469a7 fix(region): capacities overflow with azure 2021-10-18 16:13:48 +08:00
Zexi Li
6ab9b68ab5 Merge pull request #12448 from swordqiu/automated-cherry-pick-of-#12447-upstream-release-3.8
Automated cherry pick of #12447: feature: support PhoenixOS guest
2021-10-18 15:22:34 +08:00
Zexi Li
9ba603e29b Merge pull request #12450 from swordqiu/automated-cherry-pick-of-#12449-upstream-release-3.8
Automated cherry pick of #12449: fix: update server vdi and vga with correlation
2021-10-18 15:15:44 +08:00
Zexi Li
0a4f530d4b Merge pull request #12445 from swordqiu/automated-cherry-pick-of-#12444-upstream-release-3.8
Automated cherry pick of #12444: fix: glance use multicloud objectstorage client to manipulate objectstorage
2021-10-18 15:14:29 +08:00
Qiu Jian
ed3bd14773 fix: update server vdi and vga with correlation 2021-10-17 22:11:31 +08:00
Qiu Jian
bd40d802ec feature: support PhoenixOS guest 2021-10-17 04:21:29 +08:00
Qiu Jian
ea8f261ed6 fix: remove s3fs client from docker image 2021-10-17 02:53:28 +08:00
Qiu Jian
86817febe1 fix: make minio endpoint compatible with multicloud objectstorage 2021-10-17 02:53:28 +08:00
Qiu Jian
8f1d9998f1 fix: glance use multicloud objectstorage client to manipulate objectstorage 2021-10-17 02:53:28 +08:00
Qu Xuan
3026b2d73c fix(region): allow account sync when auto sync enabled 2021-10-15 14:35:34 +08:00
Zexi Li
5ea09eea51 Merge pull request #12420 from ioito/automated-cherry-pick-of-#12412-upstream-release-3.8
Automated cherry pick of #12412: fix(host): xfs unlock
2021-10-15 09:46:33 +08:00
Zexi Li
bbb91f39d9 Merge pull request #12424 from ioito/automated-cherry-pick-of-#12423-upstream-release-3.8
Automated cherry pick of #12423: fix(region): google rds tags sync
2021-10-15 09:45:34 +08:00
Zexi Li
a7bf1fc8c6 Merge pull request #12427 from rainzm/automated-cherry-pick-of-#12426-upstream-release-3.8
Automated cherry pick of #12426: fix(region): wait all goroutine finished when execute scheduled_tasks
2021-10-15 09:38:52 +08:00
Zexi Li
63b97fbad0 Merge pull request #12430 from rainzm/automated-cherry-pick-of-#12429-upstream-release-3.8
Automated cherry pick of #12429: fix(notify): robot ListItemFilter
2021-10-15 09:37:42 +08:00
Zexi Li
a0bd95fabb Merge pull request #12435 from swordqiu/automated-cherry-pick-of-#12434-upstream-release-3.8
Automated cherry pick of #12434: feature: add global mac prefix option
2021-10-15 09:37:04 +08:00
Zexi Li
f87e5c4004 Merge pull request #12433 from swordqiu/automated-cherry-pick-of-#12432-upstream-release-3.8
Automated cherry pick of #12432: fix: set qemu cpu sockets to 2 for x86 cpu
2021-10-15 09:36:24 +08:00
Qiu Jian
155f9620c6 feature: add global mac prefix option 2021-10-15 01:08:12 +08:00
Qiu Jian
48d45592e4 fix: set qemu cpu sockets to 2 for x86 cpu 2021-10-14 23:27:05 +08:00
rainzm
5ebb30ed83 fix(notify): robot ListItemFilter 2021-10-14 17:06:09 +08:00
rainzm
a09dccf981 fix(region): wait all goroutine finished when execute scheduled_tasks 2021-10-14 16:03:44 +08:00
Qu Xuan
7d49c48eff fix(region): google rds tags sync 2021-10-14 15:23:27 +08:00
Qu Xuan
9407ff7397 fix(host): xfs unlock 2021-10-14 14:32:19 +08:00
Zexi Li
7cc3a98825 Merge pull request #12399 from ioito/automated-cherry-pick-of-#12398-upstream-release-3.8
Automated cherry pick of #12398: Hotfix/qx nat cdn tags
2021-10-14 12:45:14 +08:00
Zexi Li
cea2968b04 Merge pull request #12405 from rainzm/automated-cherry-pick-of-#12403-upstream-release-3.8
Automated cherry pick of #12403: fix(devtool): change agent install metadata key
2021-10-14 12:44:43 +08:00
Zexi Li
b2b21f8095 Merge pull request #12408 from rainzm/automated-cherry-pick-of-#12407-upstream-release-3.8
Automated cherry pick of #12407: Fix changing of subscribers
2021-10-14 12:42:30 +08:00
Zexi Li
e4280eaa48 Merge pull request #12411 from rainzm/automated-cherry-pick-of-#12410-upstream-release-3.8
Automated cherry pick of #12410: fix(climc): set param 'enable' as *bool
2021-10-14 12:07:40 +08:00
Zexi Li
c6e291b425 Merge pull request #12414 from rainzm/automated-cherry-pick-of-#12413-upstream-release-3.8
Automated cherry pick of #12413: fix(notify): modify resource list of topic
2021-10-14 12:06:05 +08:00
Zexi Li
140898a2f8 Merge pull request #12416 from swordqiu/automated-cherry-pick-of-#12415-upstream-release-3.8
Automated cherry pick of #12415: fix: enable disabled select user for windows (especially for windows 10)
2021-10-14 12:05:24 +08:00
Zexi Li
32b3d831b6 Merge pull request #12397 from tb365/automated-cherry-pick-of-#12396-upstream-release-3.8
Automated cherry pick of #12396: batch add user add displayname
2021-10-14 11:15:11 +08:00
Qiu Jian
b974842932 fix: enable disabled select user for windows (especially for windows 10) 2021-10-14 00:37:44 +08:00
rainzm
30875951e1 fix(notify): modify resource list of topic 2021-10-13 19:57:28 +08:00
rainzm
c6fd3d5dbd fix(climc): set param 'enable' as *bool 2021-10-13 18:44:44 +08:00
rainzm
5414541ce5 fix(notify): support modify rolescope when change subscriber 2021-10-13 16:51:43 +08:00
rainzm
8b889fc561 fix(notify): use roleCache to display role info 2021-10-13 16:51:43 +08:00
rainzm
3ce447c35e fix(notify): SetModelManager to delete successfully 2021-10-13 16:51:43 +08:00
Qu Xuan
9a2e197c43 fix(region): cdn nat tags sync 2021-10-13 12:01:45 +08:00
Qu Xuan
dc27b93775 fix(region): sync nat and cnd tags 2021-10-13 12:01:45 +08:00
rainzm
2a49b7903b fix(devtool): change agent install metadata key
The tag beginning with sys will be overwritten by the cloud
2021-10-13 11:45:38 +08:00
Zexi Li
272e4173c2 Merge pull request #12402 from rainzm/automated-cherry-pick-of-#12401-upstream-release-3.8
Automated cherry pick of #12401: feat(cloudproxy): support generateName for createFromServer
2021-10-13 10:02:44 +08:00
rainzm
ac674553ee feat(cloudproxy): support generateName for createFromServer 2021-10-12 20:33:56 +08:00
Zexi Li
d7078cd1d6 Merge pull request #12395 from rainzm/automated-cherry-pick-of-#12394-upstream-release-3.8
Automated cherry pick of #12394: Notify fixes
2021-10-12 19:57:13 +08:00
Zexi Li
2c34090015 Merge pull request #12392 from ioito/automated-cherry-pick-of-#12391-upstream-release-3.8
Automated cherry pick of #12391: fix(region): aliyun rds tags sync
2021-10-12 19:55:58 +08:00
rainzm
b5d55c7ebc fix: change errors package 2021-10-12 18:09:56 +08:00
rainzm
62189913f1 fix(notify): modify 'dingtalk-robot' to 'workwx-robot' 2021-10-12 18:09:56 +08:00
rainzm
05e19381d8 fix(notify): remove "已经" in templ 2021-10-12 18:09:56 +08:00
rainzm
ae98388b8a fix(notify): add PENDING_DELETE tmpl 2021-10-12 18:09:56 +08:00
rainzm
da1fc9e8f3 fix(notify): get the receivers that need to be added and deleted correctly 2021-10-12 18:09:56 +08:00
Qu Xuan
ee3df76aa3 fix(region): aliyun rds tags sync 2021-10-12 18:04:59 +08:00
tb365
7ce28e78fd batch add user add displayname 2021-10-12 17:41:56 +08:00
Zexi Li
436b809249 Merge pull request #12390 from zexi/automated-cherry-pick-of-#12226-upstream-release-3.8
Automated cherry pick of #12226: [WIP] fix(baremetal): avoid redfish resp nil cause panic
2021-10-12 11:47:03 +08:00
Zexi Li
d894992e29 fix(baremetal): avoid redfish resp nil cause panic 2021-10-12 11:33:31 +08:00
Zexi Li
c0db3ead14 Merge pull request #12388 from ioito/automated-cherry-pick-of-#12387-upstream-release-3.8
Automated cherry pick of #12387: fix(region): support tag sync for mongodb
2021-10-11 19:18:23 +08:00
Qu Xuan
91dbb1b64e fix(region): support tag sync for mongodb 2021-10-11 17:12:31 +08:00
Zexi Li
7f52cc5ec0 Merge pull request #12385 from zexi/automated-cherry-pick-of-#12384-upstream-release-3.8
Automated cherry pick of #12384: fix(glance): s3 uploaded image removed
2021-10-11 15:02:39 +08:00
Zexi Li
213637679e Merge pull request #12382 from rainzm/automated-cherry-pick-of-#12381-upstream-release-3.8
Automated cherry pick of #12381: fix(devtool): creates a forward using the specified address
2021-10-11 12:45:19 +08:00
Zexi Li
02dc737ccd fix(glance): s3 uploaded image removed 2021-10-11 12:43:35 +08:00
rainzm
627e97b73a fix(devtool): creates a forward using the specified address 2021-10-11 10:55:49 +08:00
屈轩
3d8a727eb8 fix(glance): remove image clean (#12376)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2021-10-10 12:03:54 +08:00
屈轩
49366c5174 fix(host): show disk details error (#12375)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2021-10-10 12:03:41 +08:00
Zexi Li
a50782ab52 fix(climc): host-ssh use privateKey when ciphertext too short (#12371) 2021-10-10 12:02:35 +08:00
Zexi Li
974dd220e8 Merge pull request #12379 from zexi/automated-cherry-pick-of-#12378-upstream-release-3.8
Automated cherry pick of #12378: fix(monitor): use swagger ignore comment out structs
2021-10-09 21:46:56 +08:00
Zexi Li
bf99c1d824 fix(monitor): use swagger ignore comment out structs 2021-10-09 21:15:21 +08:00
Zexi Li
678626ff3a Merge pull request #12365 from ioito/automated-cherry-pick-of-#12364-upstream-release-3.8
Automated cherry pick of #12364: fix(region): fix cloudpods scheduler error
2021-10-09 09:17:06 +08:00
Zexi Li
8b6791b908 Merge pull request #12367 from zhaoxiangchun/automated-cherry-pick-of-#12366-upstream-release-3.8
Automated cherry pick of #12366: fix(monitor): alert record details add trigger_time field
2021-10-09 09:15:52 +08:00
Zexi Li
78b5b0a94c Merge pull request #12369 from rainzm/automated-cherry-pick-of-#12368-upstream-release-3.8
Automated cherry pick of #12368: Fixes for Notify Subscribers
2021-10-09 09:15:25 +08:00
rainzm
cb264e7d1a fix(notify): update mobile where appropriate 2021-10-08 21:26:47 +08:00
rainzm
6fb58e8c63 fix(notify): modify the width of ReceiverId 2021-10-08 21:26:47 +08:00
rainzm
4c12de8eea fix(notify): add default policy for subscribers 2021-10-08 21:26:47 +08:00
zhaoxiangchun
e55aa144fa fix(monitor): alert record details add trigger_time field 2021-10-08 17:13:01 +08:00
Qu Xuan
a55732b782 fix(region): fix cloudpods scheduler error 2021-10-08 15:16:41 +08:00
Zexi Li
128ea60569 Merge pull request #12363 from ioito/automated-cherry-pick-of-#12362-upstream-release-3.8
Automated cherry pick of #12362: fix(region): sync resource by capability with read only
2021-10-08 12:08:25 +08:00
Qu Xuan
0988bf1578 fix(region): sync resource by capability with read only 2021-10-08 11:48:04 +08:00
Zexi Li
42612205fd Merge pull request #12361 from tb365/automated-cherry-pick-of-#12359-upstream-release-3.8
Automated cherry pick of #12359: kvm lb update lb listener redirect code fix
2021-10-08 10:13:53 +08:00
Zexi Li
de48910c63 Merge pull request #12354 from swordqiu/automated-cherry-pick-of-#12353-upstream-release-3.8
Automated cherry pick of #12353: fix: webconsole close socket when read on error
2021-10-08 10:12:29 +08:00
tangbin
c80945338e kvm lb update lb listener redirect code fix 2021-10-08 09:42:58 +08:00
yunion-ci-robot
96973b15bd Merge pull request #12356 from zexi/automated-cherry-pick-of-#12355-upstream-release-3.8
Automated cherry pick of #12355: fix(baremetal): change cat path
2021-10-06 20:53:42 +08:00
Zexi Li
04521a1548 fix(baremetal): change cat path 2021-10-05 21:35:38 +08:00
Qiu Jian
9025a56617 fix: webconsole close socket when read on error 2021-10-03 10:52:34 +08:00
yunion-ci-robot
973ebbf9f3 Merge pull request #12351 from ioito/automated-cherry-pick-of-#12350-upstream-release-3.8
Automated cherry pick of #12350: fix(region): network brand
2021-10-01 12:54:38 +08:00
Qu Xuan
c53164e430 fix(region): network brand 2021-10-01 11:53:42 +08:00
tb365
0ac263dee1 ctyun api updates 2021-09-30 15:45:17 +08:00
Zexi Li
95aaa66c76 Merge pull request #12331 from ioito/automated-cherry-pick-of-#12317-upstream-release-3.8
Automated cherry pick of #12317: fix(region): read only capability
2021-09-30 10:09:43 +08:00
Zexi Li
1e2773bd18 Merge pull request #12344 from ioito/automated-cherry-pick-of-#12343-upstream-release-3.8
Automated cherry pick of #12343: fix(host): show error for online resize
2021-09-30 09:49:02 +08:00
Qu Xuan
e6ba4a1dc7 fix(host): show error for online resize 2021-09-29 20:30:06 +08:00
Zexi Li
e5afb63551 Merge pull request #12336 from zexi/automated-cherry-pick-of-#12335-upstream-release-3.8
Automated cherry pick of #12335: fix(baremetal): adjust adaptec raid logical volume order
2021-09-29 17:36:18 +08:00
Zexi Li
ced94cfb66 Merge pull request #12342 from zhaoxiangchun/automated-cherry-pick-of-#12341-upstream-release-3.8
Automated cherry pick of #12341: fix(monitor): update usage query param and alert record query support tigger_time
2021-09-29 17:27:19 +08:00
zhaoxiangchun
628244f7b9 fix(monitor): update usage query param and alert record query support tigger_time 2021-09-29 15:52:27 +08:00
Zexi Li
7033974ab4 Merge pull request #12339 from rainzm/automated-cherry-pick-of-#12316-upstream-release-3.8
Automated cherry pick of #12316: Notify Bug Fixes
2021-09-29 14:52:00 +08:00
Zexi Li
cb733ded80 Merge pull request #12340 from rainzm/automated-cherry-pick-of-#12325-upstream-release-3.8
Automated cherry pick of #12325: fix(region): avoid duplicate playbook names
2021-09-29 14:21:12 +08:00
rainzm
658d734ec4 fix(region): avoid duplicate playbook names 2021-09-29 14:17:12 +08:00
rainzm
2f3e6f80a7 fix(notify): optimization of message template 2021-09-29 14:13:19 +08:00
rainzm
c4b5f59e11 fix(notify): add connect info in EXPIRED_RELEASE template 2021-09-29 14:13:18 +08:00
rainzm
5a5cca4110 fix(notify): remove disk in 'update' topic 2021-09-29 14:13:18 +08:00
rainzm
5f8c36b407 fix(notify): solve the permission problem of subscriber 2021-09-29 14:13:18 +08:00
rainzm
a62ac5fb30 fix(notify): allow list and get topics for all 2021-09-29 14:13:18 +08:00
rainzm
9694075bee fix(notify): correctly use tenant cache to query domain 2021-09-29 14:13:18 +08:00
rainzm
4e84ace30a fix(notify): check for duplicate subscribers when creating 2021-09-29 14:13:18 +08:00
rainzm
e96dbaba60 fix(notify): update database when change subscriber's identification 2021-09-29 14:13:18 +08:00
rainzm
05d7a87c1b fix(cloudcommon): set Priority as normal when calling EventNotify 2021-09-29 14:13:18 +08:00
rainzm
d94ddc43a4 fix(notify): repull subcontact correctly when creating or deleting config 2021-09-29 14:13:18 +08:00
rainzm
57d3e37c08 fix(notify): modify NotifyRobotWithCtx 2021-09-29 14:13:18 +08:00
rainzm
ce7dd991d2 fix(notify): change the delivery format of config and eliminate some redundant steps of sending messages 2021-09-29 14:13:18 +08:00
Zexi Li
6364389877 fix(baremetal): adjust adaptec raid logical volume order 2021-09-29 12:16:12 +08:00
Zexi Li
3c2f99313b Merge pull request #12334 from zhaoxiangchun/automated-cherry-pick-of-#12333-upstream-release-3.8
Automated cherry pick of #12333: fix(monitor): shield list support alert_name and res_name like query
2021-09-29 11:29:18 +08:00
Zexi Li
e91bc4e8fb Merge pull request #12332 from ioito/automated-cherry-pick-of-#12104-upstream-release-3.8
Automated cherry pick of #12104: fix(region): optimized vm disk sync
2021-09-29 11:28:48 +08:00
zhaoxiangchun
946a0395ad fix(monitor): shield list support alert_name and res_name like query 2021-09-28 20:41:22 +08:00
Qu Xuan
dea562a733 fix(region): optimized vm disk sync 2021-09-28 20:10:53 +08:00
Qu Xuan
a552c3ff85 fix(region): read only capability 2021-09-28 20:10:05 +08:00
Zexi Li
cc5d7713e4 Merge pull request #12329 from ioito/automated-cherry-pick-of-#12328-upstream-release-3.8
Automated cherry pick of #12328: fix(region): optimized dns zone sync
2021-09-28 19:56:10 +08:00
Qu Xuan
a94b00604d fix(region): optimized dns zone sync 2021-09-28 19:32:49 +08:00
Zexi Li
3d5361bee1 Merge pull request #12323 from ioito/automated-cherry-pick-of-#12322-upstream-release-3.8
Automated cherry pick of #12322: fix(region): support query for project domain statistic
2021-09-28 17:58:46 +08:00
Zexi Li
8c44e4e3e9 Merge pull request #12321 from ioito/automated-cherry-pick-of-#12320-upstream-release-3.8
Automated cherry pick of #12320: fix(region): set google vm running after start
2021-09-28 17:58:28 +08:00
Zexi Li
d46f44ccc1 Merge pull request #12319 from zhaoxiangchun/automated-cherry-pick-of-#12318-upstream-release-3.8
Automated cherry pick of #12318: feat(cloudmon): usage add domain.servers and project.servers statistic
2021-09-28 17:57:48 +08:00
Qu Xuan
3f06837b92 fix(region): support query for project domain statistic 2021-09-27 17:10:47 +08:00
Qu Xuan
2c6aa4fb09 fix(region): set google vm running after start 2021-09-27 16:52:10 +08:00
zhaoxiangchun
7835d0521b feat(cloudmon): usage add domain.servers and project.servers statistic 2021-09-27 15:16:07 +08:00
Zexi Li
a43a3dc4bc Merge pull request #12308 from zhaoxiangchun/automated-cherry-pick-of-#12307-upstream-release-3.8
Automated cherry pick of #12307: fix(monitor): monitor alert support multi robot
2021-09-27 00:43:43 +08:00
Zexi Li
99fb78de35 Merge pull request #12306 from ioito/automated-cherry-pick-of-#12301-upstream-release-3.8
Automated cherry pick of #12301: fix(region): usage for domain isolated dev
2021-09-27 00:42:43 +08:00
Zexi Li
e7d67a41f5 Merge pull request #12303 from ioito/automated-cherry-pick-of-#12302-upstream-release-3.8
Automated cherry pick of #12302: fix(region): aliyun rds billing type
2021-09-26 20:10:58 +08:00
Zexi Li
5f1d1f748f Merge pull request #12312 from swordqiu/automated-cherry-pick-of-#12311-upstream-release-3.8
Automated cherry pick of #12311: fix: host add disable_kvm option
2021-09-26 20:09:54 +08:00
Zexi Li
8189fdb496 Merge pull request #12315 from zhaoxiangchun/automated-cherry-pick-of-#12314-upstream-release-3.8
Automated cherry pick of #12314: fix(monitor): monitor shield fix
2021-09-26 20:09:12 +08:00
zhaoxiangchun
609db4298d fix(monitor): monitor shield fix
1.支持resName过滤
2.告警屏蔽默认屏蔽时间为100year
2021-09-26 19:24:54 +08:00
yunion-ci-robot
09f31ce467 Merge pull request #12310 from tb365/automated-cherry-pick-of-#12309-upstream-release-3.8
Automated cherry pick of #12309: climc update: google account update
2021-09-26 17:40:34 +08:00
Qiu Jian
7cad0e5ee6 fix: host add disable_kvm option 2021-09-26 17:36:25 +08:00
tb365
d5355f21bb climc update: google account update 2021-09-26 17:27:56 +08:00
yunion-ci-robot
e9f6a90bc5 Merge pull request #12300 from zexi/automated-cherry-pick-of-#12241-upstream-release-3.8
Automated cherry pick of #12241: feat(baremetal): adaptec raid driver
2021-09-26 17:21:35 +08:00
zhaoxiangchun
b281ab8543 fix(monitor): monitor alert support multi robot
1. 机器人下放到域后监控报警支持
2021-09-26 16:36:24 +08:00
Qu Xuan
60b333bd1f fix(region): usage for domain isolated dev 2021-09-26 15:58:29 +08:00
Qu Xuan
b3093fbfd6 fix(region): aliyun rds billing type 2021-09-26 15:55:50 +08:00
Zexi Li
f8822c745a feat(baremetal): adaptec raid driver 2021-09-26 11:45:02 +08:00
Zexi Li
4c3adeb328 Merge pull request #12292 from zhaoxiangchun/automated-cherry-pick-of-#12291-upstream-release-3.8
Automated cherry pick of #12291: fix(monitor): project view hide cloudaccount resource
2021-09-26 10:06:10 +08:00
Zexi Li
25c473a435 Merge pull request #12266 from ioito/automated-cherry-pick-of-#12259-upstream-release-3.8
Automated cherry pick of #12259: fix(region): optimized validate delete condition query
2021-09-26 10:03:24 +08:00
Zexi Li
d65471ec41 Merge pull request #12294 from ioito/automated-cherry-pick-of-#12293-upstream-release-3.8
Automated cherry pick of #12293: fix(region): add project and domain statistic
2021-09-26 09:57:52 +08:00
Zexi Li
8961bf4968 Merge pull request #12296 from swordqiu/automated-cherry-pick-of-#12295-upstream-release-3.8
Automated cherry pick of #12295: fix: clean openvswitch config files when save images
2021-09-26 09:56:54 +08:00
Qiu Jian
157921f5c4 fix: clean openvswitch config files when save images 2021-09-24 22:01:17 +08:00
Qu Xuan
cd65b9498b fix(region): add project and domain statistic 2021-09-24 18:59:59 +08:00
zhaoxiangchun
f850e179f2 fix(monitor): project view hide cloudaccount resource 2021-09-24 17:57:33 +08:00
Zexi Li
cf7c8fb03f Merge pull request #12279 from ioito/automated-cherry-pick-of-#12278-upstream-release-3.8
Automated cherry pick of #12278: fix(region): google vm mac addr
2021-09-24 15:25:29 +08:00
Zexi Li
ace44f9490 Merge pull request #12276 from ioito/automated-cherry-pick-of-#12275-upstream-release-3.8
Automated cherry pick of #12275: fix(region): sync aws rds mem size
2021-09-24 15:25:06 +08:00
Zexi Li
72f6412f6c Merge pull request #12282 from swordqiu/automated-cherry-pick-of-#12281-upstream-release-3.8
Automated cherry pick of #12281: fix: disable password expiration for cloudroot
2021-09-24 15:24:11 +08:00
Zexi Li
1eeb11be87 Merge pull request #12286 from ioito/automated-cherry-pick-of-#12285-upstream-release-3.8
Automated cherry pick of #12285: fix(region): export field duplicate vpc
2021-09-24 15:23:20 +08:00
Zexi Li
acab975d94 Merge pull request #12274 from zhaoxiangchun/automated-cherry-pick-of-#12272-upstream-release-3.8
Automated cherry pick of #12272: fix(monitor): fix cloudaccount monitor query return field err
2021-09-24 10:28:12 +08:00
Qu Xuan
b2c52fd1fe fix(region): export field duplicate vpc 2021-09-24 10:00:21 +08:00
Qiu Jian
e6975a6474 fix: disable password expiration for cloudroot 2021-09-24 01:27:30 +08:00
yunion-ci-robot
7c1d16cc63 Merge pull request #12270 from zexi/automated-cherry-pick-of-#12268-upstream-release-3.8
Automated cherry pick of #12268: fix(host): disable usb-kbd for windows 10
2021-09-24 00:28:40 +08:00
Qu Xuan
17c6698073 fix(region): google vm mac addr 2021-09-23 20:28:54 +08:00
Qu Xuan
ea4f290f8c fix(region): sync aws rds mem size 2021-09-23 20:06:11 +08:00
zhaoxiangchun
c5e8ff9b39 fix(monitor): fix alert record shield
1. 修复报警屏蔽列表不显示时间的问题
2. 未恢复报警增加报警策略名称字段
2021-09-23 18:09:37 +08:00
zhaoxiangchun
10ad4c32dc fix(monitor): fix cloudaccount monitor query return field err 2021-09-23 18:09:37 +08:00
Zexi Li
625d7ef304 fix(host): disable usb-kbd for windows 10 2021-09-23 15:11:51 +08:00
Qu Xuan
f68567e28c fix(region): optimized validate delete condition query 2021-09-23 10:00:05 +08:00
Zexi Li
a368985923 Merge pull request #12260 from swordqiu/automated-cherry-pick-of-#12258-upstream-release-3.8
Automated cherry pick of #12258: fix: verify token with expired_at field instead of depending on options.TokenExpirationSeconds
2021-09-23 09:37:54 +08:00
Zexi Li
a12e235fe3 Merge pull request #12264 from ioito/automated-cherry-pick-of-#12263-upstream-release-3.8
Automated cherry pick of #12263: fix(region): external project support domain sync
2021-09-23 09:36:16 +08:00
Qu Xuan
27ec4567cc fix(region): external project support domain sync 2021-09-22 23:11:08 +08:00
Qiu Jian
020092cc4d fix: verify token with expired_at field instead of options.TokenExpirationSeconds 2021-09-22 15:35:21 +08:00
Zexi Li
d64f80ddc8 Merge pull request #12244 from rainzm/automated-cherry-pick-of-#12243-upstream-release-3.8
Automated cherry pick of #12243: fix(region): consider the network of the entire VPC when merging networks
2021-09-22 11:57:27 +08:00
Zexi Li
cee3246346 Merge pull request #12223 from zexi/automated-cherry-pick-of-#12222-upstream-release-3.8
Automated cherry pick of #12222: fix(scheduler): cpu arch match
2021-09-22 11:56:21 +08:00
Zexi Li
7da7ffcb7a Merge pull request #12257 from ioito/automated-cherry-pick-of-#12253-upstream-release-3.8
Automated cherry pick of #12253: fix(region): optimzed network query
2021-09-22 11:30:14 +08:00
Zexi Li
22e2896afc fix(scheduler): cpu arch match 2021-09-22 11:14:06 +08:00
Qu Xuan
c63ed9093b fix(region): optimzed network query 2021-09-18 18:58:31 +08:00
Zexi Li
9f4fc77bd2 Merge pull request #12237 from rainzm/automated-cherry-pick-of-#12236-upstream-release-3.8
Automated cherry pick of #12236: fix: ensure the success of vgrenam
2021-09-18 16:36:36 +08:00
Zexi Li
8702653395 Merge pull request #12255 from ioito/automated-cherry-pick-of-#12254-upstream-release-3.8
Automated cherry pick of #12254: fix(host): ceph snap delete
2021-09-18 16:31:05 +08:00
Qu Xuan
44d738a0b8 fix(host): ceph snap delete 2021-09-18 14:19:43 +08:00
Zexi Li
032353b0cc Merge pull request #12234 from zexi/automated-cherry-pick-of-#12227-upstream-release-3.8
Automated cherry pick of #12227: feat(climc): SSH login of a host by private key
2021-09-17 16:53:15 +08:00
Zexi Li
a6a2e4c288 Merge pull request #12242 from ioito/automated-cherry-pick-of-#12240-upstream-release-3.8
Automated cherry pick of #12240: fix(hostman): rbd command
2021-09-17 16:52:07 +08:00
Zexi Li
0f67656287 Merge pull request #12251 from ioito/automated-cherry-pick-of-#12250-upstream-release-3.8
Automated cherry pick of #12250: fix(region): get region driver
2021-09-17 16:48:14 +08:00
Zexi Li
5ad7bbf61c Merge pull request #12248 from ioito/automated-cherry-pick-of-#12247-upstream-release-3.8
Automated cherry pick of #12247: fix(scheduler): openstack scheduler options
2021-09-17 16:34:27 +08:00
Qu Xuan
22dbb38ff5 fix(region): get region driver 2021-09-17 16:28:11 +08:00
Qu Xuan
420c1968dc fix(scheduler): openstack scheduler options 2021-09-17 16:08:10 +08:00
rainzm
07f482da0f fix(region): consider the network of the entire VPC when merging networks 2021-09-17 14:54:33 +08:00
Qu Xuan
dbee3ec258 fix(hostman): rbd command 2021-09-17 14:20:32 +08:00
Zexi Li
aab33d1355 Merge pull request #12238 from ioito/automated-cherry-pick-of-#12213-upstream-release-3.8
Automated cherry pick of #12213: fix(cloudmon): batch send data
2021-09-17 09:34:52 +08:00
Qu Xuan
8e495f1589 fix(cloudmon): batch send data 2021-09-16 19:41:22 +08:00
rainzm
67513c50c8 fix(host-deployer): ensure the success of vgrenam 2021-09-16 17:49:09 +08:00
rainzm
95abcef299 feat(host-deployer): try again if the partition cannot be found 2021-09-16 17:49:09 +08:00
Stargic
1c2472ae87 feat(climc): SSH login of a host by private key 2021-09-16 15:13:00 +08:00
Zexi Li
ce3e4ac385 Merge pull request #12220 from ioito/automated-cherry-pick-of-#12219-upstream-release-3.8
Automated cherry pick of #12219: fix(region): disk choice master host with os arch
2021-09-15 22:32:30 +08:00
Zexi Li
5e787456b7 Merge pull request #12229 from swordqiu/automated-cherry-pick-of-#12228-upstream-release-3.8
Automated cherry pick of #12228: fix: climc event-show filter by resource name
2021-09-15 22:17:27 +08:00
yunion-ci-robot
5a55a17967 Merge pull request #12231 from zexi/automated-cherry-pick-of-#12230-upstream-release-3.8
Automated cherry pick of #12230: fix(baremetal): parse mptsas duplicated devices
2021-09-15 21:57:34 +08:00
Zexi Li
c1a03c16b3 fix(baremetal): parse mptsas duplicated devices 2021-09-15 21:19:19 +08:00
Qiu Jian
1fc6c8b42e fix: climc event-show filter by resource name 2021-09-15 20:43:34 +08:00
Qu Xuan
a51b977953 fix(region): disk choice master host with os arch 2021-09-15 12:17:33 +08:00
Zexi Li
b6fc27d64f Merge pull request #12215 from zhaoxiangchun/automated-cherry-pick-of-#12214-upstream-release-3.8
Automated cherry pick of #12214: fix(cloudmon): Azure metric pull support metric interval
2021-09-15 10:02:40 +08:00
Zexi Li
aa2445d1c4 Merge pull request #12218 from zexi/automated-cherry-pick-of-#12202-upstream-release-3.8
Automated cherry pick of #12202: feat(climc): SSH Login with cloudroot (add new parameter --use-cloudroot in server-ssh)
2021-09-15 09:41:55 +08:00
Zexi Li
80670214be Merge pull request #12207 from swordqiu/automated-cherry-pick-of-#12206-upstream-release-3.8
Automated cherry pick of #12206: fix: AWS asume role with optional name
2021-09-15 01:15:14 +08:00
Stargic
76c9d8a5ae feat(climc): SSH Login with cloudroot (add new parameter --use-cloudroot in server-ssh)
fix(climc): Fixed the code logic error of FOR loop in server-ssh
2021-09-15 01:14:12 +08:00
zhaoxiangchun
5fd3aebbb1 fix(cloudmon): Azure metric pull support metric interval 2021-09-14 19:32:39 +08:00
Zexi Li
04d533138f Merge pull request #12212 from zexi/automated-cherry-pick-of-#12166-upstream-release-3.8
Automated cherry pick of #12166: feat(region): add cloudcache for dnszone and secgroup details
2021-09-14 16:22:27 +08:00
rainzm
7547142600 feat(region): add cloudcache for dnszone and secgroup details 2021-09-14 16:21:00 +08:00
Zexi Li
7166a100ec Merge pull request #12200 from ioito/automated-cherry-pick-of-#12199-upstream-release-3.8
Automated cherry pick of #12199: fix(region): apsara metric data
2021-09-14 16:17:56 +08:00
Zexi Li
3ff4d65300 Merge pull request #12211 from tb365/automated-cherry-pick-of-#12209-upstream-release-3.8
Automated cherry pick of #12209: fix(region): change aws disk iops
2021-09-14 16:16:31 +08:00
tb365
b61399f12e fix(region): change aws disk iops 2021-09-14 16:03:14 +08:00
Qu Xuan
1d4565807f fix(region): apsara metric data 2021-09-14 11:35:38 +08:00
Qiu Jian
5b232c2ff2 fix: AWS asume role with optional name 2021-09-14 00:50:28 +08:00
yunion-ci-robot
281698906d Merge pull request #12204 from zexi/automated-cherry-pick-of-#12203-upstream-release-3.8
Automated cherry pick of #12203: feat(cloudmon): support classic vm metrics
2021-09-13 23:01:29 +08:00
Zexi Li
c25535d21b feat(cloudmon): support classic vm metrics 2021-09-13 22:33:57 +08:00
Zexi Li
cb0d0b68b2 Merge pull request #12198 from tb365/automated-cherry-pick-of-#12196-upstream-release-3.8
Automated cherry pick of #12196: pure hcso zone is not empty fix
2021-09-13 17:08:59 +08:00
Zexi Li
f6c9aa09ea Merge pull request #12194 from ioito/automated-cherry-pick-of-#12193-upstream-release-3.8
Automated cherry pick of #12193: fix(region): apsara resource group
2021-09-13 17:05:31 +08:00
tb365
2eec54723e pure hcso zone is not empty fix 2021-09-13 14:27:31 +08:00
Qu Xuan
f78047601b fix(region): apsara resource group 2021-09-13 10:15:21 +08:00
Zexi Li
63cd9bec46 Merge pull request #12190 from zexi/automated-cherry-pick-of-#12189-upstream-release-3.8
Automated cherry pick of #12189: fix(region): isolated_device desc include addr
2021-09-10 20:30:39 +08:00
Zexi Li
57bc6f1445 fix(region): isolated_device desc include addr 2021-09-10 19:36:56 +08:00
yunion-ci-robot
d5e6532711 Merge pull request #12185 from ioito/automated-cherry-pick-of-#12184-upstream-release-3.8
Automated cherry pick of #12184: fix(region): qcloud database sync
2021-09-10 19:16:27 +08:00
Zexi Li
4d511c98e9 Merge pull request #12177 from ioito/automated-cherry-pick-of-#12176-upstream-release-3.8
Automated cherry pick of #12176: fix(region): huawei region id with project name
2021-09-10 19:08:54 +08:00
Zexi Li
f96c1f9fd2 Merge pull request #12182 from ioito/automated-cherry-pick-of-#12181-upstream-release-3.8
Automated cherry pick of #12181: Hotfix/qx apsara project
2021-09-10 19:08:08 +08:00
Qu Xuan
315054703c fix(region): qcloud database sync 2021-09-10 18:30:44 +08:00
Qu Xuan
f9064a0018 fix(region): sync apsara project info 2021-09-10 18:00:48 +08:00
Qu Xuan
6641eb15f0 fix(region): support apsara project 2021-09-10 18:00:47 +08:00
Qu Xuan
59f837c0e3 fix(region): 不能通过华为云用户创建时间判断云账号注册时间 2021-09-10 17:18:02 +08:00
Qu Xuan
e5891349cd fix(region): huawei region id with project name 2021-09-10 17:18:02 +08:00
Zexi Li
fe9f5fa4cc Merge pull request #12174 from zexi/automated-cherry-pick-of-#12125-upstream-release-3.8
Automated cherry pick of #12125: fix(climc): SSH terminal window changes with the change of local terminal
2021-09-10 14:47:39 +08:00
Stargic
76b110445e fix(climc): SSH terminal window changes with the change of local terminal 2021-09-10 11:55:53 +08:00
Zexi Li
d274e3078c Merge pull request #12172 from ioito/automated-cherry-pick-of-#12171-upstream-release-3.8
Automated cherry pick of #12171: fix(scheduler): options for openstack scheduler
2021-09-10 11:54:06 +08:00
Zexi Li
e1269cf9fe Merge pull request #12169 from ioito/automated-cherry-pick-of-#12168-upstream-release-3.8
Automated cherry pick of #12168: fix(region): optimized qcloud tag sync
2021-09-09 20:25:58 +08:00
Qu Xuan
5a972e6ddf fix(scheduler): options for openstack scheduler 2021-09-09 17:55:02 +08:00
Qu Xuan
a905f67fb2 fix(region): optimized qcloud tag sync 2021-09-09 17:38:58 +08:00
Zexi Li
9bca310026 Merge pull request #12163 from ioito/automated-cherry-pick-of-#12162-upstream-release-3.8
Automated cherry pick of #12162: fix(region): sync apsara region
2021-09-09 16:29:33 +08:00
Qu Xuan
edcbf3b2d3 fix(region): sync apsara region 2021-09-09 15:48:57 +08:00
Zexi Li
e09c21d452 Merge pull request #12158 from swordqiu/automated-cherry-pick-of-#12157-upstream-release-3.8
Automated cherry pick of #12157: fix: set disk driver and network driver for converting esxi to kvm
2021-09-08 23:06:31 +08:00
Zexi Li
f270daa6ae Merge pull request #12153 from zhaoxiangchun/automated-cherry-pick-of-#12152-upstream-release-3.8
Automated cherry pick of #12152: fix(monitor): add record shield details param
2021-09-08 23:05:53 +08:00
Zexi Li
49d1f6ee1e Merge pull request #12150 from zhaoxiangchun/automated-cherry-pick-of-#12149-upstream-release-3.8
Automated cherry pick of #12149: fix(monitor): add monitor resource details field
2021-09-08 22:52:16 +08:00
Zexi Li
bdf015668f Merge pull request #12155 from ioito/automated-cherry-pick-of-#12154-upstream-release-3.8
Automated cherry pick of #12154: fix(region): sync aliyun qcloud default project
2021-09-08 22:51:31 +08:00
Qiu Jian
334ae46514 fix: set disk driver and network driver for converting esxi to kvm 2021-09-08 22:29:09 +08:00
Qu Xuan
cbbf5c28e1 fix(region): sync aliyun qcloud default project 2021-09-08 20:27:39 +08:00
zhaoxiangchun
f517795c85 fix(monitor): add record shield details param 2021-09-08 18:05:21 +08:00
zhaoxiangchun
82b05b2cd1 fix(monitor): add monitor resource details field 2021-09-08 17:39:17 +08:00
Zexi Li
429d38f06d Merge pull request #12142 from rainzm/automated-cherry-pick-of-#12141-upstream-release-3.8
Automated cherry pick of #12141: fix(devtool): get tenant info via correct field
2021-09-08 16:25:26 +08:00
Zexi Li
b50d54d8cc Merge pull request #12146 from ioito/automated-cherry-pick-of-#12145-upstream-release-3.8
Automated cherry pick of #12145: fix(region): resource apsara resource id not found error
2021-09-08 16:20:33 +08:00
Qu Xuan
d4104bb98d fix(region): resource apsara resource id not found error 2021-09-08 15:54:27 +08:00
Zexi Li
c8b1cfc397 Merge pull request #12138 from ioito/automated-cherry-pick-of-#12126-upstream-release-3.8
Automated cherry pick of #12126: fix(region): apsara default region
2021-09-08 15:53:44 +08:00
rainzm
df3d24b40a fix(devtool): get tenant info via correct field 2021-09-08 15:34:30 +08:00
Qu Xuan
3483446885 fix(region): apsara default region 2021-09-08 14:27:02 +08:00
Zexi Li
b84b5786ed Merge pull request #12127 from ioito/automated-cherry-pick-of-#12126-upstream-release-3.8
Automated cherry pick of #12126: fix(region): apsara default region
2021-09-08 13:58:15 +08:00
Zexi Li
ad4f0da021 Merge pull request #12135 from swordqiu/automated-cherry-pick-of-#12134-upstream-release-3.8
Automated cherry pick of #12134: fix(region): change disk and network drivers for Esxi converted VM
2021-09-08 12:01:41 +08:00
Qiu Jian
31aa3e36ee fix(region): change disk and network drivers for Esxi converted VM 2021-09-08 11:47:51 +08:00
Zexi Li
c4c095e0f8 Merge pull request #12131 from tb365/automated-cherry-pick-of-#12130-upstream-release-3.8
Automated cherry pick of #12130: fix(region): hcso sync server fix
2021-09-08 10:47:24 +08:00
tb365
a9a1c64ef0 fix(region): hcso sync server fix 2021-09-08 10:42:16 +08:00
Qu Xuan
dda5a309ac fix(region): apsara default region 2021-09-08 10:35:29 +08:00
Zexi Li
328dcf8ebb Merge pull request #12122 from ioito/automated-cherry-pick-of-#12121-upstream-release-3.8
Automated cherry pick of #12121: fix(region): apsara endpoint fix
2021-09-07 15:25:46 +08:00
Qu Xuan
7628bd2a81 fix(region): apsara endpoint fix 2021-09-07 14:28:33 +08:00
Zexi Li
237a54a79f Merge pull request #12118 from rainzm/automated-cherry-pick-of-#12117-upstream-release-3.8
Automated cherry pick of #12117: fix(devtool): create serviceurl
2021-09-07 10:50:20 +08:00
rainzm
1927f32109 fix(devtool): create serviceurl 2021-09-07 10:36:44 +08:00
Zexi Li
9dcabdb247 Merge pull request #12116 from tb365/automated-cherry-pick-of-#12114-upstream-release-3.8
Automated cherry pick of #12114: NetworkUsableZoneIds remove duplicate zone ids
2021-09-06 21:48:01 +08:00
tb365
6785b43bad NetworkUsableZoneIds remove duplicate zone ids 2021-09-06 14:43:52 +08:00
yunion-ci-robot
a51f8b6c2c Merge pull request #12113 from ioito/automated-cherry-pick-of-#12112-upstream-release-3.8
Automated cherry pick of #12112: fix(region): sku region info
2021-09-06 00:16:24 +08:00
Qu Xuan
40127b24e6 fix(region): sku region info 2021-09-05 22:56:25 +08:00
Zexi Li
d2f608696f Merge pull request #12106 from rainzm/automated-cherry-pick-of-#12105-upstream-release-3.8
Automated cherry pick of #12105: feat(devtool): add sshinfo and serviceurl
2021-09-05 16:58:43 +08:00
rainzm
a38f03516e feat(devtool): add sshinfo and serviceurl 2021-09-04 18:29:06 +08:00
yunion-ci-robot
e7935d6412 Merge pull request #12103 from ioito/automated-cherry-pick-of-#12102-upstream-release-3.8
Automated cherry pick of #12102: fix(host): return cache image error
2021-09-03 15:17:22 +08:00
Qu Xuan
4a72e87323 fix(host): return cache image error 2021-09-03 10:46:54 +08:00
Zexi Li
a6295d340a fix(baremetal): reindex nic (#12089) 2021-09-03 02:39:44 +08:00
Zexi Li
e8338f2832 Merge pull request #12076 from ioito/automated-cherry-pick-of-#12075-upstream-release-3.8
Automated cherry pick of #12075: fix(region): struct guest json desc
2021-09-02 23:15:48 +08:00
Zexi Li
f87d0e905a Merge pull request #12091 from zexi/automated-cherry-pick-of-#12090-upstream-release-3.8
Automated cherry pick of #12090: fix(climc-base): update tag to 20210901
2021-09-02 23:14:45 +08:00
Zexi Li
9274649334 Merge pull request #12096 from tb365/automated-cherry-pick-of-#12094-upstream-release-3.8
Automated cherry pick of #12094: fix(region): lb list search address fix
2021-09-02 18:33:08 +08:00
Zexi Li
13b05bf0c6 Merge pull request #12098 from zhaoxiangchun/automated-cherry-pick-of-#12097-upstream-release-3.8
Automated cherry pick of #12097: fix(monitor): monitor resource apiHelper fix
2021-09-02 18:27:17 +08:00
Zexi Li
2069057967 Merge pull request #12101 from ioito/automated-cherry-pick-of-#12100-upstream-release-3.8
Automated cherry pick of #12100: fix(region): cloudpods misc fix
2021-09-02 18:26:18 +08:00
Qu Xuan
197ff6f805 fix(region): cloudpods network scheduler 2021-09-02 17:21:52 +08:00
Qu Xuan
c52ee7d073 fix(region): cloudpods misc fix 2021-09-02 17:21:52 +08:00
zhaoxiangchun
3eafa21456 fix(monitor): monitor resource apiHelper fix
1. apiHeleper 中增加interface,对应的ModelSet可以指定资源过滤参数
2. monitor删除过期的资源
2021-09-02 14:39:20 +08:00
tb365
749d063a61 fix(region): lb list search address fix 2021-09-02 14:16:33 +08:00
Zexi Li
7ee8b8abe5 Merge pull request #12068 from rainzm/automated-cherry-pick-of-#12067-upstream-release-3.8
Automated cherry pick of #12067: feat(region): allow custom sshport when make sshable
2021-09-02 11:43:41 +08:00
Zexi Li
3353aa0062 fix(climc-base): update tag to 20210901 2021-09-01 20:17:49 +08:00
Zexi Li
8e493053ee Merge pull request #12081 from ioito/automated-cherry-pick-of-#12080-upstream-release-3.8
Automated cherry pick of #12080: fix(region): access group policy
2021-09-01 16:35:52 +08:00
Zexi Li
eb307bbffd Merge pull request #12079 from tb365/automated-cherry-pick-of-#12077-upstream-release-3.8
Automated cherry pick of #12077: lb list api support search elastic ip
2021-09-01 15:17:06 +08:00
Zexi Li
904f6b3358 Merge pull request #12084 from swordqiu/automated-cherry-pick-of-#12083-upstream-release-3.8
Automated cherry pick of #12083: fix: add ceph-common to climc image, so as to make rbcli work
2021-09-01 14:48:11 +08:00
Qiu Jian
161cec3a08 fix: add ceph-common to climc image, so as to make rbcli work 2021-09-01 12:36:10 +08:00
rainzm
8c6d9ad876 feat(region): allow custom sshport when make sshable 2021-09-01 11:43:24 +08:00
Qu Xuan
bdeed9e7a8 fix(region): access group policy 2021-09-01 11:18:04 +08:00
tb365
b9f3f55e62 lb list api support search elastic ip 2021-09-01 11:12:21 +08:00
Qu Xuan
aa60326bc3 fix(region): struct guest json desc 2021-09-01 09:44:55 +08:00
Zexi Li
43deb292fb Merge pull request #12073 from swordqiu/automated-cherry-pick-of-#12072-upstream-release-3.8
Automated cherry pick of #12072: fix: do not lock system account user
2021-08-31 21:01:49 +08:00
Zexi Li
99eaebe34a Merge pull request #12069 from zexi/automated-cherry-pick-of-#12066-upstream-release-3.8
Automated cherry pick of #12066: fix(climc): host-delete use batch delete function
2021-08-31 18:35:04 +08:00
Qiu Jian
5afb0c82a8 fix: do not lock system account user 2021-08-31 17:44:46 +08:00
Zexi Li
8fbd42e535 Merge pull request #12045 from tb365/automated-cherry-pick-of-#12043-upstream-release-3.8
Automated cherry pick of #12043: count host fix
2021-08-31 16:25:22 +08:00
tb365
c57c4cc5b2 change host type to hcso 2021-08-31 15:49:22 +08:00
tb365
c7ad1243be count host fix 2021-08-31 15:49:22 +08:00
Zexi Li
18b008d838 Merge pull request #12064 from tb365/automated-cherry-pick-of-#12062-upstream-release-3.8
Automated cherry pick of #12062: Bugfix/tb bugfix 083101
2021-08-31 15:16:38 +08:00
Zexi Li
36b91f5afe fix(climc): host-delete use batch delete function 2021-08-31 15:13:19 +08:00
Zexi Li
fe0f3b01b9 Merge pull request #12060 from ioito/automated-cherry-pick-of-#12059-upstream-release-3.8
Automated cherry pick of #12059: fix(region): eip project sync
2021-08-31 11:32:00 +08:00
tb365
45219f3cf4 make fmt 2021-08-31 11:24:40 +08:00
tb365
eebdd2b591 rename huaweicloudstack to hcso 2021-08-31 11:24:40 +08:00
tb365
18e806ba7d syncRemoveCloudHost purge host 2021-08-31 11:24:40 +08:00
Qu Xuan
45dd2ece7c fix(region): eip project sync 2021-08-31 10:34:07 +08:00
Zexi Li
bb62477f80 Merge pull request #12041 from rainzm/automated-cherry-pick-of-#12040-upstream-release-3.8
Automated cherry pick of #12040: feat(region): add no_tags options to filter guests
2021-08-31 10:01:41 +08:00
Zexi Li
a6340afcbe Merge pull request #12057 from rainzm/automated-cherry-pick-of-#12056-upstream-release-3.8
Automated cherry pick of #12056: fix(region): delete the wrong tag 'nullable:false'
2021-08-31 09:56:38 +08:00
rainzm
fc9e1719b7 fix(region): delete the wrong tag 'nullable:false' 2021-08-30 16:54:00 +08:00
rainzm
73a8a01b63 feat(region): add no_tags options to filter guests
no_tags filter the guests without `no_tags`
2021-08-30 16:47:50 +08:00
Zexi Li
1455c52270 Merge pull request #12054 from ioito/automated-cherry-pick-of-#12053-upstream-release-3.8
Automated cherry pick of #12053: fix(region): sync vm os type
2021-08-30 15:04:25 +08:00
Qu Xuan
c810ea46c6 fix(region): sync vm os type 2021-08-30 14:29:40 +08:00
Zexi Li
9b9bcc881e Merge pull request #12052 from zexi/automated-cherry-pick-of-#12050-upstream-release-3.8
Automated cherry pick of #12050: fix(glance): image fuzzy match by distro
2021-08-27 18:02:46 +08:00
Zexi Li
0a4ad0a305 fix(glance): image fuzzy match by distro 2021-08-27 18:01:26 +08:00
Zexi Li
4573622ba5 Merge pull request #12039 from zhaoxiangchun/automated-cherry-pick-of-#12038-upstream-release-3.8
Automated cherry pick of #12038: fix(monitor): monitor rds sync
2021-08-27 16:58:32 +08:00
Zexi Li
11cd699c9c Merge pull request #12049 from ioito/automated-cherry-pick-of-#11987-upstream-release-3.8
Automated cherry pick of #11987: feat(region): cloudpods operation
2021-08-27 16:49:49 +08:00
Qu Xuan
ef873d9f77 feat(region): cloudpods operation 2021-08-27 16:41:57 +08:00
zhaoxiangchun
7ca332aa79 fea(monitor): monitor apiHelper add domain,project 2021-08-27 16:05:34 +08:00
zhaoxiangchun
eca062143b fix(monitor): monitor rds sync 2021-08-27 16:05:34 +08:00
Zexi Li
9b6fe19ea4 Merge pull request #12031 from zexi/automated-cherry-pick-of-#12030-upstream-release-3.8
Automated cherry pick of #12030: fix(keystone): appsrv listen multi port failed cause of race condition
2021-08-27 14:29:52 +08:00
Zexi Li
f0e61cd918 Merge pull request #12035 from ioito/automated-cherry-pick-of-#12034-upstream-release-3.8
Automated cherry pick of #12034: fix(region): sync aliyun classic network ip addr
2021-08-26 18:04:02 +08:00
Qu Xuan
a0170df031 fix(region): sync aliyun classic network ip addr 2021-08-26 17:16:09 +08:00
Zexi Li
c78f7a2f04 fix(keystone): appsrv listen multi port failed cause of race condition 2021-08-26 16:53:31 +08:00
Zexi Li
cb9b344bd4 Merge pull request #12025 from zhaoxiangchun/automated-cherry-pick-of-#12024-upstream-release-3.8
Automated cherry pick of #12024: feat(cloudmon): support HuaweiCloudStack rds metric
2021-08-26 12:34:44 +08:00
Zexi Li
b9c4336dff Merge pull request #12001 from tb365/automated-cherry-pick-of-#11999-upstream-release-3.8
Automated cherry pick of #11999: hcso support sync vm host
2021-08-26 12:23:22 +08:00
Zexi Li
e5f352fa37 Merge pull request #12028 from zexi/automated-cherry-pick-of-#12027-upstream-release-3.8
Automated cherry pick of #12027: fix(vendor): use creack/pty v1.1.11 to adapt go 1.15
2021-08-26 12:03:22 +08:00
Zexi Li
f0862574db fix(vendor): use creack/pty v1.1.11 to adapt go 1.15 2021-08-26 11:46:50 +08:00
Zexi Li
d7978069a9 Merge pull request #12007 from rainzm/automated-cherry-pick-of-#12006-upstream-release-3.8
Automated cherry pick of #12006: feat(region): add direct vpc options
2021-08-26 11:25:59 +08:00
zhaoxiangchun
1df2e03b73 feat(cloudmon): support HuaweiCloudStack rds metric 2021-08-26 11:21:15 +08:00
rainzm
9c2502db8d feat(region): add direct field for vpc
This field describes whether the VPC can be connected directly
2021-08-26 11:10:14 +08:00
Zexi Li
22f188f8c0 Merge pull request #12004 from rainzm/automated-cherry-pick-of-#12003-upstream-release-3.8
Automated cherry pick of #12003: fix(region): check instancesnapshot in correct place when resize disk
2021-08-26 10:42:38 +08:00
Zexi Li
d4656072de Merge pull request #12015 from zexi/automated-cherry-pick-of-#12014-upstream-release-3.8
Automated cherry pick of #12014: fix(cloudcommon): avoid service exit when etcd unreachable
2021-08-26 10:41:31 +08:00
Zexi Li
db34e8ad3b Merge pull request #12021 from zexi/automated-cherry-pick-of-#12020-upstream-release-3.8
Automated cherry pick of #12020: feat(cloudcommon): move ignore_nonrunning_guests option to common
2021-08-26 10:39:09 +08:00
Zexi Li
dd390aa6dd Merge pull request #12019 from ioito/automated-cherry-pick-of-#12018-upstream-release-3.8
Automated cherry pick of #12018: fix(region): cdn misc fix
2021-08-26 00:15:55 +08:00
Zexi Li
e9b0203da4 feat(cloudcommon): move ignore_nonrunning_guests option to common 2021-08-25 21:04:14 +08:00
Qu Xuan
08c5f3c816 fix(region): cdn misc fix 2021-08-25 20:44:38 +08:00
Zexi Li
5317e842f3 Merge pull request #12010 from ioito/automated-cherry-pick-of-#12009-upstream-release-3.8
Automated cherry pick of #12009: fix(region): aliyun rds network sync
2021-08-25 20:18:44 +08:00
tb365
afe7f5d828 hcso support sync vm host 2021-08-25 20:11:57 +08:00
Zexi Li
c8966f7e87 fix(cloudcommon): avoid service exit when etcd unreachable 2021-08-25 19:47:49 +08:00
Qu Xuan
f89c9b933a fix(region): aliyun rds network sync 2021-08-25 18:55:22 +08:00
Zexi Li
66c6a7570c Merge pull request #11997 from zhaoxiangchun/automated-cherry-pick-of-#11995-upstream-release-3.8
Automated cherry pick of #11995: fix(monitor):fix monitor query top 5
2021-08-25 18:19:26 +08:00
rainzm
297d905d4f fix(region): check instancesnapshot in correct place when resize disk 2021-08-25 17:12:06 +08:00
zhaoxiangchun
c24c923a8f fix(monitor):fix monitor query top 5 2021-08-25 10:15:27 +08:00
yunion-ci-robot
40909986f6 Merge pull request #11992 from zexi/automated-cherry-pick-of-#11991-upstream-release-3.8
Automated cherry pick of #11991: fix(region): try to find mediumType matched storage when create disk …
2021-08-25 08:49:05 +08:00
Zexi Li
48d6492715 Merge pull request #11984 from ioito/automated-cherry-pick-of-#11983-upstream-release-3.8
Automated cherry pick of #11983: fix(region): enable zstack allocate ip by itself
2021-08-24 22:56:27 +08:00
Zexi Li
fcc635a90e Merge pull request #11989 from ioito/automated-cherry-pick-of-#11988-upstream-release-3.8
Automated cherry pick of #11988: fix(cloudid): hcso custom role
2021-08-24 22:55:07 +08:00
Zexi Li
38582f5f93 fix(region): try to find mediumType matched storage when create disk for kvm 2021-08-24 21:36:14 +08:00
Qu Xuan
8deacfcf59 fix(cloudid): hcso custom role 2021-08-24 20:55:46 +08:00
Qu Xuan
f1d422e85f fix(region): enable zstack allocate ip by itself 2021-08-24 16:07:53 +08:00
858 changed files with 18169 additions and 6617 deletions

View File

@@ -1,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/baremetal-base:v0.3.2
FROM registry.cn-beijing.aliyuncs.com/yunionio/baremetal-base:v0.3.3
MAINTAINER "Zexi Li <lizexi@yunionyun.com>"

View File

@@ -1,6 +1,6 @@
FROM --platform=linux/amd64 registry.cn-beijing.aliyuncs.com/yunionio/centos-build:1.1-4 as build
RUN yum install -y https://iso.yunion.cn/vm-images/baremetal-pxerom-1.1.0-21080303.x86_64.rpm
#RUN yum install -y http://192.168.122.112:8083/baremetal-pxerom-1.1.0-21080303.x86_64.rpm
RUN yum install -y https://iso.yunion.cn/vm-images/baremetal-pxerom-1.1.0-21092209.x86_64.rpm
#RUN yum install -y http://192.168.23.50:8083/baremetal-pxerom-1.1.0-21092209.x86_64.rpm
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.3.5

View File

@@ -1,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/climc-base:20210817
FROM registry.cn-beijing.aliyuncs.com/yunionio/climc-base:20210901
ADD ./build/climc/root/opt /opt

View File

@@ -8,7 +8,7 @@ RUN mkdir -p /opt/yunion/bin
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >>/etc/apk/repositories
RUN apk add --no-cache bash bash-completion tzdata ca-certificates vim ipmitool kubectl && \
RUN apk add --no-cache bash bash-completion tzdata ca-certificates vim ipmitool kubectl ceph-common && \
rm -rf /var/cache/apk/*
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

View File

@@ -4,6 +4,5 @@ MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"
ENV TZ Asia/Shanghai
RUN apk add librados librbd
RUN mkdir -p /opt/yunion/bin
ADD ./_output/alpine-build/bin/host /opt/yunion/bin/host

View File

@@ -1,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:1.0
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:1.1
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"

View File

@@ -17,13 +17,13 @@ ANSIBLESERVER_BASE = v1.0.5
ansibleserver-base:
$(DOCKER_BUILDX)/ansibleserver-base:$(ANSIBLESERVER_BASE) -f ./Dockerfile.ansibleserver-base .
CLIMC_BASE_VERSION = 20210817
CLIMC_BASE_VERSION = 20210901
climc-base:
docker buildx build --platform linux/arm64,linux/amd64 --push \
-t registry.cn-beijing.aliyuncs.com/yunionio/climc-base:$(CLIMC_BASE_VERSION) -f ./Dockerfile.climc-base .
BAREMETAL_BASE_VERSION = v0.3.2
BAREMETAL_BASE_VERSION = v0.3.3
baremetal-base:
$(DOCKER_BUILDX)/baremetal-base:$(BAREMETAL_BASE_VERSION) -f ./Dockerfile.baremetal-base .

View File

@@ -13,6 +13,5 @@ MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"
ENV TZ Asia/Shanghai
RUN apk add librados librbd
RUN mkdir -p /opt/yunion/bin
COPY --from=build /root/go/src/yunion.io/x/onecloud/_output/bin/host /opt/yunion/bin/host

View File

@@ -3,7 +3,7 @@
{{- if $d.brand -}}
{{ $d.brand }}平台
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}已经{{ .action_display }}{{.result_display}}
{{ .resource_type_display }}{{ $d.name }}{{ .action_display }}{{.result_display}}
{{- if eq .result "failed" -}}
,请尽快前往控制台进行处理
{{- end -}}

View File

@@ -4,7 +4,7 @@
{{- if $d.brand -}}
{{ $d.brand }}平台
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}已经创建成功
{{ .resource_type_display }}{{ $d.name }}创建成功
{{- if $d.private_dns -}}
,内网地址为{{ $d.private_dns }}:{{ $d.private_connect_port }}
{{- end -}}
@@ -13,8 +13,8 @@
,外网地址为{{ $d.public_dns }}:{{ $d.public_connect_port }}
{{- end -}}
{{- if and $d.address_type $d.address -}}
,服务地址为{{ $d.address_type }}{{ $d.address }}
{{- if $d.address -}}
,服务地址为{{ $d.address }}
{{- end -}}
{{- if $d.ips -}}
@@ -29,8 +29,8 @@
IP地址为{{ $d.ip_addr }}
{{- end -}}
{{- if $d.account -}}
,初始帐号为{{ $d.account }}
{{- if $d.login_account -}}
,初始帐号为{{ $d.login_account }}
{{- end -}}
{{- if $d.password -}}
@@ -56,7 +56,7 @@
{{- else -}}
SSH
{{- end -}}
控制面板控制台访问虚拟机。
前往控制台访问虚拟机。
{{- end -}}
{{- if has .resource_type $consoleServiceType -}}

View File

@@ -19,4 +19,4 @@
{{- if $d.ip_addr -}}
IP地址为{{ $d.ip_addr }}
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}已经删除成功
{{ .resource_type_display }}{{ $d.name }}删除成功

View File

@@ -3,4 +3,12 @@
{{- if $d.brand -}}
{{ $d.brand }}平台
{{- end -}}
{{- if $d.private_dns -}}
,内网地址为{{ $d.private_dns }}:{{ $d.private_connect_port }}
{{- end -}}
{{- if $d.public_dns -}}
,外网地址为{{ $d.public_dns }}:{{ $d.public_connect_port }}的
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}还有{{ .advance_days }}天就要到期释放,如需续期使用,请尽快前往控制台处理

View File

@@ -0,0 +1,14 @@
{{- $d := .resource_details -}}
您在{{ $d.project }}项目的
{{- if $d.ips -}}
IP地址为{{ $d.ips }}的
{{- end -}}
{{- if $d.ip_addr -}}
IP地址为{{ $d.ip_addr }}的
{{- end -}}
{{- if $d.brand -}}
{{ $d.brand }}平台
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}成功加入回收站

View File

@@ -3,7 +3,7 @@
{{- if $d.brand -}}
{{ $d.brand }}平台
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}已经{{ .action_display }}成功
{{ .resource_type_display }}{{ $d.name }}{{ .action_display }}成功
{{- if $d.account -}}
,帐号为{{ $d.account }}
{{- end -}}

View File

@@ -9,8 +9,8 @@ Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type_display }} {
, the internet address is {{ $d.public_dns }}:{{ $d.public_connect_port }}
{{- end -}}
{{- if and $d.address_type $d.address -}}
, the service address is {{ $d.address_type }}{{ $d.address }}
{{- if $d.address -}}
, the service address is {{ $d.address }}
{{- end -}}
{{- if $d.ips -}}
@@ -46,7 +46,7 @@ Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type_display }} {
{{- end -}}
{{- if eq .resource_type "server" -}}
, and please use {{ if $d.windows -}} Remote Desktop Connector (RDC) {{ else -}} SSH {{ end -}} or the control panel console to access the VM.
, and please use {{ if $d.windows -}} Remote Desktop Connector (RDC) {{ else -}} SSH {{ end -}} or go to the console to access the VM.
{{- end -}}
{{- if has .resource_type $consoleServiceType -}}

View File

@@ -6,7 +6,7 @@ Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type_display }} {
{{- end -}}
{{- if $d.public_dns -}}
, the internet address is {{ $d.public_dns }}:{{ $d.public_connect_port }}
, the external address is {{ $d.public_dns }}:{{ $d.public_connect_port }}
{{- end -}}
{{- if and $d.address_type $d.address -}}

View File

@@ -1,2 +1,2 @@
{{- $d := .resource_details -}}
Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} will expire and be released in {{ .advance_days }} days. If you need to renew, please go to the console as soon as possible
Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type }} {{ $d.name }} {{ if $d.public_dns -}} with external address {{ $d.public_dns }}:{{ $d.public_connect_port }} {{ end -}} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} will expire and be released in {{ .advance_days }} days. If you need to renew, please go to the console as soon as possible

View File

@@ -0,0 +1,22 @@
{{- $d := .resource_details -}}
Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type_display }} {{ $d.name }}
{{ if $d.project -}} in project {{ $d.project }} {{ end -}} has been added to recycle bin successfully
{{- if $d.private_dns -}}
, the intranet address is {{ $d.private_dns }}:{{ $d.private_connect_port }}
{{- end -}}
{{- if $d.public_dns -}}
, the external address is {{ $d.public_dns }}:{{ $d.public_connect_port }}
{{- end -}}
{{- if and $d.address_type $d.address -}}
, the service address is {{ $d.address_type }}{{ $d.address }}
{{- end -}}
{{- if $d.ips -}}
, the IP address is {{ $d.ips }}
{{- end -}}
{{- if $d.ip_addr -}}
, the IP address is {{ $d.ip_addr }}
{{- end -}}

View File

@@ -0,0 +1,5 @@
{{- $d := .resource_details -}}
{{- if $d.project -}}
{{ $d.project }}项目的
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}成功加入回收站

View File

@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
The {{ .resource_type_display }} {{ .Name }} {{ if $d.project }} in poject {{ $d.project }} {{ end -}} has been added to recycle bin successfully

View File

@@ -28,4 +28,5 @@ func init() {
cmd.List(&options.ProxyAgentListOptions{})
cmd.Show(&options.ProxyAgentShowOptions{})
cmd.Delete(&options.ProxyAgentDeleteOptions{})
cmd.Perform("purge-forwards", &options.ProxyAgentPurgeForwardsOptions{})
}

View File

@@ -37,7 +37,7 @@ func init() {
cmd.CreateWithKeyword("create-aws", &options.SAWSCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-openstack", &options.SOpenStackCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-huawei", &options.SHuaweiCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-huaweicloudstack", &options.SHuaweiCloudStackAccountCreateOptions{})
cmd.CreateWithKeyword("create-hcso", &options.SHCSOAccountCreateOptions{})
cmd.CreateWithKeyword("create-ucloud", &options.SUcloudCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-zstack", &options.SZStackCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-s3", &options.SS3CloudAccountCreateOptions{})
@@ -57,7 +57,7 @@ func init() {
cmd.UpdateWithKeyword("update-aws", &options.SAWSCloudAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-openstack", &options.SOpenStackCloudAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-huawei", &options.SHuaweiCloudAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-huaweicloudstack", &options.SHuaweiCloudStackAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-hcso", &options.SHCSOAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-ucloud", &options.SUcloudCloudAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-zstack", &options.SZStackCloudAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-s3", &options.SS3CloudAccountUpdateOptions{})
@@ -75,7 +75,7 @@ func init() {
cmd.PerformWithKeyword("update-credential-aws", "update-credential", &options.SAWSCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-openstack", "update-credential", &options.SOpenStackCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-huawei", "update-credential", &options.SHuaweiCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-huaweicloudstack", "update-credential", &options.SHuaweiCloudStackAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-hcso", "update-credential", &options.SHCSOAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-ucloud", "update-credential", &options.SUcloudCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-zstack", "update-credential", &options.SZStackCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-s3", "update-credential", &options.SS3CloudAccountUpdateCredentialOptions{})

View File

@@ -15,10 +15,12 @@
package compute
import (
"context"
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
@@ -26,6 +28,7 @@ import (
"yunion.io/x/onecloud/pkg/mcclient/options"
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
"yunion.io/x/onecloud/pkg/util/fileutils2"
"yunion.io/x/onecloud/pkg/util/httputils"
"yunion.io/x/onecloud/pkg/util/ssh"
)
@@ -43,7 +46,7 @@ func init() {
cmd.Perform("start", &options.BaseIdOptions{})
cmd.Perform("stop", &options.BaseIdOptions{})
cmd.Perform("reset", &options.BaseIdOptions{})
cmd.Perform("delete", &options.BaseIdOptions{})
cmd.BatchDelete(&options.BaseIdsOptions{})
cmd.Perform("remove-all-netifs", &options.BaseIdOptions{})
cmd.BatchPerform("enable", &options.BaseIdsOptions{})
@@ -523,9 +526,36 @@ func init() {
return e
}
i, e := modules.Hosts.GetLoginInfo(s, srvid, nil)
privateKey := ""
if e != nil {
return e
if httputils.ErrorCode(e) == 404 || e.Error() == "ciphertext too short" {
var err error
privateKey, err = modules.Sshkeypairs.FetchPrivateKeyBySession(context.Background(), s)
if err != nil {
return errors.Wrap(err, "fetch private key")
}
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(string(args.ID)), "ID")
ret, err := modules.Hosts.Get(s, args.ID, params)
if err != nil {
return errors.Wrap(err, "get host by ID")
}
ip, err := ret.GetString("access_ip")
if err != nil {
return errors.Wrap(err, "get the ip of the host")
}
jsonItem := jsonutils.NewDict()
jsonItem.Add(jsonutils.NewString(ip), "ip")
jsonItem.Add(jsonutils.NewString("root"), "username")
jsonItem.Add(jsonutils.NewString(""), "password")
jsonItem.Add(jsonutils.NewInt(22), "port")
i = jsonItem
} else {
return e
}
}
host, err := i.GetString("ip")
if err != nil {
return err
@@ -542,7 +572,7 @@ func init() {
if args.Port != 22 {
port = args.Port
}
sshCli, err := ssh.NewClient(host, port, user, passwd, "")
sshCli, err := ssh.NewClient(host, port, user, passwd, privateKey)
if err != nil {
return err
}

View File

@@ -15,6 +15,7 @@
package compute
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
@@ -88,6 +89,9 @@ func init() {
cmd.Perform("create-eip", &options.ServerCreateEipOptions{})
cmd.Perform("make-sshable", &options.ServerMakeSshableOptions{})
cmd.Perform("migrate-network", &options.ServerMigrateNetworkOptions{})
cmd.Perform("set-sshport", &options.ServerSetSshportOptions{})
cmd.Perform("have-agent", &options.ServerHaveAgentOptions{})
cmd.Perform("change-disk-storage", &options.ServerChangeDiskStorageOptions{})
cmd.Get("vnc", new(options.ServerIdOptions))
cmd.Get("desc", new(options.ServerIdOptions))
@@ -99,6 +103,8 @@ func init() {
cmd.Get("change-owner-candidate-domains", new(options.ServerChangeOwnerCandidateDomainsOptions))
cmd.Get("change-owner-candidate-domains", new(options.ServerChangeOwnerCandidateDomainsOptions))
cmd.GetProperty(&options.ServerStatusStatisticsOptions{})
cmd.GetProperty(&options.ServerProjectStatisticsOptions{})
cmd.GetProperty(&options.ServerDomainStatisticsOptions{})
type ServerTaskShowOptions struct {
ID string `help:"ID or name of server" json:"-"`
@@ -817,13 +823,15 @@ func init() {
return fmt.Errorf("Not found ip address from server %s", opts.ID)
}
privateKey := ""
params := jsonutils.NewDict()
if len(opts.Key) > 0 {
privateKey, e := ioutil.ReadFile(opts.Key)
key, e := ioutil.ReadFile(opts.Key)
if e != nil {
return e
}
params.Add(jsonutils.NewString(string(privateKey)), "private_key")
params.Add(jsonutils.NewString(string(key)), "private_key")
privateKey = string(key)
}
i, e := modules.Servers.GetLoginInfo(s, srvid, params)
@@ -831,14 +839,14 @@ func init() {
return e
}
passwd, err := i.GetString("password")
if err != nil {
if err != nil && !opts.UseCloudroot {
return err
}
if opts.Password != "" {
passwd = opts.Password
}
user, err := i.GetString("username")
if err != nil {
if err != nil && !opts.UseCloudroot {
return err
}
if opts.User != "" {
@@ -868,8 +876,22 @@ func init() {
}
}
if opts.UseCloudroot {
var err error
privateKey, err = modules.Sshkeypairs.FetchPrivateKeyBySession(context.Background(), s)
if err != nil {
return err
}
passwd = ""
user = "cloudroot"
}
var sshCli *ssh.Client
for sshCli, err = ssh.NewClient(host, port, user, passwd, ""); err != nil; {
err = nil
for ; sshCli == nil; sshCli, err = ssh.NewClient(host, port, user, passwd, privateKey) {
if err == nil {
continue
}
if opts.Host != "" {
return err
}
@@ -877,12 +899,14 @@ func init() {
closeForward(s, srvid, forwardItem)
return err
} else {
forwardItem, err = openForward(s, srvid)
if err != nil {
return err
if vpcid != "default" {
forwardItem, e = openForward(s, srvid)
if e != nil {
return e
}
host = forwardItem.ProxyAddr
port = forwardItem.ProxyPort
}
host = forwardItem.ProxyAddr
port = forwardItem.ProxyPort
}
}

View File

@@ -0,0 +1,29 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package devtool
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
options "yunion.io/x/onecloud/pkg/mcclient/options/devtool"
)
func init() {
cmd := shell.NewResourceCmd(&modules.DevToolServiceUrls).WithKeyword("devtool-serviceurl")
cmd.List(new(options.ServiceUrlListOptions))
cmd.Create(new(options.ServiceUrlCreateOptions))
cmd.Show(new(options.ServiceUrlOptions))
cmd.Delete(new(options.ServiceUrlOptions))
}

View File

@@ -0,0 +1,29 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package devtool
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
options "yunion.io/x/onecloud/pkg/mcclient/options/devtool"
)
func init() {
cmd := shell.NewResourceCmd(&modules.DevToolSshInfos).WithKeyword("devtool-sshinfo")
cmd.List(new(options.SshInfoListOptions))
cmd.Create(new(options.SshInfoCreateOptions))
cmd.Show(new(options.SshInfoOptions))
cmd.Delete(new(options.SshInfoOptions))
}

View File

@@ -44,13 +44,14 @@ type BaseEventListOptions struct {
type EventListOptions struct {
BaseEventListOptions
Id string `help:"" metavar:"OBJ_ID"`
Id []string `help:"object IDs" metavar:"OBJ_ID"`
Name []string `help:"object names" metavar:"OBJ_NAME"`
Type []string `help:"Type of relevant object" metavar:"OBJ_TYPE"`
}
type TypeEventListOptions struct {
BaseEventListOptions
ID string `help:"" metavar:"OBJ_ID"`
ID []string `help:"object IDs" metavar:"OBJ_ID"`
}
func doComputeEventList(s *mcclient.ClientSession, args *EventListOptions) error {
@@ -71,7 +72,10 @@ func DoEventList(man modulebase.ResourceManager, s *mcclient.ClientSession, args
params.Add(jsonutils.NewStringArray(args.Type), "obj_type")
}
if len(args.Id) > 0 {
params.Add(jsonutils.NewString(args.Id), "obj_id")
params.Add(jsonutils.NewStringArray(args.Id), "obj_id")
}
if len(args.Name) > 0 {
params.Add(jsonutils.NewStringArray(args.Name), "obj_name")
}
if len(args.Since) > 0 {
params.Add(jsonutils.NewString(args.Since), "since")

View File

@@ -16,7 +16,6 @@ package shell
import (
"fmt"
"time"
"yunion.io/x/pkg/util/timeutils"
@@ -110,7 +109,7 @@ func init() {
}
fmt.Println("primary key hash:", fm.PrimaryKeyHash())
ret := fm.Decrypt([]byte(args.MSG), time.Hour*-1)
ret := fm.Decrypt([]byte(args.MSG))
if len(ret) == 0 {
return fmt.Errorf("invalid message")
}

View File

@@ -21,13 +21,13 @@ import (
"yunion.io/x/structarg"
"yunion.io/x/onecloud/pkg/cloudprovider"
huawei "yunion.io/x/onecloud/pkg/multicloud/huaweistack"
_ "yunion.io/x/onecloud/pkg/multicloud/huaweistack/shell"
huawei "yunion.io/x/onecloud/pkg/multicloud/hcso"
_ "yunion.io/x/onecloud/pkg/multicloud/hcso/shell"
"yunion.io/x/onecloud/pkg/util/shellutils"
)
type BaseOptions struct {
cloudprovider.SHuaweiCloudStackEndpoints
cloudprovider.SHCSOEndpoints
Help bool `help:"Show help" default:"false"`
Debug bool `help:"Show debug" default:"false"`
AccessKey string `help:"Access key" default:"$HUAWEI_ACCESS_KEY" metavar:"HUAWEI_ACCESS_KEY"`
@@ -92,7 +92,7 @@ func newClient(options *BaseOptions) (*huawei.SRegion, error) {
options.AccessKey,
options.Secret,
options.ProjectId,
&options.SHuaweiCloudStackEndpoints,
&options.SHCSOEndpoints,
).Debug(options.Debug),
)
if err != nil {

6
go.mod
View File

@@ -40,6 +40,7 @@ require (
github.com/coredns/coredns v1.3.0
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/creack/pty v1.1.11
github.com/dnaeon/go-vcr v1.1.0 // indirect
github.com/dnstap/golang-dnstap v0.0.0-20170829151710-2cf77a2b5e11 // indirect
github.com/eapache/go-resiliency v1.1.0 // indirect
@@ -78,7 +79,6 @@ require (
github.com/jdcloud-api/jdcloud-sdk-go v1.55.0
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c
github.com/kr/pty v1.1.5
github.com/lestrrat-go/jwx v1.0.2
github.com/lestrrat/go-jwx v0.0.0-20180221005942-b7d4802280ae
github.com/lestrrat/go-pdebug v0.0.0-20180220043741-569c97477ae8 // indirect
@@ -153,9 +153,9 @@ require (
yunion.io/x/jsonutils v0.0.0-20210709075951-798a67800349
yunion.io/x/log v0.0.0-20201210064738-43181789dc74
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7
yunion.io/x/pkg v0.0.0-20210721081124-55078288ca4c
yunion.io/x/pkg v0.0.0-20210918114143-ce839f862c5f
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v0.0.0-20210619142628-653684d2c4f8
yunion.io/x/sqlchemy v0.0.0-20210918113031-c1c107f37ada
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce
)

32
go.sum
View File

@@ -172,6 +172,8 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -224,8 +226,6 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.5.0 h1:fi+bqFAx/oLK54somfCtEZs9HeH1LHVoEPUgARpTqyc=
github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do=
github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU=
github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY=
github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
@@ -250,13 +250,10 @@ github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc=
github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rmGrCjJ8eAeUP/K/EKx4DM=
github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
@@ -342,8 +339,6 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR
github.com/gorilla/mux v1.7.0 h1:tOSd0UKHQd6urX6ApfOn4XdBMY6Sh1MfxV3kmaazO+U=
github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gosuri/uilive v0.0.0-20170323041506-ac356e6e42cd/go.mod h1:qkLSc0A5EXSP6B04TrN4oQoxqFI7A8XvoXSlJi8cwk8=
@@ -411,12 +406,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/leodido/go-urn v1.1.0 h1:Sm1gr51B1kKyfD2BlRcLSiEkffoG96g6TPv6eRoEiB8=
github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/lestrrat-go/iter v0.0.0-20200422075355-fc1769541911 h1:FvnrqecqX4zT0wOIbYK1gNgTm0677INEWiFY8UEYggY=
@@ -440,8 +431,6 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
@@ -471,8 +460,6 @@ github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1f
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/mholt/caddy v0.10.11 h1:s8X+R8DuBbrrMuUTcWSxlDe567B0s5EDmiDBKSYsioY=
github.com/mholt/caddy v0.10.11/go.mod h1:Wb1PlT4DAYSqOEd03MsqkdkXnTxA8v9pKjdpxbqM1kY=
github.com/miekg/dns v1.1.4 h1:rCMZsU2ScVSYcAsOXgmC6+AKOK+6pmQTOcw03nfwYV0=
github.com/miekg/dns v1.1.4/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.25 h1:dFwPR6SfLtrSwgDcIq2bcU/gVutB4sNApq2HBdqcakg=
github.com/miekg/dns v1.1.25/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc=
@@ -755,7 +742,6 @@ golang.org/x/sys v0.0.0-20190606122018-79a91cf218c4/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190830023255-19e00faab6ad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -878,10 +864,6 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fatih/set.v0 v0.2.1 h1:Xvyyp7LXu34P0ROhCyfXkmQCAoOUKb1E2JS9I7SE5CY=
gopkg.in/fatih/set.v0 v0.2.1/go.mod h1:5eLWEndGL4zGGemXWrKuts+wTJR0y+w+auqUJZbmyBg=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc=
gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
@@ -941,11 +923,11 @@ yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7/go.mod h1:0vLkNEhlmA64HViPB
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20210721081124-55078288ca4c h1:/ejlt78/0xod4bdkEThUuYsQ7vLajd48wpL2GMMSaXs=
yunion.io/x/pkg v0.0.0-20210721081124-55078288ca4c/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20210918114143-ce839f862c5f h1:maply0f3AsvoXqkpTKkb6/tZFbRAT/rdkk1Cw3FkoB8=
yunion.io/x/pkg v0.0.0-20210918114143-ce839f862c5f/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
yunion.io/x/sqlchemy v0.0.0-20210619142628-653684d2c4f8 h1:+kywPlOttXAZvbxsVqR73B5GbSVgG3Xdo4socLWRkcg=
yunion.io/x/sqlchemy v0.0.0-20210619142628-653684d2c4f8/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/sqlchemy v0.0.0-20210918113031-c1c107f37ada h1:ZIhSSwFHfnzPMKSyiN0nkGwvC6RUeuCIAnWuTtDS900=
yunion.io/x/sqlchemy v0.0.0-20210918113031-c1c107f37ada/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce h1:kU8xE7O5uZ1GSJVMZHoJ+jrNL7csUQHYGyAPW9QfNpE=
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=

View File

@@ -121,7 +121,7 @@ func (man *SAnsiblePlaybookManager) InitializeData() error {
return nil
}
func (apb *SAnsiblePlaybook) ValidateDeleteCondition(ctx context.Context) error {
func (apb *SAnsiblePlaybook) ValidateDeleteCondition(ctx context.Context, info jsonutils.JSONObject) error {
if apb.Status == api.AnsiblePlaybookStatusRunning {
return httperrors.NewConflictError("playbook is in running state")
}

View File

@@ -118,7 +118,7 @@ func (man *SAnsiblePlaybookV2Manager) InitializeData() error {
return nil
}
func (apb *SAnsiblePlaybookV2) ValidateDeleteCondition(ctx context.Context) error {
func (apb *SAnsiblePlaybookV2) ValidateDeleteCondition(ctx context.Context, info jsonutils.JSONObject) error {
if apb.Status == api.AnsiblePlaybookStatusRunning {
return httperrors.NewConflictError("playbook is in running state")
}

View File

@@ -185,7 +185,22 @@ func (h *AuthHandlers) GetRegionsResponse(ctx context.Context, w http.ResponseWr
resp.Add(jsonutils.NewArray(retIdps...), "idps")
resp.Add(jsonutils.NewString(options.Options.ApiServer), "api_server")
// in case api_server changed but not synchronized from Keystone
// fetch this option directly from Keystone
var apiSrv string
commonCfg, err := modules.ServicesV3.GetSpecific(s, "common", "config", nil)
if err != nil {
log.Errorf("fetch common config error: %s", err)
} else {
apiSrv, err = commonCfg.GetString("config", "default", "api_server")
if err != nil {
log.Errorf("fetch api_server fail: %s (cfg: %s)", err, commonCfg)
}
}
if len(apiSrv) == 0 {
apiSrv = options.Options.ApiServer
}
resp.Add(jsonutils.NewString(apiSrv), "api_server")
return resp, nil
}

View File

@@ -346,8 +346,9 @@ func (mh *MiscHandler) DoBatchUserRegister(ctx context.Context, w http.ResponseW
rowIdx := i + 2
name := row[0]
password := row[1]
domain := row[2]
allowWebConsole := strings.ToLower(row[3])
displayname := row[2]
domain := row[3]
allowWebConsole := strings.ToLower(row[4])
// 忽略空白行
rowStr := strings.Join(row, "")
@@ -361,6 +362,10 @@ func (mh *MiscHandler) DoBatchUserRegister(ctx context.Context, w http.ResponseW
return
}
if len(displayname) == 0 {
displayname = name
}
if len(password) == 0 {
e := httperrors.NewClientError("row %d password is empty", rowIdx)
httperrors.JsonClientError(ctx, w, e)
@@ -401,6 +406,7 @@ func (mh *MiscHandler) DoBatchUserRegister(ctx context.Context, w http.ResponseW
user := jsonutils.NewDict()
user.Add(jsonutils.NewString(name), "name")
user.Add(jsonutils.NewString(displayname), "displayname")
user.Add(jsonutils.NewString(domainId), "domain_id")
if len(password) > 0 {
user.Add(jsonutils.NewString(password), "password")
@@ -468,7 +474,7 @@ func (mh *MiscHandler) getDownloadsHandler(ctx context.Context, w http.ResponseW
return
}
case "BatchUserRegister":
records := [][]string{{"*用户名user", "*用户密码password", "*部门/域domain", "*是否登录控制台allow_web_consoletrue、false"}}
records := [][]string{{"*用户名user", "*用户密码password", "*显示名displayname", "*部门/域domain", "*是否登录控制台allow_web_consoletrue、false"}}
content, err = writeXlsx("users", records)
if err != nil {
httperrors.InternalServerError(ctx, w, "internal server error")

View File

@@ -26,7 +26,7 @@ type GatewayOptions struct {
DisableModuleApiVersion bool `help:"Disable each modules default api version" default:"false"`
EnableTotp bool `help:"Enable two-factor authentication" default:"true"`
EnableTotp bool `help:"Enable two-factor authentication" default:"false"`
SsoRedirectUrl string `help:"SSO idp redirect URL"`
SsoAuthCallbackUrl string `help:"SSO idp auth callback URL"`

View File

@@ -15,6 +15,8 @@
package apihelper
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/cloudcommon/db"
mcclient "yunion.io/x/onecloud/pkg/mcclient"
mcclient_modulebase "yunion.io/x/onecloud/pkg/mcclient/modulebase"
@@ -44,6 +46,14 @@ type IModelSetEmulatedIncluder interface {
IncludeEmulated() bool
}
type IModelSetFilter interface {
ModelFilter() []string
}
type IModelListParam interface {
ModelParamFilter() jsonutils.JSONObject
}
func SyncModelSets(mssOld IModelSets, s *mcclient.ClientSession, opt *Options) (r ModelSetsUpdateResult, err error) {
mss := mssOld.ModelSetList()
mssNews := mssOld.NewEmpty()

View File

@@ -120,6 +120,10 @@ func GetModels(opts *GetModelsOptions) error {
"cloud_env=onpremise",
)
}
if inter, ok := opts.ModelSet.(IModelSetFilter); ok {
filter := inter.ModelFilter()
listOptions.Filter = append(listOptions.Filter, filter...)
}
if !minUpdatedAt.Equal(PseudoZeroTime) {
// Only fetching pending deletes when we are doing incremental fetch
listOptions.PendingDeleteAll = options.Bool(true)
@@ -129,6 +133,10 @@ func GetModels(opts *GetModelsOptions) error {
if err != nil {
return fmt.Errorf("%s: making list params: %s", manKeyPlural, err)
}
if inter, ok := opts.ModelSet.(IModelListParam); ok {
filter := inter.ModelParamFilter()
params.Update(filter)
}
//XXX
//params.Set(api.LBAGENT_QUERY_ORIG_KEY, jsonutils.NewString(api.LBAGENT_QUERY_ORIG_VAL))

View File

@@ -30,7 +30,8 @@ type ProxyEndpointCreateInput struct {
}
type ProxyEndpointCreateFromServerInput struct {
Name string
Name string
GenerateName string
ServerId string
}

View File

@@ -396,6 +396,10 @@ type ServerCreateInput struct {
// emulate: BIOS, UEFI
Bios string `json:"bios"`
// Machine类型
// emulate: pc, q35
Machine string `json:"machine"`
// 启动顺序
// c: cdrome
// d: disk
@@ -543,19 +547,6 @@ type ServerCloneInput struct {
PreferHostId string `json:"prefer_host_id"`
}
type ServerDeployInput struct {
apis.Meta
Id string
Keypair string `json:"keypair"`
DeleteKeypair *bool `json:"__delete_keypair__"`
DeployConfigs []*DeployConfig `json:"deploy_configs"`
ResetPassword *bool `json:"reset_password"`
Password string `json:"password"`
AutoStart *bool `json:"auto_start"`
}
type GuestBatchMigrateRequest struct {
apis.Meta

View File

@@ -29,12 +29,13 @@ const (
DEFAULT_DISK_TYPE = DISK_TYPE_ROTATE
DISK_DRIVER_MEGARAID = "MegaRaid"
DISK_DRIVER_LINUX = "Linux"
DISK_DRIVER_HPSARAID = "HPSARaid"
DISK_DRIVER_MPT2SAS = "Mpt2SAS"
DISK_DRIVER_MARVELRAID = "MarvelRaid"
DISK_DRIVER_PCIE = "PCIE"
DISK_DRIVER_MEGARAID = "MegaRaid"
DISK_DRIVER_LINUX = "Linux"
DISK_DRIVER_HPSARAID = "HPSARaid"
DISK_DRIVER_MPT2SAS = "Mpt2SAS"
DISK_DRIVER_MARVELRAID = "MarvelRaid"
DISK_DRIVER_ADAPTECRAID = "AdaptecRaid"
DISK_DRIVER_PCIE = "PCIE"
HDD_DISK_SPEC_TYPE = "HDD"
SSD_DISK_SPEC_TYPE = "SSD"
@@ -60,6 +61,7 @@ var (
DISK_DRIVER_HPSARAID,
DISK_DRIVER_MPT2SAS,
DISK_DRIVER_MARVELRAID,
DISK_DRIVER_ADAPTECRAID,
)
DISK_DRIVERS = sets.NewString(

22
pkg/apis/compute/cdrom.go Normal file
View File

@@ -0,0 +1,22 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
type GuestcdromJsonDesc struct {
ImageId string `json:"image_id"`
Path string `json:"path"`
Name string `json:"name"`
Size int64 `json:"size"`
}

View File

@@ -36,23 +36,23 @@ const (
CLOUD_PROVIDER_SYNC_STATUS_IDLE = "idle"
CLOUD_PROVIDER_SYNC_STATUS_ERROR = "error"
CLOUD_PROVIDER_ONECLOUD = "OneCloud"
CLOUD_PROVIDER_VMWARE = "VMware"
CLOUD_PROVIDER_ALIYUN = "Aliyun"
CLOUD_PROVIDER_APSARA = "Apsara"
CLOUD_PROVIDER_QCLOUD = "Qcloud"
CLOUD_PROVIDER_AZURE = "Azure"
CLOUD_PROVIDER_AWS = "Aws"
CLOUD_PROVIDER_HUAWEI = "Huawei"
CLOUD_PROVIDER_HUAWEI_CLOUD_STACK = "HuaweiCloudStack"
CLOUD_PROVIDER_OPENSTACK = "OpenStack"
CLOUD_PROVIDER_UCLOUD = "Ucloud"
CLOUD_PROVIDER_ZSTACK = "ZStack"
CLOUD_PROVIDER_GOOGLE = "Google"
CLOUD_PROVIDER_CTYUN = "Ctyun"
CLOUD_PROVIDER_ECLOUD = "Ecloud"
CLOUD_PROVIDER_JDCLOUD = "JDcloud"
CLOUD_PROVIDER_CLOUDPODS = "Cloudpods"
CLOUD_PROVIDER_ONECLOUD = "OneCloud"
CLOUD_PROVIDER_VMWARE = "VMware"
CLOUD_PROVIDER_ALIYUN = "Aliyun"
CLOUD_PROVIDER_APSARA = "Apsara"
CLOUD_PROVIDER_QCLOUD = "Qcloud"
CLOUD_PROVIDER_AZURE = "Azure"
CLOUD_PROVIDER_AWS = "Aws"
CLOUD_PROVIDER_HUAWEI = "Huawei"
CLOUD_PROVIDER_HCSO = "HCSO"
CLOUD_PROVIDER_OPENSTACK = "OpenStack"
CLOUD_PROVIDER_UCLOUD = "Ucloud"
CLOUD_PROVIDER_ZSTACK = "ZStack"
CLOUD_PROVIDER_GOOGLE = "Google"
CLOUD_PROVIDER_CTYUN = "Ctyun"
CLOUD_PROVIDER_ECLOUD = "Ecloud"
CLOUD_PROVIDER_JDCLOUD = "JDcloud"
CLOUD_PROVIDER_CLOUDPODS = "Cloudpods"
CLOUD_PROVIDER_GENERICS3 = "S3"
CLOUD_PROVIDER_CEPH = "Ceph"
@@ -98,7 +98,7 @@ const (
var (
CLOUD_PROVIDER_VALID_STATUS = []string{CLOUD_PROVIDER_CONNECTED}
CLOUD_PROVIDER_VALID_HEALTH_STATUS = []string{CLOUD_PROVIDER_HEALTH_NORMAL, CLOUD_PROVIDER_HEALTH_NO_PERMISSION}
PRIVATE_CLOUD_PROVIDERS = []string{CLOUD_PROVIDER_ZSTACK, CLOUD_PROVIDER_OPENSTACK, CLOUD_PROVIDER_APSARA, CLOUD_PROVIDER_HUAWEI_CLOUD_STACK}
PRIVATE_CLOUD_PROVIDERS = []string{CLOUD_PROVIDER_ZSTACK, CLOUD_PROVIDER_OPENSTACK, CLOUD_PROVIDER_APSARA, CLOUD_PROVIDER_HCSO}
CLOUD_PROVIDERS = []string{
CLOUD_PROVIDER_ONECLOUD,
@@ -109,7 +109,7 @@ var (
CLOUD_PROVIDER_AZURE,
CLOUD_PROVIDER_AWS,
CLOUD_PROVIDER_HUAWEI,
CLOUD_PROVIDER_HUAWEI_CLOUD_STACK,
CLOUD_PROVIDER_HCSO,
CLOUD_PROVIDER_OPENSTACK,
CLOUD_PROVIDER_UCLOUD,
CLOUD_PROVIDER_ZSTACK,
@@ -147,8 +147,8 @@ var (
CLOUD_PROVIDER_HUAWEI: []string{
HOST_TYPE_HUAWEI,
},
CLOUD_PROVIDER_HUAWEI_CLOUD_STACK: {
HOST_TYPE_HUAWEI_CLOUD_STACK,
CLOUD_PROVIDER_HCSO: {
HOST_TYPE_HCSO,
},
CLOUD_PROVIDER_OPENSTACK: []string{
HOST_TYPE_OPENSTACK,

View File

@@ -39,6 +39,9 @@ type CloudproviderregionDetails struct {
// example: 300
SyncIntervalSeconds int `json:"sync_interval_seconds"`
// 云订阅同步状态
CloudproviderSyncStatus string `json:"cloudprovider_sync_status"`
// 支持服务列表
Capabilities []string `json:"capabilities"`
}

View File

@@ -67,6 +67,7 @@ const (
CITY_XIA_MEN = "XiaMen" //厦门
CITY_HUAI_NAN = "HuaiNan" //淮南
CITY_SU_QIAN = "SuQian" //宿迁
CITY_DA_LIAN = "Dalian" //大连
// 日本
CITY_TOKYO = "Tokyo" //东京
@@ -101,6 +102,7 @@ const (
CITY_JAKARTA = "Jakarta" //雅加达
// 印度
CITY_DELHI = "Delhi" // 德里
CITY_MUMBAI = "Mumbai" //孟买
CITY_KANCHIPURAM = "Kanchipuram" //甘吉布勒姆
CITY_MAHARASHTRA = "Maharashtra" //马哈拉施特拉邦
@@ -159,6 +161,9 @@ const (
// 瑞典
CITY_STOCKHOLM = "Stockholm" //斯德哥尔摩
// 波兰
CITY_WARSAW = "Warsaw" // 华沙
// 巴西
CITY_SAO_PAULO = "Sao Paulo" //圣保罗
CITY_RIO_DE_JANEIRO = "Rio de Janeiro" // 里约热内卢
@@ -220,4 +225,7 @@ const (
COUNTRY_CODE_MX = "MX" //墨西哥
COUNTRY_CODE_CL = "CL" //智利
COUNTRY_CODE_BH = "BH" //巴林
COUNTRY_CODE_PL = "PL" //波兰
COUNTRY_CODE_FI = "FI" //芬兰
COUNTRY_CODE_BE = "BE" //比利时
)

View File

@@ -22,6 +22,7 @@ import (
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/apis/billing"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/multicloud/esxi/vcenter"
)
type DiskCreateInput struct {
@@ -265,3 +266,24 @@ func (self DiskResizeInput) SizeMb() (int, error) {
}
return fileutils.GetSizeMb(self.Size, 'M', 1024)
}
type DiskAllocateInput struct {
Format string
DiskSizeMb int
ImageId string
FsFormat string
Encryption bool
Rebuild bool
BackingDiskId string
SnapshotId string
SnapshotUrl string
SnapshotOutOfChain bool
Protocol string
SrcDiskId string
SrcPool string
// vmware
HostIp string
Datastore vcenter.SVCenterAccessInfo
}

View File

@@ -43,6 +43,9 @@ const (
DISK_POST_MIGRATE = "post_migrate"
DISK_MIGRATING = "migrating"
DISK_CLONE = "clone"
DISK_CLONE_FAIL = "clone_failed"
DISK_START_SNAPSHOT = "start_snapshot"
DISK_SNAPSHOTING = "snapshoting"
DISK_APPLY_SNAPSHOT_FAIL = "apply_snapshot_failed"

View File

@@ -125,7 +125,7 @@ type DnsZoneDetails struct {
// 关联vpc数量
VpcCount int `json:"vpc_count"`
// Cache info
CloudCaches []DnsZoneCacheDetails `json:"cloud_caches"`
CloudCaches []jsonutils.JSONObject `json:"cloud_caches"`
}
type DnsZoneListInput struct {
@@ -141,7 +141,8 @@ type DnsZoneListInput struct {
ZoneType string `json:"zone_type"`
// Filter dns zone By vpc
VpcId string `json:"vpc_id"`
VpcId string `json:"vpc_id"`
WithCache bool `json:"with_cache"`
}
type DnsZoneSyncStatusInput struct {

View File

@@ -77,15 +77,17 @@ const (
VM_REBUILD_ROOT = "rebuild_root"
VM_REBUILD_ROOT_FAIL = "rebuild_root_fail"
VM_START_SNAPSHOT = "snapshot_start"
VM_SNAPSHOT = "snapshot"
VM_SNAPSHOT_DELETE = "snapshot_delete"
VM_BLOCK_STREAM = "block_stream"
VM_BLOCK_STREAM_FAIL = "block_stream_fail"
VM_SNAPSHOT_SUCC = "snapshot_succ"
VM_SNAPSHOT_FAILED = "snapshot_failed"
VM_DISK_RESET = "disk_reset"
VM_DISK_RESET_FAIL = "disk_reset_failed"
VM_START_SNAPSHOT = "snapshot_start"
VM_SNAPSHOT = "snapshot"
VM_SNAPSHOT_DELETE = "snapshot_delete"
VM_BLOCK_STREAM = "block_stream"
VM_BLOCK_STREAM_FAIL = "block_stream_fail"
VM_SNAPSHOT_SUCC = "snapshot_succ"
VM_SNAPSHOT_FAILED = "snapshot_failed"
VM_DISK_RESET = "disk_reset"
VM_DISK_RESET_FAIL = "disk_reset_failed"
VM_DISK_CHANGE_STORAGE = "disk_change_storage"
VM_DISK_CHANGE_STORAGE_FAIL = "disk_change_storage_fail"
VM_START_INSTANCE_SNAPSHOT = "start_instance_snapshot"
VM_INSTANCE_SNAPSHOT_FAILED = "instance_snapshot_failed"
@@ -153,21 +155,21 @@ const (
HYPERVISOR_HYPERV = "hyperv"
HYPERVISOR_XEN = "xen"
HYPERVISOR_ALIYUN = "aliyun"
HYPERVISOR_APSARA = "apsara"
HYPERVISOR_QCLOUD = "qcloud"
HYPERVISOR_AZURE = "azure"
HYPERVISOR_AWS = "aws"
HYPERVISOR_HUAWEI = "huawei"
HYPERVISOR_HUAWEI_CLOUD_STACK = "huaweicloudstack"
HYPERVISOR_OPENSTACK = "openstack"
HYPERVISOR_UCLOUD = "ucloud"
HYPERVISOR_ZSTACK = "zstack"
HYPERVISOR_GOOGLE = "google"
HYPERVISOR_CTYUN = "ctyun"
HYPERVISOR_ECLOUD = "ecloud"
HYPERVISOR_JDCLOUD = "jdcloud"
HYPERVISOR_CLOUDPODS = "cloudpods"
HYPERVISOR_ALIYUN = "aliyun"
HYPERVISOR_APSARA = "apsara"
HYPERVISOR_QCLOUD = "qcloud"
HYPERVISOR_AZURE = "azure"
HYPERVISOR_AWS = "aws"
HYPERVISOR_HUAWEI = "huawei"
HYPERVISOR_HCSO = "hcso"
HYPERVISOR_OPENSTACK = "openstack"
HYPERVISOR_UCLOUD = "ucloud"
HYPERVISOR_ZSTACK = "zstack"
HYPERVISOR_GOOGLE = "google"
HYPERVISOR_CTYUN = "ctyun"
HYPERVISOR_ECLOUD = "ecloud"
HYPERVISOR_JDCLOUD = "jdcloud"
HYPERVISOR_CLOUDPODS = "cloudpods"
// HYPERVISOR_DEFAULT = HYPERVISOR_KVM
HYPERVISOR_DEFAULT = HYPERVISOR_KVM
@@ -178,6 +180,11 @@ const (
CPU_MODE_HOST = "host"
)
const (
VM_MACHINE_TYPE_PC = "pc"
VM_MACHINE_TYPE_Q35 = "q35"
)
var VM_RUNNING_STATUS = []string{VM_START_START, VM_STARTING, VM_RUNNING, VM_BLOCK_STREAM, VM_BLOCK_STREAM_FAIL}
var VM_CREATING_STATUS = []string{VM_CREATE_NETWORK, VM_CREATE_DISK, VM_START_DEPLOY, VM_DEPLOYING}
@@ -192,7 +199,7 @@ var HYPERVISORS = []string{
HYPERVISOR_AWS,
HYPERVISOR_QCLOUD,
HYPERVISOR_HUAWEI,
HYPERVISOR_HUAWEI_CLOUD_STACK,
HYPERVISOR_HCSO,
HYPERVISOR_OPENSTACK,
HYPERVISOR_UCLOUD,
HYPERVISOR_ZSTACK,
@@ -227,53 +234,53 @@ var PRIVATE_CLOUD_HYPERVISORS = []string{
HYPERVISOR_OPENSTACK,
HYPERVISOR_APSARA,
HYPERVISOR_CLOUDPODS,
HYPERVISOR_HUAWEI_CLOUD_STACK,
HYPERVISOR_HCSO,
}
// var HYPERVISORS = []string{HYPERVISOR_ALIYUN}
var HYPERVISOR_HOSTTYPE = map[string]string{
HYPERVISOR_KVM: HOST_TYPE_HYPERVISOR,
HYPERVISOR_BAREMETAL: HOST_TYPE_BAREMETAL,
HYPERVISOR_ESXI: HOST_TYPE_ESXI,
HYPERVISOR_CONTAINER: HOST_TYPE_KUBELET,
HYPERVISOR_ALIYUN: HOST_TYPE_ALIYUN,
HYPERVISOR_APSARA: HOST_TYPE_APSARA,
HYPERVISOR_AZURE: HOST_TYPE_AZURE,
HYPERVISOR_AWS: HOST_TYPE_AWS,
HYPERVISOR_QCLOUD: HOST_TYPE_QCLOUD,
HYPERVISOR_HUAWEI: HOST_TYPE_HUAWEI,
HYPERVISOR_HUAWEI_CLOUD_STACK: HOST_TYPE_HUAWEI_CLOUD_STACK,
HYPERVISOR_OPENSTACK: HOST_TYPE_OPENSTACK,
HYPERVISOR_UCLOUD: HOST_TYPE_UCLOUD,
HYPERVISOR_ZSTACK: HOST_TYPE_ZSTACK,
HYPERVISOR_GOOGLE: HOST_TYPE_GOOGLE,
HYPERVISOR_CTYUN: HOST_TYPE_CTYUN,
HYPERVISOR_ECLOUD: HOST_TYPE_ECLOUD,
HYPERVISOR_JDCLOUD: HOST_TYPE_JDCLOUD,
HYPERVISOR_CLOUDPODS: HOST_TYPE_CLOUDPODS,
HYPERVISOR_KVM: HOST_TYPE_HYPERVISOR,
HYPERVISOR_BAREMETAL: HOST_TYPE_BAREMETAL,
HYPERVISOR_ESXI: HOST_TYPE_ESXI,
HYPERVISOR_CONTAINER: HOST_TYPE_KUBELET,
HYPERVISOR_ALIYUN: HOST_TYPE_ALIYUN,
HYPERVISOR_APSARA: HOST_TYPE_APSARA,
HYPERVISOR_AZURE: HOST_TYPE_AZURE,
HYPERVISOR_AWS: HOST_TYPE_AWS,
HYPERVISOR_QCLOUD: HOST_TYPE_QCLOUD,
HYPERVISOR_HUAWEI: HOST_TYPE_HUAWEI,
HYPERVISOR_HCSO: HOST_TYPE_HCSO,
HYPERVISOR_OPENSTACK: HOST_TYPE_OPENSTACK,
HYPERVISOR_UCLOUD: HOST_TYPE_UCLOUD,
HYPERVISOR_ZSTACK: HOST_TYPE_ZSTACK,
HYPERVISOR_GOOGLE: HOST_TYPE_GOOGLE,
HYPERVISOR_CTYUN: HOST_TYPE_CTYUN,
HYPERVISOR_ECLOUD: HOST_TYPE_ECLOUD,
HYPERVISOR_JDCLOUD: HOST_TYPE_JDCLOUD,
HYPERVISOR_CLOUDPODS: HOST_TYPE_CLOUDPODS,
}
var HOSTTYPE_HYPERVISOR = map[string]string{
HOST_TYPE_HYPERVISOR: HYPERVISOR_KVM,
HOST_TYPE_BAREMETAL: HYPERVISOR_BAREMETAL,
HOST_TYPE_ESXI: HYPERVISOR_ESXI,
HOST_TYPE_KUBELET: HYPERVISOR_CONTAINER,
HOST_TYPE_ALIYUN: HYPERVISOR_ALIYUN,
HOST_TYPE_APSARA: HYPERVISOR_APSARA,
HOST_TYPE_AZURE: HYPERVISOR_AZURE,
HOST_TYPE_AWS: HYPERVISOR_AWS,
HOST_TYPE_QCLOUD: HYPERVISOR_QCLOUD,
HOST_TYPE_HUAWEI: HYPERVISOR_HUAWEI,
HOST_TYPE_HUAWEI_CLOUD_STACK: HYPERVISOR_HUAWEI_CLOUD_STACK,
HOST_TYPE_OPENSTACK: HYPERVISOR_OPENSTACK,
HOST_TYPE_UCLOUD: HYPERVISOR_UCLOUD,
HOST_TYPE_ZSTACK: HYPERVISOR_ZSTACK,
HOST_TYPE_GOOGLE: HYPERVISOR_GOOGLE,
HOST_TYPE_CTYUN: HYPERVISOR_CTYUN,
HOST_TYPE_ECLOUD: HYPERVISOR_ECLOUD,
HOST_TYPE_JDCLOUD: HYPERVISOR_JDCLOUD,
HOST_TYPE_CLOUDPODS: HYPERVISOR_CLOUDPODS,
HOST_TYPE_HYPERVISOR: HYPERVISOR_KVM,
HOST_TYPE_BAREMETAL: HYPERVISOR_BAREMETAL,
HOST_TYPE_ESXI: HYPERVISOR_ESXI,
HOST_TYPE_KUBELET: HYPERVISOR_CONTAINER,
HOST_TYPE_ALIYUN: HYPERVISOR_ALIYUN,
HOST_TYPE_APSARA: HYPERVISOR_APSARA,
HOST_TYPE_AZURE: HYPERVISOR_AZURE,
HOST_TYPE_AWS: HYPERVISOR_AWS,
HOST_TYPE_QCLOUD: HYPERVISOR_QCLOUD,
HOST_TYPE_HUAWEI: HYPERVISOR_HUAWEI,
HOST_TYPE_HCSO: HYPERVISOR_HCSO,
HOST_TYPE_OPENSTACK: HYPERVISOR_OPENSTACK,
HOST_TYPE_UCLOUD: HYPERVISOR_UCLOUD,
HOST_TYPE_ZSTACK: HYPERVISOR_ZSTACK,
HOST_TYPE_GOOGLE: HYPERVISOR_GOOGLE,
HOST_TYPE_CTYUN: HYPERVISOR_CTYUN,
HOST_TYPE_ECLOUD: HYPERVISOR_ECLOUD,
HOST_TYPE_JDCLOUD: HYPERVISOR_JDCLOUD,
HOST_TYPE_CLOUDPODS: HYPERVISOR_CLOUDPODS,
}
const (

View File

@@ -66,3 +66,35 @@ type GuestdiskUpdateInput struct {
Index *int8 `json:"index"`
}
type GuestdiskJsonDesc struct {
DiskId string `json:"disk_id"`
Driver string `json:"driver"`
CacheMode string `json:"cache_mode"`
AioMode string `json:"aio_mode"`
Iops int `json:"iops"`
Bps int `json:"bps"`
Size int `json:"size"`
TemplateId string `json:"template_id"`
ImagePath string `json:"image_path"`
StorageId string `json:"storage_id"`
Migrating bool `json:"migrating"`
Path string `json:"path"`
Format string `json:"format"`
Index int8 `json:"index"`
MergeSnapshot bool `json:"merge_snapshot"`
EsxiFlatFilePath string `json:"esxi_flat_file_path"`
Fs string `json:"fs"`
Mountpoint string `json:"mountpoint"`
Dev string `json:"dev"`
IsSSD bool `json:"is_ssd"`
// esxi
ImageInfo struct {
ImageType string `json:"image_type"`
ImageExternalId string `json:"image_external_id"`
StorageCacheHostIp string `json:"storage_cache_host_ip"`
} `json:"image_info"`
TargetStorageId string `json:"target_storage_id"`
}

View File

@@ -18,6 +18,8 @@ const (
MIRROR_JOB = "__mirror_job_status"
MIRROR_JOB_READY = "ready"
MIRROR_JOB_FAILED = "failed"
SSH_PORT = "__ssh_port"
)
const BASE_INSTANCE_SNAPSHOT_ID = "__base_instance_snapshot_id"

View File

@@ -44,10 +44,18 @@ type GuestSshableOutput struct {
MethodTried []GuestSshableMethodData
}
type GuestHaveAgentInput struct {
}
type GuestHaveAgentOutput struct {
Have bool
}
type GuestMakeSshableInput struct {
User string
PrivateKey string
Password string
Port int
}
type GuestMakeSshableOutput struct {
@@ -57,3 +65,7 @@ type GuestMakeSshableOutput struct {
type GuestMakeSshableCmdOutput struct {
ShellCmd string
}
type GuestSetSshPortInput struct {
Port int
}

View File

@@ -14,6 +14,8 @@
package compute
import "yunion.io/x/jsonutils"
type GuestnetworkDetails struct {
GuestJointResourceDetails
@@ -70,3 +72,44 @@ type GuestnetworkUpdateInput struct {
Index *int8 `json:"index"`
}
type GuestnetworkJsonDesc struct {
Net string `json:"net"`
NetId string `json:"net_id"`
Mac string `json:"mac"`
Virtual bool `json:"virtual"`
Ip string `json:"ip"`
Gateway string `json:"gateway"`
DNS string `json:"dns"`
Domain string `json:"domain"`
Routes jsonutils.JSONObject `json:"routes"`
Ifname string `json:"ifname"`
Masklen int8 `json:"masklen"`
Driver string `json:"driver"`
Vlan int `json:"vlan"`
Bw int `json:"bw"`
Mtu int `json:"mtu"`
Index int8 `json:"index"`
VirtualIps []string `json:"virtual_ips"`
ExternalId string `json:"external_id"`
TeamWith string `json:"team_with"`
Manual *bool `json:"manual"`
Vpc struct {
Id string `json:"id"`
Provider string `json:"provider"`
MappedIpAddr string `json:"mapped_ip_addr"`
} `json:"vpc"`
Networkaddresses jsonutils.JSONObject `json:"networkaddresses"`
Bridge string `json:"bridge"`
WireId string `json:"wire_id"`
Interface string `json:"interface"`
// baremetal
Rate int `json:"rate"`
BaremetalId string `json:"baremetal_id"`
NicType string `json:"nic_type"`
LinkUp bool `json:"link_up"`
}

View File

@@ -18,6 +18,8 @@ import (
"fmt"
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/apis/billing"
)
@@ -121,12 +123,14 @@ func (input *ServerListInput) AfterUnmarshal() {
type ServerRebuildRootInput struct {
apis.Meta
// 镜像名称
Image string `json:"image"`
// swagger: ignore
Image string `json:"image" yunion-deprecated-by:"image_id"`
// 镜像 id
// required: true
ImageId string `json:"image_id"`
Keypair string `json:"keypair"`
ImageId string `json:"image_id"`
// swagger: ignore
Keypair string `json:"keypair" yunion-deprecated-by:"keypair_id"`
// 秘钥Id
KeypairId string `json:"keypair_id"`
ResetPassword *bool `json:"reset_password"`
Password string `json:"password"`
@@ -134,26 +138,6 @@ type ServerRebuildRootInput struct {
AllDisks *bool `json:"all_disks"`
}
func (i ServerRebuildRootInput) GetImageName() string {
if len(i.Image) > 0 {
return i.Image
}
if len(i.ImageId) > 0 {
return i.ImageId
}
return ""
}
func (i ServerRebuildRootInput) GetKeypairName() string {
if len(i.Keypair) > 0 {
return i.Keypair
}
if len(i.KeypairId) > 0 {
return i.KeypairId
}
return ""
}
type ServerResumeInput struct {
apis.Meta
}
@@ -555,3 +539,164 @@ type ServerMigrateNetworkInput struct {
// Destination network Id
Dest string `json:"dest"`
}
type ServerDeployInput struct {
apis.Meta
// swagger: ignore
Keypair string `json:"keypair" yunion-deprecated-by:"keypair_id"`
// 秘钥Id
KeypairId string `json:"keypair_id"`
// 清理指定公钥
// 若指定的秘钥Id和虚拟机的秘钥Id不相同, 则清理旧的公钥
DeletePublicKey string `json:"delete_public_key"`
// 解绑当前虚拟机秘钥, 并清理公钥信息
DeleteKeypair bool `json:"__delete_keypair__"`
// 生成随机密码, 优先级低于password
ResetPassword bool `json:"reset_password"`
// 重置指定密码
Password string `json:"password"`
// 部署完成后是否自动启动
// 若虚拟机重置密码后需要重启生效并且当前虚拟机状态为running, 此参数默认为true
// 若虚拟机状态为ready, 指定此参数后,部署完成后,虚拟机会自动启动
AutoStart bool `json:"auto_start"`
// swagger: ignore
Restart bool `json:"restart"`
// swagger: ignore
DeployConfigs []*DeployConfig `json:"deploy_configs"`
}
type ServerUserDataInput struct {
UserData string `json:"user_data"`
}
type ServerAttachDiskInput struct {
DiskId string `json:"disk_id"`
}
type ServerDetachDiskInput struct {
// 磁盘Id若磁盘未挂载在虚拟机上不返回错误
DiskId string `json:"disk_id"`
// 是否保留磁盘
// default: false
KeepDisk bool `json:"keep_disk"`
}
type ServerChangeConfigInput struct {
// 实例类型, 优先级高于vcpu_count和vmem_size
InstanceType string `json:"instance_type"`
// swagger: ignore
Sku string `json:"sku" yunion-deprecated-by:"instance_type"`
// swagger: ignore
Flavor string `json:"flavor" yunion-deprecated-by:"instance_type"`
// cpu大小
VcpuCount int `json:"vcpu_count"`
// 内存大小, 1024M, 1G
VmemSize string `json:"vmem_size"`
// 调整完配置后是否自动启动
AutoStart bool `json:"auto_start"`
Disks []DiskConfig `json:"disks"`
}
type ServerUpdateInput struct {
apis.VirtualResourceBaseUpdateInput
// 删除保护开关
DisableDelete *bool `json:"disable_delete"`
// 启动顺序
BootOrder *string `json:"boot_order"`
// 关机执行操作
ShutdownBehavior *string `json:"shutdown_behavior"`
Vga *string `json:"vga"`
Vdi *string `json:"vdi"`
Machine *string `json:"machine"`
Bios *string `json:"bios"`
SrcIpCheck *bool `json:"src_ip_check"`
SrcMacCheck *bool `json:"src_mac_check"`
SshPort int `json:"ssh_port"`
}
type GuestJsonDesc struct {
Name string `json:"name"`
Description string `json:"description"`
UUID string `json:"uuid"`
Mem int `json:"mem"`
Cpu int `json:"cpu"`
Vga string `json:"vga"`
Vdi string `json:"vdi"`
Machine string `json:"machine"`
Bios string `json:"bios"`
BootOrder string `json:"boot_order"`
SrcIpCheck bool `json:"src_ip_check"`
SrcMacCheck bool `json:"src_mac_check"`
IsMaster *bool `json:"is_master"`
IsSlave *bool `json:"is_slave"`
HostId string `json:"host_id"`
IsolatedDevices []*IsolatedDeviceJsonDesc `json:"isolated_devices"`
Domain string `json:"domain"`
Nics []*GuestnetworkJsonDesc `json:"nics"`
Disks []*GuestdiskJsonDesc `json:"disks"`
Cdrom *GuestcdromJsonDesc `json:"cdrom"`
Tenant string `json:"tenant"`
TenantId string `json:"tenant_id"`
DomainId string `json:"domain_id"`
ProjectDomain string `json:"project_domain"`
Keypair string `json:"keypair"`
Pubkey string `json:"pubkey"`
NetworkRoles []string `json:"network_roles"`
Secgroups []*SecgroupJsonDesc `json:"secgroups"`
SecurityRules string `json:"security_rules"`
AdminSecurityRules string `json:"admin_security_rules"`
ExtraOptions jsonutils.JSONObject `json:"extra_options"`
Kvm string `json:"kvm"`
Zone string `json:"zone"`
ZoneId string `json:"zone_id"`
OsName string `json:"os_name"`
Metadata map[string]string `json:"metadata"`
UserData string `json:"user_data"`
PendingDeleted bool `json:"pending_deleted"`
ScallingGroupId string `json:"scalling_group_id"`
// baremetal
DiskConfig jsonutils.JSONObject `json:"disk_config"`
NicsStandby []*GuestnetworkJsonDesc `json:"nics_standby"`
// esxi
InstanceSnapshotInfo struct {
InstanceSnapshotId string `json:"instance_snapshot_id"`
InstanceId string `json:"instance_id"`
} `json:"instance_snapshot_info"`
}
type ServerChangeDiskStorageInput struct {
DiskId string `json:"disk_id"`
TargetStorageId string `json:"target_storage_id"`
KeepOriginDisk bool `json:"keep_origin_disk"`
}
type ServerChangeDiskStorageInternalInput struct {
ServerChangeDiskStorageInput
StorageId string `json:"storage_id"`
TargetDiskId string `json:"target_disk_id"`
}

View File

@@ -23,21 +23,21 @@ const (
HOST_TYPE_HYPERV = "hyperv" // # Microsoft Hyper-V
HOST_TYPE_XEN = "xen" // # XenServer
HOST_TYPE_ALIYUN = "aliyun"
HOST_TYPE_APSARA = "apsara"
HOST_TYPE_AWS = "aws"
HOST_TYPE_QCLOUD = "qcloud"
HOST_TYPE_AZURE = "azure"
HOST_TYPE_HUAWEI = "huawei"
HOST_TYPE_HUAWEI_CLOUD_STACK = "huaweicloudstack"
HOST_TYPE_OPENSTACK = "openstack"
HOST_TYPE_UCLOUD = "ucloud"
HOST_TYPE_ZSTACK = "zstack"
HOST_TYPE_GOOGLE = "google"
HOST_TYPE_CTYUN = "ctyun"
HOST_TYPE_ECLOUD = "ecloud"
HOST_TYPE_JDCLOUD = "jdcloud"
HOST_TYPE_CLOUDPODS = "cloudpods"
HOST_TYPE_ALIYUN = "aliyun"
HOST_TYPE_APSARA = "apsara"
HOST_TYPE_AWS = "aws"
HOST_TYPE_QCLOUD = "qcloud"
HOST_TYPE_AZURE = "azure"
HOST_TYPE_HUAWEI = "huawei"
HOST_TYPE_HCSO = "hcso"
HOST_TYPE_OPENSTACK = "openstack"
HOST_TYPE_UCLOUD = "ucloud"
HOST_TYPE_ZSTACK = "zstack"
HOST_TYPE_GOOGLE = "google"
HOST_TYPE_CTYUN = "ctyun"
HOST_TYPE_ECLOUD = "ecloud"
HOST_TYPE_JDCLOUD = "jdcloud"
HOST_TYPE_CLOUDPODS = "cloudpods"
HOST_TYPE_DEFAULT = HOST_TYPE_HYPERVISOR
@@ -112,7 +112,7 @@ var HOST_TYPES = []string{
HOST_TYPE_AWS,
HOST_TYPE_QCLOUD,
HOST_TYPE_HUAWEI,
HOST_TYPE_HUAWEI_CLOUD_STACK,
HOST_TYPE_HCSO,
HOST_TYPE_OPENSTACK,
HOST_TYPE_UCLOUD,
HOST_TYPE_ZSTACK,

View File

@@ -16,6 +16,8 @@ package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
)
type HoststorageDetails struct {
@@ -58,3 +60,10 @@ type HoststorageListInput struct {
StorageFilterListInput
}
type HostStorageCreateInput struct {
apis.JoinResourceBaseCreateInput
StorageId string `json:"storage_id"`
HostId string `json:"host_id"`
MountPoint string `json:"mount_point"`
}

View File

@@ -95,3 +95,12 @@ type IsolatedDeviceUpdateInput struct {
apis.StandaloneResourceBaseUpdateInput
IsolatedDeviceReservedResourceInput
}
type IsolatedDeviceJsonDesc struct {
Id string `json:"id"`
DevType string `json:"dev_type"`
Model string `json:"model"`
Addr string `json:"addr"`
VendorDeviceId string `json:"vendor_device_id"`
Vendor string `json:"vendor"`
}

View File

@@ -332,6 +332,7 @@ const (
LB_SCHEDULER_SCH = "sch" // source-ip-based consistent hash
LB_SCHEDULER_TCH = "tch" // 4-tuple-based consistent hash
LB_SCHEDULER_QCH = "qch"
LB_SCHEDULER_MH = "mh" // maglev consistent hash
)
var LB_SCHEDULER_TYPES = choices.NewChoices(

View File

@@ -209,22 +209,11 @@ type NetworkCreateInput struct {
BgpType string `json:"bgp_type"`
}
type NetworkDetails struct {
apis.SharableVirtualResourceDetails
WireResourceInfo
SNetwork
// 是否是内网
Exit bool `json:"exit"`
// 端口数量
Ports int `json:"ports"`
// 已使用端口数量
PortsUsed int `json:"ports_used"`
// 网卡数量
type SNetworkNics struct {
// 虚拟机网卡数量
Vnics int `json:"vnics"`
// 裸金属网卡数量
BmVnics int `json:"bm_nics"`
BmVnics int `json:"bm_vnics"`
// 负载均衡网卡数量
LbVnics int `json:"lb_vnics"`
// 浮动Ip网卡数量
@@ -233,6 +222,48 @@ type NetworkDetails struct {
// 预留IP数量
ReserveVnics int `json:"reserve_vnics"`
// RDS网卡数量
RdsVnics int `json:"rds_vnics"`
// NAT网关网卡数量
NatVnics int `json:"nat_vnics"`
BmReusedVnics int `json:"bm_reused_vnics"`
// 弹性网卡数量
NetworkinterfaceVnics int `json:"networkinterface_vnics"`
// 已使用端口数量
PortsUsed int `json:"ports_used"`
Total int `json:"total"`
}
func (self *SNetworkNics) SumTotal() {
self.Total = self.Vnics +
self.BmVnics +
self.LbVnics +
self.LbVnics +
self.EipVnics +
self.GroupVnics +
self.ReserveVnics +
self.RdsVnics +
self.NetworkinterfaceVnics +
self.NatVnics -
self.BmReusedVnics
self.PortsUsed = self.Total
}
type NetworkDetails struct {
apis.SharableVirtualResourceDetails
WireResourceInfo
SNetwork
SNetworkNics
// 是否是内网
Exit bool `json:"exit"`
// 端口数量
Ports int `json:"ports"`
// 路由信息
Routes [][]string `json:"routes"`
Schedtags []SchedtagShortDescDetails `json:"schedtags"`

View File

@@ -59,7 +59,7 @@ var (
REGIONAL_NETWORK_PROVIDERS = []string{
CLOUD_PROVIDER_HUAWEI,
CLOUD_PROVIDER_HUAWEI_CLOUD_STACK,
CLOUD_PROVIDER_HCSO,
CLOUD_PROVIDER_CTYUN,
CLOUD_PROVIDER_UCLOUD,
CLOUD_PROVIDER_GOOGLE,

View File

@@ -0,0 +1,556 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import (
"yunion.io/x/onecloud/pkg/cloudprovider"
)
var (
// China
RegionBeijing = cloudprovider.SGeographicInfo{
Latitude: 39.90419989999999,
Longitude: 116.4073963,
City: CITY_BEI_JING,
CountryCode: COUNTRY_CODE_CN,
}
RegionNingxia = cloudprovider.SGeographicInfo{
Latitude: 37.198731,
Longitude: 106.1580937,
City: CITY_NING_XIA,
CountryCode: COUNTRY_CODE_CN,
}
RegionShanghai = cloudprovider.SGeographicInfo{
Latitude: 31.17,
Longitude: 121.47,
City: CITY_SHANG_HAI,
CountryCode: COUNTRY_CODE_CN,
}
RegionGuangzhou = cloudprovider.SGeographicInfo{
Latitude: 23.12911,
Longitude: 113.264385,
City: CITY_GUANG_ZHOU,
CountryCode: COUNTRY_CODE_CN,
}
RegionDalian = cloudprovider.SGeographicInfo{
Latitude: 38.91400300000001,
Longitude: 121.614682,
City: CITY_DA_LIAN,
CountryCode: COUNTRY_CODE_CN,
}
RegionGuiyang = cloudprovider.SGeographicInfo{
Latitude: 26.6470035286,
Longitude: 106.6302113880,
City: CITY_GUI_YANG,
CountryCode: COUNTRY_CODE_CN,
}
RegionNeimenggu = cloudprovider.SGeographicInfo{
Latitude: 41.0178713,
Longitude: 113.094978,
City: CITY_NEI_MENG_GU,
CountryCode: COUNTRY_CODE_CN,
}
RegionQingdao = cloudprovider.SGeographicInfo{
Latitude: 36.067108,
Longitude: 120.382607,
City: CITY_QING_DAO,
CountryCode: COUNTRY_CODE_CN,
}
RegionZhangjiakou = cloudprovider.SGeographicInfo{
Latitude: 40.767544,
Longitude: 114.886337,
City: CITY_ZHANG_JIA_KOU,
CountryCode: COUNTRY_CODE_CN,
}
RegionHuhehaote = cloudprovider.SGeographicInfo{
Latitude: 40.842358,
Longitude: 111.749992,
City: CITY_HU_HE_HAO_TE,
CountryCode: COUNTRY_CODE_CN,
}
RegionHangzhou = cloudprovider.SGeographicInfo{
Latitude: 30.274084,
Longitude: 120.155067,
City: CITY_HANG_ZHOU,
CountryCode: COUNTRY_CODE_CN,
}
RegionShenzhen = cloudprovider.SGeographicInfo{
Latitude: 22.543097,
Longitude: 114.057861,
City: CITY_SHEN_ZHEN,
CountryCode: COUNTRY_CODE_CN,
}
RegionChengdu = cloudprovider.SGeographicInfo{
Latitude: 30.572815,
Longitude: 104.066803,
City: CITY_CHENG_DU,
CountryCode: COUNTRY_CODE_CN,
}
RegionHeyuan = cloudprovider.SGeographicInfo{
Latitude: 23.7292717,
Longitude: 114.6965786,
City: CITY_HE_YUAN,
CountryCode: COUNTRY_CODE_CN,
}
RegionWulanchabu = cloudprovider.SGeographicInfo{
Latitude: 41.0178065,
Longitude: 113.094978,
City: CITY_WU_LAN_CHA_BU,
CountryCode: COUNTRY_CODE_CN,
}
RegionChongqing = cloudprovider.SGeographicInfo{
Latitude: 29.431585,
Longitude: 106.912254,
City: CITY_CHONG_QING,
CountryCode: COUNTRY_CODE_CN,
}
RegionNanjing = cloudprovider.SGeographicInfo{
Latitude: 32.0584065670,
Longitude: 118.7964897811,
City: CITY_NAN_JING,
CountryCode: COUNTRY_CODE_CN,
}
// Asia
RegionTaiwan = cloudprovider.SGeographicInfo{
Latitude: 25.0443,
Longitude: 121.509,
City: CITY_TAI_WAN,
CountryCode: COUNTRY_CODE_CN,
}
RegionHongkong = cloudprovider.SGeographicInfo{
Latitude: 22.396427,
Longitude: 114.109497,
City: CITY_HONG_KONG,
CountryCode: COUNTRY_CODE_CN,
}
RegionTokyo = cloudprovider.SGeographicInfo{
Latitude: 35.709026,
Longitude: 139.731995,
City: CITY_TOKYO,
CountryCode: COUNTRY_CODE_JP,
}
RegionOsaka = cloudprovider.SGeographicInfo{
Latitude: 34.6937378,
Longitude: 135.5021651,
City: CITY_OSAKA,
CountryCode: COUNTRY_CODE_JP,
}
RegionSeoul = cloudprovider.SGeographicInfo{
Latitude: 34.6937378,
Longitude: 135.5021651,
City: CITY_SEOUL,
CountryCode: COUNTRY_CODE_KR,
}
RegionBusan = cloudprovider.SGeographicInfo{
Latitude: 35.1,
Longitude: 129.0403,
City: CITY_BUSAN,
CountryCode: COUNTRY_CODE_KR,
}
RegionMumbai = cloudprovider.SGeographicInfo{
Latitude: 19.07599,
Longitude: 72.877393,
City: CITY_MUMBAI,
CountryCode: COUNTRY_CODE_IN,
}
RegionDelhi = cloudprovider.SGeographicInfo{
Latitude: 28.61,
Longitude: 77.23,
City: CITY_DELHI,
CountryCode: COUNTRY_CODE_IN,
}
RegionMaharashtra = cloudprovider.SGeographicInfo{
Latitude: 18.97,
Longitude: 72.82,
City: CITY_MAHARASHTRA,
CountryCode: COUNTRY_CODE_IN,
}
RegionKanchipuram = cloudprovider.SGeographicInfo{
Latitude: 12.8387,
Longitude: 79.7016,
City: CITY_KANCHIPURAM,
CountryCode: COUNTRY_CODE_IN,
}
RegionSingapore = cloudprovider.SGeographicInfo{
Latitude: 1.352083,
Longitude: 103.819839,
City: CITY_SINGAPORE,
CountryCode: COUNTRY_CODE_SG,
}
RegionJakarta = cloudprovider.SGeographicInfo{
Latitude: -6.175110,
Longitude: 106.865036,
City: CITY_JAKARTA,
CountryCode: COUNTRY_CODE_ID,
}
RegionKualaLumpur = cloudprovider.SGeographicInfo{
Latitude: 3.139003,
Longitude: 101.686852,
City: CITY_KUALA_LUMPUR,
CountryCode: COUNTRY_CODE_MY,
}
RegionBangkok = cloudprovider.SGeographicInfo{
Latitude: 13.7563309,
Longitude: 100.5017651,
City: CITY_BANGKOK,
CountryCode: COUNTRY_CODE_TH,
}
RegionSydney = cloudprovider.SGeographicInfo{
Latitude: -33.8688197,
Longitude: 151.2092955,
City: CITY_SYDNEY,
CountryCode: COUNTRY_CODE_AU,
}
RegionMelbourne = cloudprovider.SGeographicInfo{
Latitude: -37.813611,
Longitude: 144.963056,
City: CITY_MELBOURNE,
CountryCode: COUNTRY_CODE_AU,
}
//亚拉伦拉 澳大利亚
RegionYarralumla = cloudprovider.SGeographicInfo{
Latitude: -35.3016,
Longitude: 149.078,
City: CITY_YARRALUMLA,
CountryCode: COUNTRY_CODE_AU,
}
// Africa
RegionCapeTown = cloudprovider.SGeographicInfo{
Latitude: -33.9152209,
Longitude: 18.3758904,
City: CITY_CAPE_TOWN,
CountryCode: COUNTRY_CODE_ZA,
}
// 比勒陀利亚
RegionPretoria = cloudprovider.SGeographicInfo{
Latitude: -25.716667,
Longitude: 28.283333,
City: CITY_PRETORIA,
CountryCode: COUNTRY_CODE_ZA,
}
RegionJohannesburg = cloudprovider.SGeographicInfo{
Latitude: -26.1714537,
Longitude: 27.8999389,
City: CITY_JOHANNESBURG,
CountryCode: COUNTRY_CODE_ZA,
}
// Middleeast
RegionBahrain = cloudprovider.SGeographicInfo{
Latitude: 25.9408826,
Longitude: 50.4474957,
City: CITY_BAHRAIN,
CountryCode: COUNTRY_CODE_BH,
}
RegionDubai = cloudprovider.SGeographicInfo{
Latitude: 25.263056,
Longitude: 55.297222,
City: CITY_DUBAI,
CountryCode: COUNTRY_CODE_AE,
}
// Europe
RegionFinland = cloudprovider.SGeographicInfo{
Latitude: 64.8255731,
Longitude: 21.5432837,
City: CITY_FINLAND,
CountryCode: COUNTRY_CODE_FI,
}
RegionBelgium = cloudprovider.SGeographicInfo{
Latitude: 50.499734,
Longitude: 3.9057517,
City: CITY_BELGIUM,
CountryCode: COUNTRY_CODE_BE,
}
RegionLondon = cloudprovider.SGeographicInfo{
Latitude: 51.507351,
Longitude: -0.127758,
City: CITY_LONDON,
CountryCode: COUNTRY_CODE_GB,
}
RegionHalton = cloudprovider.SGeographicInfo{
Latitude: 53.3331,
Longitude: -2.6957,
City: CITY_HALTON,
CountryCode: COUNTRY_CODE_GB,
}
RegionSussex = cloudprovider.SGeographicInfo{
Latitude: 51,
Longitude: 0,
City: CITY_WEST_SUSSEX,
CountryCode: COUNTRY_CODE_GB,
}
RegionFrankfurt = cloudprovider.SGeographicInfo{
Latitude: 51.165691,
Longitude: 10.451526,
City: CITY_FRANKFURT,
CountryCode: COUNTRY_CODE_DE,
}
RegionHolland = cloudprovider.SGeographicInfo{
Latitude: 52.2076831,
Longitude: 4.1585786,
City: CITY_HOLLAND,
CountryCode: COUNTRY_CODE_NL,
}
RegionZurich = cloudprovider.SGeographicInfo{
Latitude: 47.3774497,
Longitude: 8.5016958,
City: CITY_ZURICH,
CountryCode: COUNTRY_CODE_CH,
}
RegionWarsaw = cloudprovider.SGeographicInfo{
Latitude: 52.233333,
Longitude: 21.016667,
City: CITY_WARSAW,
CountryCode: COUNTRY_CODE_PL,
}
RegionIreland = cloudprovider.SGeographicInfo{
Latitude: 53.41291,
Longitude: -8.24389,
City: CITY_IRELAND,
CountryCode: COUNTRY_CODE_IE,
}
RegionDublin = cloudprovider.SGeographicInfo{
Latitude: 53.349722,
Longitude: -6.260278,
City: CITY_DUBLIN,
CountryCode: COUNTRY_CODE_IE,
}
RegionParis = cloudprovider.SGeographicInfo{
Latitude: 48.856614,
Longitude: 2.3522219,
City: CITY_PARIS,
CountryCode: COUNTRY_CODE_FR,
}
RegionAllier = cloudprovider.SGeographicInfo{
Latitude: 46.5178,
Longitude: 3.3592,
City: CITY_ALLIER,
CountryCode: COUNTRY_CODE_FR,
}
RegionTarn = cloudprovider.SGeographicInfo{
Latitude: 43.8656,
Longitude: 1.505,
City: CITY_TARN,
CountryCode: COUNTRY_CODE_FR,
}
RegionStockholm = cloudprovider.SGeographicInfo{
Latitude: 59.1946,
Longitude: 18.47,
City: CITY_STOCKHOLM,
CountryCode: COUNTRY_CODE_SE,
}
RegionDelmenhorst = cloudprovider.SGeographicInfo{
Latitude: 53.050556,
Longitude: 8.631667,
City: CITY_DELMENHORST,
CountryCode: COUNTRY_CODE_DE,
}
RegionGeneva = cloudprovider.SGeographicInfo{
Latitude: 46.201667,
Longitude: 6.146944,
City: CITY_GENEVA,
CountryCode: COUNTRY_CODE_CH,
}
RegionStavanger = cloudprovider.SGeographicInfo{
Latitude: 58.963333,
Longitude: 5.718889,
City: CITY_STAVANGER,
CountryCode: COUNTRY_CODE_NO,
}
RegionOslo = cloudprovider.SGeographicInfo{
Latitude: 59.905556,
Longitude: 10.768333,
City: CITY_OSLO,
CountryCode: COUNTRY_CODE_NO,
}
RegionMoscow = cloudprovider.SGeographicInfo{
Latitude: 55.755825,
Longitude: 37.617298,
City: CITY_MOSCOW,
CountryCode: COUNTRY_CODE_RU,
}
// America
RegionMontreal = cloudprovider.SGeographicInfo{
Latitude: 45.5580206,
Longitude: -73.8003414,
City: CITY_MONTREAL,
CountryCode: COUNTRY_CODE_CA,
}
RegionToronto = cloudprovider.SGeographicInfo{
Latitude: 43.653225,
Longitude: -79.383186,
City: CITY_TORONTO,
CountryCode: COUNTRY_CODE_CA,
}
RegionCanadaCentral = cloudprovider.SGeographicInfo{
Latitude: 56.130366,
Longitude: -106.346771,
City: CITY_CANADA_CENTRAL,
CountryCode: COUNTRY_CODE_CA,
}
RegionQuebec = cloudprovider.SGeographicInfo{
Latitude: 52,
Longitude: -72,
City: CITY_QUEBEC,
CountryCode: COUNTRY_CODE_CA,
}
RegionSaoPaulo = cloudprovider.SGeographicInfo{
Latitude: -23.5505199,
Longitude: -46.6333094,
City: CITY_SAO_PAULO,
CountryCode: COUNTRY_CODE_BR,
}
// 里约热内卢
RegionRioDeJaneiro = cloudprovider.SGeographicInfo{
Latitude: -22.9083,
Longitude: -43.1964,
City: CITY_RIO_DE_JANEIRO,
CountryCode: COUNTRY_CODE_BR,
}
RegionMexico = cloudprovider.SGeographicInfo{
Latitude: 55.1182908,
Longitude: 141.0377645,
City: CITY_MEXICO,
CountryCode: COUNTRY_CODE_MX,
}
RegionSantiago = cloudprovider.SGeographicInfo{
Latitude: -33.45206,
Longitude: -70.676031,
City: CITY_SANTIAGO,
CountryCode: COUNTRY_CODE_CL,
}
RegionIowa = cloudprovider.SGeographicInfo{
Latitude: 41.9328655,
Longitude: -94.5106809,
City: CITY_IOWA,
CountryCode: COUNTRY_CODE_US,
}
RegionCarolina = cloudprovider.SGeographicInfo{
Latitude: 33.6194409,
Longitude: -82.0475635,
City: CITY_SOUTH_CAROLINA,
CountryCode: COUNTRY_CODE_US,
}
// 西雅图,华盛顿州
RegionWashington = cloudprovider.SGeographicInfo{
Latitude: 47.6,
Longitude: -122.3,
City: CITY_WASHINGTON,
CountryCode: COUNTRY_CODE_US,
}
RegionVirginia = cloudprovider.SGeographicInfo{
Latitude: 37.4315734,
Longitude: -78.6568942,
City: CITY_VIRGINIA,
CountryCode: COUNTRY_CODE_US,
}
RegionTexas = cloudprovider.SGeographicInfo{
Latitude: 31,
Longitude: -100,
City: CITY_TEXAS,
CountryCode: COUNTRY_CODE_US,
}
RegionChicago = cloudprovider.SGeographicInfo{
Latitude: 41.8819,
Longitude: -87.6278,
City: CITY_CHICAGO,
CountryCode: COUNTRY_CODE_US,
}
RegionPhoenix = cloudprovider.SGeographicInfo{
Latitude: 33.4483,
Longitude: -112.0739,
City: CITY_PHOENIX,
CountryCode: COUNTRY_CODE_US,
}
RegionUtah = cloudprovider.SGeographicInfo{
Latitude: 39.5,
Longitude: -111.5,
City: CITY_UTAH,
CountryCode: COUNTRY_CODE_US,
}
RegionSanFrancisco = cloudprovider.SGeographicInfo{
Latitude: 37.7775,
Longitude: -122.4164,
City: CITY_SAN_FRANCISCO,
CountryCode: COUNTRY_CODE_US,
}
RegionSiliconValley = cloudprovider.SGeographicInfo{
Latitude: 37.387474,
Longitude: -122.057541,
City: CITY_SILICONVALLEY,
CountryCode: COUNTRY_CODE_US,
}
RegionNothVirginia = cloudprovider.SGeographicInfo{
Latitude: 37.4315734,
Longitude: -78.6568942,
City: CITY_N_VIRGINIA,
CountryCode: COUNTRY_CODE_US,
}
RegionOregon = cloudprovider.SGeographicInfo{
Latitude: 43.8041334,
Longitude: -120.5542012,
City: CITY_OREGON,
CountryCode: COUNTRY_CODE_US,
}
RegionLosAngeles = cloudprovider.SGeographicInfo{
Latitude: 34.0522342,
Longitude: -118.2436849,
City: CITY_LOS_ANGELES,
CountryCode: COUNTRY_CODE_US,
}
RegionSaltLakeCity = cloudprovider.SGeographicInfo{
Latitude: 40.7767168,
Longitude: -111.9905243,
City: CITY_SALT_LAKE_CITY,
CountryCode: COUNTRY_CODE_US,
}
RegionLasVegas = cloudprovider.SGeographicInfo{
Latitude: 36.1249185,
Longitude: -115.3150811,
City: CITY_LAS_VEGAS,
CountryCode: COUNTRY_CODE_US,
}
RegionNorthCalifornia = cloudprovider.SGeographicInfo{
Latitude: 38.8375215,
Longitude: -120.8958242,
City: CITY_N_CALIFORNIA,
CountryCode: COUNTRY_CODE_US,
}
RegionOhio = cloudprovider.SGeographicInfo{
Latitude: 40.4172871,
Longitude: -82.90712300000001,
City: CITY_OHIO,
CountryCode: COUNTRY_CODE_US,
}
RegionUSGOVWest = cloudprovider.SGeographicInfo{
Latitude: 37.09024,
Longitude: -95.712891,
City: CITY_US_GOV_WEST,
CountryCode: COUNTRY_CODE_US,
}
)

View File

@@ -17,6 +17,7 @@ package compute
import (
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/util/regutils"
"yunion.io/x/pkg/util/secrules"
@@ -181,6 +182,7 @@ type SecgroupListInput struct {
RegionalFilterListInput
ManagedResourceListInput
WithCache bool `json:"witch_cache"`
}
type SecurityGroupCacheListInput struct {
@@ -252,6 +254,8 @@ type SecgroupDetails struct {
InRules []SecgroupRuleDetails `json:"in_rules"`
// 出方向规则信息
OutRules []SecgroupRuleDetails `json:"out_rules"`
CloudCaches []jsonutils.JSONObject `json:"cloud_caches"`
}
type SecurityGroupResourceInfo struct {
@@ -312,3 +316,8 @@ type SecurityGroupCloneInput struct {
type SecgroupImportRulesInput struct {
Rules []SSecgroupRuleCreateInput `json:"rules"`
}
type SecgroupJsonDesc struct {
Id string `json:"id"`
Name string `json:"name"`
}

View File

@@ -62,6 +62,9 @@ type VpcListInput struct {
UsableResourceListInput
UsableVpcResourceListInput
// 过滤vpc底下有指定zone的ip子网
ZoneId string `json:"zone_id"`
// filter by globalvpc
Globalvpc string `json:"globalvpc"`

View File

@@ -43,6 +43,9 @@ const (
SERVICE_TYPE_ETCD = "etcd"
SERVICE_TYPE_INFLUXDB = "influxdb"
STATUS_UPDATE_TAGS = "update_tags"
STATUS_UPDATE_TAGS_FAILED = "update_tags_fail"
)
var (
@@ -74,10 +77,20 @@ const (
OS_ARCH_AARCH64 = "aarch64"
)
func IsARM(osArch string) bool {
return utils.IsInStringArray(osArch, []string{
var (
ARCH_X86 = []string{
OS_ARCH_X86,
OS_ARCH_I386,
OS_ARCH_X86_32,
OS_ARCH_X86_64,
}
ARCH_ARM = []string{
OS_ARCH_ARM,
OS_ARCH_AARCH32,
OS_ARCH_AARCH64,
})
}
)
func IsARM(osArch string) bool {
return utils.IsInStringArray(osArch, ARCH_ARM)
}

View File

@@ -87,3 +87,12 @@ type SApplyInfo struct {
ServerId string
TryTimes int
}
type DevtoolManagerServiceUrlInput struct {
ServiceName string
ServerId string
}
type DevtoolManagerServiceUrlOutput struct {
ServiceUrl string
}

View File

@@ -0,0 +1,23 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package devtool
const (
SERVICEURL_STATUS_CREATING = "creating"
SERVICEURL_STATUS_READY = "ready"
SERVICEURL_STATUS_DELETING = "deleting"
SERVICEURL_STATUS_CREATE_FAILED = "create_failed"
SERVICEURL_STATUS_DELETE_FAILED = "delete_failed"
)

View File

@@ -0,0 +1,23 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package devtool
const (
SSHINFO_STATUS_CREATING = "creating"
SSHINFO_STATUS_READY = "ready"
SSHINFO_STATUS_DELETING = "deleting"
SSHINFO_STATUS_CREATE_FAILED = "create_failed"
SSHINFO_STATUS_DELETE_FAILED = "delete_failed"
)

20
pkg/apis/host/types.go Normal file
View File

@@ -0,0 +1,20 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package host
type ServerCloneDiskFromStorageResponse struct {
TargetAccessPath string `json:"target_access_path"`
TargetFormat string `json:"target_format"`
}

View File

@@ -109,6 +109,7 @@ var (
"customized_private_prefixes",
"global_http_proxy",
"global_https_proxy",
"ignore_nonrunning_guests",
},
}

View File

@@ -41,6 +41,9 @@ const (
LocalFilePrefix = "file://"
S3Prefix = "s3://"
IMAGE_STORAGE_DRIVER_LOCAL = "local"
IMAGE_STORAGE_DRIVER_S3 = "s3"
// image properties
IMAGE_OS_ARCH = "os_arch"
IMAGE_OS_DISTRO = "os_distribution"

View File

@@ -195,10 +195,13 @@ type STag struct {
}
type MetadataResourceListInput struct {
// 通过标签过滤
// 通过标签过滤(包含这些标签)
Tags []STag `json:"tags"`
// 通过标签过滤
// 通过标签过滤(不包含这些标签)
NoTags []STag `json:"no_tags"`
// 通过标签排序
OrderByTag string `json:"order_by_tag"`
// deprecated

View File

@@ -28,8 +28,8 @@ type AlertRecordShieldCreateInput struct {
ResName string `json:"res_name"`
ResId string `json:"res_id"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
}
type AlertRecordShieldDetails struct {
@@ -39,6 +39,7 @@ type AlertRecordShieldDetails struct {
CommonAlertDetails
AlertName string `json:"alert_name"`
ResName string `json:"res_name"`
Expired bool `json:"expired"`
}
type AlertRecordShieldListInput struct {
@@ -48,9 +49,11 @@ type AlertRecordShieldListInput struct {
apis.EnabledResourceBaseListInput
apis.StatusStandaloneResourceListInput
AlertName string `json:"alert_name"`
ResType string `json:"res_type"`
ResName string `json:"res_name"`
ResId string `json:"res_id"`
AlertId string `json:"alert_id"`
AlertName string `json:"alert_name"`
ResType string `json:"res_type"`
ResName string `json:"res_name"`
ResId string `json:"res_id"`
AlertId string `json:"alert_id"`
StartTime *time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time"`
}

View File

@@ -14,7 +14,11 @@
package monitor
import "yunion.io/x/onecloud/pkg/apis"
import (
"time"
"yunion.io/x/onecloud/pkg/apis"
)
const (
SEND_STATE_OK = "ok"
@@ -41,8 +45,9 @@ type AlertRecordDetails struct {
apis.StatusStandaloneResourceDetails
apis.ScopedResourceBaseInfo
ResNum int64 `json:"res_num"`
AlertName string `json:"alert_name"`
ResNum int64 `json:"res_num"`
AlertName string `json:"alert_name"`
TriggerTime time.Time
}
type AlertRecordCreateInput struct {

View File

@@ -56,6 +56,8 @@ type CommonAlertCreateInput struct {
Channel []string `json:"channel"`
// 通知接受者
Recipients []string `json:"recipients"`
RobotIds []string `json:"robot_ids"`
// 静默期
SilentPeriod string `json:"silent_period"`
// 报警类型
@@ -101,6 +103,7 @@ type CommonAlertListInput struct {
Level string `json:"level"`
ResType []string `json:"res_type"`
UsedBy string `json:"used_by"`
Name string `json:"name"`
}
type CommonAlertUpdateInput struct {
@@ -132,6 +135,7 @@ type CommonAlertDetails struct {
NotifierId string `json:"notifier_id"`
Channel []string `json:"channel"`
Recipients []string `json:"recipients"`
RobotIds []string `json:"robot_ids"`
// 静默期
SilentPeriod string `json:"silent_period"`
Status string `json:"status"`

View File

@@ -29,6 +29,7 @@ const (
METRIC_RES_TYPE_TENANT = "tenant"
METRIC_RES_TYPE_DOMAIN = "domain"
METRIC_RES_TYPE_STORAGE = "storage"
METRIC_RES_TYPE_ELB = "elb"
//ext is prefix
METRIC_RES_TYPE_JENKINS = "ext_jenkins"
METRIC_RES_TYPE_EXT_MYSQL = "ext_mysql"

View File

@@ -42,11 +42,16 @@ type MonitorResourceListInput struct {
ResId []string `json:"res_id"`
ResType string `json:"res_type"`
OnlyResId bool `json:"only_res_id"`
ResName string `json:"res_name"`
}
type MonitorResourceDetails struct {
apis.VirtualResourceDetails
compute.CloudregionResourceInfo
compute.CloudaccountResourceInfo
Ips string `json:"ips"`
AccessIp string `json:"access_ip"`
AttachAlertCount int64 `json:"attach_alert_count"`
}

View File

@@ -30,6 +30,9 @@ type MonitorResourceJointListInput struct {
Alerting bool `json:"alertinng"`
SendState string `json:"send_state"`
ResType string `json:"res_type"`
ResName string `json:"res_name"`
AlertName string `json:"alert_name"`
Level string `json:"level"`
}
type MonitorResourceJointCreateInput struct {
@@ -44,10 +47,13 @@ type MonitorResourceJointCreateInput struct {
}
type MonitorResourceJointDetails struct {
ResName string `json:"res_name"`
ResType string `json:"res_type"`
AlertName string `json:"alert_name"`
AlertRule jsonutils.JSONObject `json:"alert_rule"`
Level string `json:"level"`
SendState string `json:"send_state"`
ResName string `json:"res_name"`
ResId string `json:"res_id"`
ResType string `json:"res_type"`
AlertName string `json:"alert_name"`
AlertRule jsonutils.JSONObject `json:"alert_rule"`
Level string `json:"level"`
SendState string `json:"send_state"`
State string `json:"state"`
IsSetShield bool `json:"is_set_shield"`
}

View File

@@ -78,8 +78,9 @@ type NotificationListInput struct {
}
type NotificationSettingOneCloud struct {
Channel string `json:"channel"`
UserIds []string `json:"user_ids"`
Channel string `json:"channel"`
UserIds []string `json:"user_ids"`
RobotIds []string `json:"robot_ids"`
}
type SendWebhookSync struct {

View File

@@ -106,6 +106,16 @@ const (
TOPIC_RESOURCE_ELASTICCACHE = "elasticcache"
TOPIC_RESOURCE_SCHEDULEDTASK = "scheduledtask"
TOPIC_RESOURCE_BAREMETAL = "baremetal"
TOPIC_RESOURCE_VPC = "vpc"
TOPIC_RESOURCE_DNSZONE = "dns_zone"
TOPIC_RESOURCE_NATGATEWAY = "natgateway"
TOPIC_RESOURCE_WEBAPP = "webapp"
TOPIC_RESOURCE_CDNDOMAIN = "cdn_domain"
TOPIC_RESOURCE_FILESYSTEM = "file_system"
TOPIC_RESOURCE_WAF = "waf_instance"
TOPIC_RESOURCE_KAFKA = "kafka"
TOPIC_RESOURCE_ELASTICSEARCH = "elastic_search"
TOPIC_RESOURCE_MONGODB = "mongodb"
SUBSCRIBER_TYPE_ROLE = "role"
SUBSCRIBER_TYPE_ROBOT = "robot"

View File

@@ -40,6 +40,10 @@ var (
ActionCreateBackupServer SAction = "add_backup_server"
ActionDelBackupServer SAction = "delete_backup_server"
ActionSyncCreate SAction = "sync_create"
ActionSyncUpdate SAction = "sync_update"
ActionSyncDelete SAction = "sync_delete"
ResultFailed SResult = "failed"
ResultSucceed SResult = "succeed"
)

View File

@@ -40,7 +40,7 @@ type ModelBaseDetails struct {
CanUpdate bool `json:"can_update"`
// 资源不能更新的原因
UpdateFailReason string `json:"update_fail_reason"`
UpdateFailReason httperrors.Error `json:"update_fail_reason"`
}
type ModelBaseShortDescDetail struct {
@@ -238,3 +238,9 @@ type StatusStatistic struct {
// 需要指定pending_delete=all
PendingDeletedCount int64 `json:"pending_deleted_count"`
}
type ProjectStatistic struct {
Count int
Id string
Name string
}

View File

@@ -32,4 +32,5 @@ const (
HUAWEI = "huawei"
APSARA = "apsara"
JDCLOUD = "jdcloud"
CLOUDPODS = "cloudpods"
)

View File

@@ -65,6 +65,7 @@ type Application struct {
isExiting bool
idleConnsClosed chan struct{}
httpServer *http.Server
slaveHttpServer *http.Server
}
const (
@@ -490,15 +491,16 @@ func (app *Application) ListenAndServeWithoutCleanup(addr, certFile, keyFile str
}
func (app *Application) ListenAndServeTLSWithCleanup2(addr string, certFile, keyFile string, onStop func(), isMaster bool) {
httpSrv := app.initServer(addr)
if isMaster {
app.addDefaultHandlers()
AddPProfHandler(app)
}
app.httpServer = app.initServer(addr)
if isMaster {
app.httpServer = httpSrv
app.registerCleanShutdown(app.httpServer, onStop)
} else {
app.slaveHttpServer = httpSrv
}
app.listenAndServeInternal(app.httpServer, certFile, keyFile)
app.listenAndServeInternal(httpSrv, certFile, keyFile)
if isMaster {
app.waitCleanShutdown()
}

View File

@@ -185,6 +185,7 @@ func (m *SBaremetalManager) CleanBaremetal(bmId string) {
func (m *SBaremetalManager) updateBaremetal(session *mcclient.ClientSession, bmId string) (jsonutils.JSONObject, error) {
params := jsonutils.NewDict()
params.Add(jsonutils.JSONTrue, "is_baremetal")
params.Add(jsonutils.JSONTrue, "not_sync_config")
obj, err := modules.Hosts.Put(session, bmId, params)
if err != nil {
return nil, err
@@ -2448,9 +2449,7 @@ func (s *SBaremetalServer) DoDiskConfig(term *ssh.Client) error {
}
}
tool := disktool.NewSSHPartitionTool(term)
tool.FetchDiskConfs(baremetal.GetDiskConfigurations(layouts))
err = tool.RetrieveDiskInfo()
tool, err := disktool.NewSSHPartitionTool(term, layouts)
if err != nil {
return err
}
@@ -2458,6 +2457,7 @@ func (s *SBaremetalServer) DoDiskConfig(term *ssh.Client) error {
for tried := 0; !tool.IsAllDisksReady() && tried < maxTries; tried++ {
time.Sleep(5 * time.Second)
tool.RetrieveDiskInfo()
log.Warningf("disktool not ready string: %s", tool.DebugString())
}
if !tool.IsAllDisksReady() {
@@ -2528,11 +2528,9 @@ func (s *SBaremetalServer) DoPartitionDisk(term *ssh.Client) ([]*disktool.Partit
return nil, errors.Wrapf(err, "CalculateLayout")
}
tool := disktool.NewSSHPartitionTool(term)
tool.FetchDiskConfs(baremetal.GetDiskConfigurations(layouts))
err = tool.RetrieveDiskInfo()
tool, err := disktool.NewSSHPartitionTool(term, layouts)
if err != nil {
return nil, errors.Wrapf(err, "RetrieveDiskInfo")
return nil, errors.Wrapf(err, "NewSSHPartitionTool")
}
disks, _ := s.desc.GetArray("disks")
@@ -2605,9 +2603,7 @@ func (s *SBaremetalServer) DoRebuildRootDisk(term *ssh.Client) ([]*disktool.Part
return nil, err
}
tool := disktool.NewSSHPartitionTool(term)
tool.FetchDiskConfs(baremetal.GetDiskConfigurations(layouts))
err = tool.RetrieveDiskInfo()
tool, err := disktool.NewSSHPartitionTool(term, layouts)
if err != nil {
return nil, err
}
@@ -2663,7 +2659,13 @@ func (s *SBaremetalServer) DoRebuildRootDisk(term *ssh.Client) ([]*disktool.Part
func (s *SBaremetalServer) SyncPartitionSize(term *ssh.Client, parts []*disktool.Partition) ([]jsonutils.JSONObject, error) {
disks, _ := s.desc.GetArray("disks")
// calculate root partitions count
rootPartsCnt := len(parts) - len(disks) + 1
if len(parts) < len(disks) {
// HACK: rebuild root disk
rootPartsCnt = len(parts)
}
rootParts := parts[0:rootPartsCnt]
dataParts := parts[rootPartsCnt:]
idx := 0
@@ -2722,7 +2724,58 @@ func (s *SBaremetalServer) deployFs(term *ssh.Client, deployInfo *deployapi.Depl
if strings.ToLower(rootfs.GetOs()) == "windows" {
return nil, fmt.Errorf("Unsupported OS: %s", rootfs.GetOs())
}
return guestfs.DeployGuestFs(rootfs, s.desc, deployInfo)
desc, err := deployapi.GuestDescToDeployDesc(s.desc)
if err != nil {
return nil, errors.Wrap(err, "To deploy desc fail")
}
desc, err = s.reIndexDescNics(term, desc)
if err != nil {
return nil, errors.Wrap(err, "reIndexDescNics")
}
return guestfs.DeployGuestFs(rootfs, desc, deployInfo)
}
func (s *SBaremetalServer) reIndexDescNics(term *ssh.Client, desc *deployapi.GuestDesc) (*deployapi.GuestDesc, error) {
rNics, err := tasks.GetNicsInfo(term)
if err != nil {
return nil, errors.Wrapf(err, "Get server %s remote nics", s.GetName())
}
findRemoteNic := func(mac string) (int, *types.SNicDevInfo) {
for idx, nic := range rNics {
if nic.Mac.String() == mac {
return idx, rNics[idx]
}
}
return -1, nil
}
reIndexNics := func(nics []*deployapi.Nic) ([]*deployapi.Nic, error) {
for idx, nic := range nics {
if nic.GetNicType() == api.NIC_TYPE_IPMI {
continue
}
rIdx, rNic := findRemoteNic(nic.GetMac())
if rNic == nil {
return nil, errors.Errorf("Not found remote nic by mac %q", nic.GetMac())
}
if nics[idx].Index != int32(rIdx) {
log.Infof("Reindex nic %s index %d to %d", nics[idx].GetMac(), nics[idx].Index, rIdx)
nics[idx].Index = int32(rIdx)
}
}
return nics, nil
}
nics, err := reIndexNics(desc.Nics)
if err != nil {
return nil, errors.Wrap(err, "Reindex nics")
}
desc.Nics = nics
sNics, err := reIndexNics(desc.NicsStandby)
if err != nil {
return nil, errors.Wrap(err, "Reindex standby nics")
}
desc.NicsStandby = sNics
return desc, nil
}
func (s *SBaremetalServer) GetNics() []types.SServerNic {

View File

@@ -36,6 +36,7 @@ type BaremetalOptions struct {
TftpMaxTimeoutRetries int `default:"50" help:"Maximal tftp timeout retries, default is 50"`
LengthyWorkerCount int `default:"8" help:"Parallel worker count for lengthy tasks"`
ShortWorkerCount int `default:"8" help:"Parallel worker count for short-lived tasks"`
TaskWorkerCount int `default:"32" help:"Parallel worker count for tasks"`
DefaultIpmiPassword string `help:"Default IPMI passowrd"`
DefaultStrongIpmiPassword string `help:"Default strong IPMI passowrd"`

View File

@@ -79,6 +79,7 @@ func (h *DHCPHandler) ServeDHCP(pkt dhcp.Packet, _ *net.UDPAddr, _ *net.Interfac
if req.RelayAddr.String() == "0.0.0.0" {
return nil, nil, fmt.Errorf("Request not from a DHCP relay, ignore mac: %s", req.ClientMac)
}
log.Infof("[DHCP] from relay %s packet, mac: %s", req.RelayAddr, req.ClientMac)
conf, targets, err := req.fetchConfig(h.baremetalManager.GetClientSession())
if err != nil {
return nil, nil, err
@@ -188,7 +189,7 @@ func (req *dhcpRequest) fetchConfig(session *mcclient.ClientSession) (*dhcp.Resp
if len(netConf.GuestDhcp) > 0 {
dhcpAddrList = strings.Split(netConf.GuestDhcp, ",")
}
log.Debugf("dhcpAddrList %s", dhcpAddrList)
log.Debugf("find network config %#v, dhcpAddrList %s", netConf, dhcpAddrList)
// TODO: set cache for netConf
if req.isPXERequest() {
@@ -227,6 +228,7 @@ func (req *dhcpRequest) fetchConfig(session *mcclient.ClientSession) (*dhcp.Resp
// from guestdhcp import GuestDHCPHelperTask
// task = GuestDHCPHelperTask(self)
// task.start()
log.Infof("Not found baremetal by mac: %s", req.ClientMac)
return nil, nil, nil
}
req.baremetalInstance = bmInstance

View File

@@ -670,6 +670,10 @@ func getDMIMemInfo(cli *ssh.Client) (*types.SDMIMemInfo, error) {
return sysutils.ParseDMIMemInfo(ret), nil
}
func GetNicsInfo(cli *ssh.Client) ([]*types.SNicDevInfo, error) {
return getNicsInfo(cli)
}
func getNicsInfo(cli *ssh.Client) ([]*types.SNicDevInfo, error) {
ret, err := cli.Run("/lib/mos/lsnic")
if err != nil {

View File

@@ -24,16 +24,16 @@ import (
"yunion.io/x/log"
"yunion.io/x/onecloud/pkg/appsrv"
"yunion.io/x/onecloud/pkg/baremetal/options"
"yunion.io/x/onecloud/pkg/mcclient/modules"
)
var baremetalTaskWorkerMan *appsrv.SWorkerManager
func init() {
baremetalTaskWorkerMan = appsrv.NewWorkerManager("BaremetalTaskWorkerManager", 8, 1024, false)
}
func GetWorkManager() *appsrv.SWorkerManager {
if baremetalTaskWorkerMan == nil {
baremetalTaskWorkerMan = appsrv.NewWorkerManager("BaremetalTaskWorkerManager", options.Options.TaskWorkerCount, 1024, false)
}
return baremetalTaskWorkerMan
}
@@ -62,7 +62,7 @@ func ExecuteTask(task ITask, args interface{}) {
task: task,
args: args,
}
baremetalTaskWorkerMan.Run(t, nil, nil)
GetWorkManager().Run(t, nil, nil)
}
func executeTask(task ITask, args interface{}) {

View File

@@ -18,6 +18,7 @@ import (
"fmt"
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/onecloud/pkg/baremetal/utils/raid"
@@ -91,7 +92,7 @@ func DetectStorageInfo(term raid.IExecTerm, wait bool) ([]*baremetal.BaremetalSt
break
}
}
log.Infof("RaidDiskInfo: %#v, NonRaidSCSIDiskInfo: %#v, PCIEDiskInfo: %#v", raidDiskInfo, nonRaidDiskInfo, pcieDiskInfo)
log.Infof("RaidDiskInfo: %s, NonRaidSCSIDiskInfo: %s, PCIEDiskInfo: %s", jsonutils.Marshal(raidDiskInfo), jsonutils.Marshal(nonRaidDiskInfo), jsonutils.Marshal(pcieDiskInfo))
if len(nonRaidDiskInfo) < len(lvDiskInfo) {
return nil, nil, nil, fmt.Errorf("Fail to retrieve disk info")
}

View File

@@ -288,7 +288,7 @@ func (ps *DiskPartitions) String() string {
func (ps *DiskPartitions) DebugString() string {
partitionsStr := []string{}
for _, p := range ps.partitions {
partitionsStr = append(partitionsStr, fmt.Sprintf("%#v", *p))
partitionsStr = append(partitionsStr, fmt.Sprintf("{%#v}", *p))
}
return fmt.Sprintf("driver: %s, dev: %s, sectors: %d, partitions: %#v", ps.driver, ps.dev, ps.sectors, partitionsStr)
}
@@ -599,7 +599,7 @@ func (tool *PartitionTool) DebugString() string {
return ret
}
for driver, disks := range tool.diskTable {
s := fmt.Sprintf("%s: %v", driver, disksString(disks))
s := fmt.Sprintf("(%s: %v)", driver, disksString(disks))
ret = append(ret, s)
}
return strings.Join(ret, "\n")
@@ -753,7 +753,7 @@ type SSHPartitionTool struct {
term *ssh.Client
}
func NewSSHPartitionTool(term *ssh.Client) *SSHPartitionTool {
func newSSHPartitionTool(term *ssh.Client) *SSHPartitionTool {
tool := &SSHPartitionTool{
term: term,
}
@@ -761,6 +761,15 @@ func NewSSHPartitionTool(term *ssh.Client) *SSHPartitionTool {
return tool
}
func NewSSHPartitionTool(term *ssh.Client, layouts []baremetal.Layout) (*SSHPartitionTool, error) {
tool := newSSHPartitionTool(term)
tool.FetchDiskConfs(baremetal.GetDiskConfigurations(layouts))
if err := tool.RetrieveDiskInfo(); err != nil {
return nil, errors.Wrapf(err, "RetrieveDiskInfo")
}
return tool, nil
}
func (tool *SSHPartitionTool) Run(cmds ...string) ([]string, error) {
return tool.term.Run(cmds...)
}

View File

@@ -0,0 +1,655 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package adaptec
import (
"fmt"
"regexp"
"strconv"
"strings"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/tristate"
"yunion.io/x/pkg/util/stringutils"
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/baremetal/utils/raid"
"yunion.io/x/onecloud/pkg/compute/baremetal"
"yunion.io/x/onecloud/pkg/util/regutils2"
)
func init() {
raid.RegisterDriver(api.DISK_DRIVER_ADAPTECRAID, NewAdaptecRaid)
}
const (
ControllerModeRaidExposeRaw = "RAID (Expose RAW)"
ControllerModeRaidHideRaw = "RAID (Hide RAW)"
ControllerModeMixed = "Mixed"
)
type AdaptecRaid struct {
term raid.IExecTerm
adapters []*AdaptecRaidAdaptor
}
func NewAdaptecRaid(term raid.IExecTerm) raid.IRaidDriver {
return &AdaptecRaid{
term: term,
adapters: make([]*AdaptecRaidAdaptor, 0),
}
}
func GetCommand(args ...string) string {
bin := "/opt/adaptec/arcconf"
return raid.GetCommand(bin, args...)
}
func (r *AdaptecRaid) GetName() string {
return baremetal.DISK_DRIVER_ADAPTECRAID
}
func (r *AdaptecRaid) ParsePhyDevs() error {
cmd := GetCommand("LIST")
ret, err := r.term.Run(cmd)
if err != nil {
return errors.Wrap(err, "list controllers")
}
if err := r.parsePhyDevs(ret); err != nil {
return errors.Wrap(err, "parse physical device")
}
if len(r.adapters) == 0 {
return errors.Errorf("Not found adaptec raid controller")
}
return nil
}
func (r *AdaptecRaid) CleanRaid() error {
for _, ada := range r.adapters {
ada.removeJBODDisks()
ada.RemoveLogicVolumes()
}
return nil
}
func (r *AdaptecRaid) GetAdapters() []raid.IRaidAdapter {
ret := make([]raid.IRaidAdapter, 0)
for _, a := range r.adapters {
ret = append(ret, a)
}
return ret
}
func (r *AdaptecRaid) PreBuildRaid(confs []*api.BaremetalDiskConfig, adapterIdx int) error {
return nil
}
var (
adaptorIDPatter = regexp.MustCompile(`Controller (?P<idx>[0-9]+):`)
)
func getAdaptorIndex(line string) int {
adapStr := regutils2.GetParams(adaptorIDPatter, line)["idx"]
if adapStr == "" {
return -1
}
adapInt, err := strconv.Atoi(adapStr)
if err != nil {
log.Errorf("Parse adapator string %q id error: %v", line, err)
return -1
}
return adapInt
}
func (r *AdaptecRaid) parsePhyDevs(lines []string) error {
for _, line := range lines {
index := getAdaptorIndex(line)
if index == -1 {
continue
}
ada, err := NewAdaptecRaidAdaptor(index, r)
if err != nil {
return errors.Wrapf(err, "New raid adaptor %d", index)
}
r.adapters = append(r.adapters, ada)
}
return nil
}
type AdaptecRaidAdaptor struct {
*adaptorInfo
index int
raid *AdaptecRaid
devs []*AdaptecRaidPhyDev
}
var (
_ raid.IRaidAdapter = new(AdaptecRaidAdaptor)
)
func NewAdaptecRaidAdaptor(index int, raid *AdaptecRaid) (*AdaptecRaidAdaptor, error) {
adaptor := AdaptecRaidAdaptor{
index: index,
raid: raid,
}
if err := adaptor.fillInfo(); err != nil {
return nil, errors.Wrapf(err, "fill adaptor %d info", adaptor.index)
}
if err := adaptor.fillDevices(); err != nil {
return nil, errors.Wrap(err, "fill physical devices")
}
/*
* if !adaptor.isRaidHideRawMode() {
* if err := adaptor.setControllerModeRaidHideRaw(); err != nil {
* return nil, errors.Wrap(err, "set controller mode to raid hide raw")
* }
* }
*/
return &adaptor, nil
}
func (ada *AdaptecRaidAdaptor) GetIndex() int {
return ada.index
}
func (ada *AdaptecRaidAdaptor) PreBuildRaid(confs []*api.BaremetalDiskConfig) error {
if !ada.isRaidHideRawMode() {
if err := ada.setControllerModeRaidHideRaw(); err != nil {
return errors.Wrapf(err, "set controller mode to raid hide raw mode")
}
}
if err := ada.removeJBODDisks(); err != nil {
log.Warningf("remove all JBOD disks: %v", err)
}
// uninitialize all device to ready state
if err := ada.uninitializeAllDevice(); err != nil {
// return errors.Wrap(err, "uninitialize all devices")
log.Warningf("uninitializeAllDevice error: %v", err)
}
return nil
}
func (ada *AdaptecRaidAdaptor) getInitializeCmd(args ...string) string {
newArgs := []string{"TASK", "START", fmt.Sprintf("%d", ada.GetIndex()), "DEVICE"}
newArgs = append(newArgs, args...)
newArgs = append(newArgs, "INITIALIZE", "noprompt")
return GetCommand(newArgs...)
}
func (ada *AdaptecRaidAdaptor) initializeDevice(channel string, id string) error {
cmd := ada.getInitializeCmd(channel, id)
_, err := ada.remoteRun(fmt.Sprintf("initialize device %s:%s", channel, id), cmd)
if err != nil {
return err
}
return nil
}
func (ada *AdaptecRaidAdaptor) initializeAllDevice() error {
cmd := ada.getInitializeCmd("ALL")
_, err := ada.remoteRun("initialize all device", cmd)
if err != nil {
return err
}
return nil
}
func (ada *AdaptecRaidAdaptor) uninitializeDevice(channel string, id string) error {
cmd := ada.getUninitializeCmd(channel, id)
_, err := ada.remoteRun(fmt.Sprintf("uninitialize device %s:%s", channel, id), cmd)
if err != nil {
return err
}
return nil
}
func (ada *AdaptecRaidAdaptor) getUninitializeCmd(args ...string) string {
newArgs := []string{"TASK", "START", fmt.Sprintf("%d", ada.GetIndex()), "DEVICE"}
newArgs = append(newArgs, args...)
newArgs = append(newArgs, "UNINITIALIZE", "noprompt")
return GetCommand(newArgs...)
}
func (ada *AdaptecRaidAdaptor) uninitializeAllDevice() error {
cmd := ada.getUninitializeCmd("ALL")
_, err := ada.remoteRun("uninitialize all devices", cmd)
if err != nil {
return err
}
return nil
}
func (ada *AdaptecRaidAdaptor) getTerm() raid.IExecTerm {
return ada.raid.term
}
func (ada *AdaptecRaidAdaptor) remoteRun(hint string, cmd string) ([]string, error) {
out, err := ada.getTerm().Run(cmd)
if err != nil {
return out, errors.Wrapf(err, "%q, out: %v", hint, out)
}
log.Debugf("remote run cmd %s %q successfully: %v", hint, cmd, out)
return out, nil
}
func (ada *AdaptecRaidAdaptor) fillInfo() error {
cmd := GetCommand("GETCONFIG", fmt.Sprintf("%d", ada.index), "AD")
ret, err := ada.remoteRun("get AD config", cmd)
if err != nil {
return err
}
info, err := getAdaptorInfo(ret)
if err != nil {
return errors.Wrap(err, "get adaptor info")
}
ada.adaptorInfo = info
return nil
}
func (ada *AdaptecRaidAdaptor) fillDevices() error {
cmd := GetCommand("GETCONFIG", fmt.Sprintf("%d", ada.index), "PD")
ret, err := ada.remoteRun("get PD config", cmd)
if err != nil {
return err
}
devs := getPhyDevices(ada.GetIndex(), ret)
ada.devs = append(ada.devs, devs...)
return nil
}
func getPhyDevices(adapter int, lines []string) []*AdaptecRaidPhyDev {
dev := newPhyDev(adapter)
devs := make([]*AdaptecRaidPhyDev, 0)
for _, line := range lines {
if dev.parseLine(line) && dev.isComplete() {
tmpDev := dev
devs = append(devs, tmpDev)
dev = newPhyDev(adapter)
}
}
return devs
}
func (ada *AdaptecRaidAdaptor) getChannelId(storage *baremetal.BaremetalStorage) (string, string, error) {
if storage.Addr == "" {
return "", "", errors.Errorf("storage %#v addr is empty", storage)
}
parts := strings.Split(storage.Addr, ":")
if len(parts) != 2 {
return "", "", errors.Errorf("invalid storage %#v addr %q", storage, storage.Addr)
}
return parts[0], parts[1], nil
}
func (ada *AdaptecRaidAdaptor) getCreateCmd(args ...string) string {
newArgs := []string{"CREATE", fmt.Sprintf("%d", ada.GetIndex())}
newArgs = append(newArgs, args...)
return GetCommand(newArgs...)
}
// setControllerMode change adapter controller's mode
// Controller Modes : 0 - RAID: Expose RAW
// : 1 - Auto Volume Mode
// : 2 - HBA Mode
// : 3 - RAID: Hide RAW
// : 4 - Simple Volume Mode
// : 5 - Mixed
func (ada *AdaptecRaidAdaptor) setControllerMode(mode int) error {
cmd := GetCommand("SETCONTROLLERMODE", fmt.Sprintf("%d", ada.GetIndex()), fmt.Sprintf("%d", mode), "noprompt")
if _, err := ada.remoteRun(fmt.Sprintf("set controller mode to %d", mode), cmd); err != nil {
return err
}
return nil
}
func (ada *AdaptecRaidAdaptor) setControllerModeRaidExposeRaw() error {
if err := ada.setControllerMode(0); err != nil {
return errors.Wrap(err, "mode raid expose raw")
}
return nil
}
func (ada *AdaptecRaidAdaptor) setControllerModeRaidHideRaw() error {
if err := ada.setControllerMode(3); err != nil {
return errors.Wrap(err, "mode raid hide raw")
}
return nil
}
func (ada *AdaptecRaidAdaptor) setControllerModeMixed() error {
if err := ada.setControllerMode(5); err != nil {
return errors.Wrap(err, "mode mixed")
}
return nil
}
func (ada *AdaptecRaidAdaptor) buildJBOD(dev *baremetal.BaremetalStorage) error {
channel, id, err := ada.getChannelId(dev)
if err != nil {
return errors.Wrap(err, "get channel and id")
}
cmd := ada.getCreateCmd("JBOD", channel, id, "noprompt")
if out, err := ada.remoteRun("create JBOD", cmd); err != nil {
return errors.Wrapf(err, "run cmd %q, out: %q", cmd, out)
}
return nil
}
func (ada *AdaptecRaidAdaptor) buildNonRaid(dev *baremetal.BaremetalStorage) error {
// set to raid expose raw mode or mixed mode
if !ada.isRaidExposeRawMode() && !ada.isMixedMode() {
err := func() error {
errs := []error{}
if err := ada.setControllerModeRaidExposeRaw(); err != nil {
errs = append(errs, err)
} else {
return nil
}
if err := ada.setControllerModeMixed(); err != nil {
errs = append(errs, err)
} else {
return nil
}
return errors.NewAggregate(errs)
}()
if err != nil {
return errors.Wrap(err, "set raid to expose raw or mixed mode")
}
}
// try build JBOD firstly
if err := ada.buildJBOD(dev); err != nil {
log.Warningf("try build JBOD error: %v", err)
} else {
return nil
}
// just uninitialize device when build JBOD fail
channel, id, err := ada.getChannelId(dev)
if err != nil {
return err
}
if err := ada.uninitializeDevice(channel, id); err != nil {
return errors.Wrapf(err, "uninitialize device %v when build jbod fail", dev)
}
return nil
}
func (ada *AdaptecRaidAdaptor) BuildNoneRaid(devs []*baremetal.BaremetalStorage) error {
for _, dev := range devs {
if err := ada.buildNonRaid(dev); err != nil {
return errors.Wrap(err, "build nonraid")
}
}
return nil
}
func (ada *AdaptecRaidAdaptor) getBuildRaidCmd(level int, devs []*baremetal.BaremetalStorage) (string, error) {
if len(devs) == 0 {
return "", errors.Errorf("devices is empty")
}
args := []string{"LOGICALDRIVE", "MAX", fmt.Sprintf("%d", level)}
chIds := []string{}
for _, dev := range devs {
ch, id, err := ada.getChannelId(dev)
if err != nil {
return "", errors.Wrapf(err, "get device %v channel id", dev)
}
chIds = append(chIds, ch, id)
}
args = append(args, chIds...)
cmd := ada.getCreateCmd(args...)
return cmd, nil
}
func (ada *AdaptecRaidAdaptor) buildRaid(level int, devs []*baremetal.BaremetalStorage, conf *api.BaremetalDiskConfig) error {
// initialize each devs
for _, dev := range devs {
channel, id, err := ada.getChannelId(dev)
if err != nil {
return errors.Wrapf(err, "get device %v channel id", dev)
}
if err := ada.initializeDevice(channel, id); err != nil {
// return errors.Wrapf(err, "initialize device")
log.Warningf("initialize device error: %v", err)
}
}
// TODO: support config to build raid params
cmd, err := ada.getBuildRaidCmd(level, devs)
if err != nil {
return err
}
_, err = ada.remoteRun(fmt.Sprintf("build raid %d", level), cmd)
return err
}
func (ada *AdaptecRaidAdaptor) BuildRaid0(devs []*baremetal.BaremetalStorage, conf *api.BaremetalDiskConfig) error {
return ada.buildRaid(0, devs, conf)
}
func (ada *AdaptecRaidAdaptor) BuildRaid1(devs []*baremetal.BaremetalStorage, conf *api.BaremetalDiskConfig) error {
return ada.buildRaid(1, devs, conf)
}
func (ada *AdaptecRaidAdaptor) BuildRaid5(devs []*baremetal.BaremetalStorage, conf *api.BaremetalDiskConfig) error {
return ada.buildRaid(5, devs, conf)
}
func (ada *AdaptecRaidAdaptor) BuildRaid10(devs []*baremetal.BaremetalStorage, conf *api.BaremetalDiskConfig) error {
return ada.buildRaid(10, devs, conf)
}
func (ada *AdaptecRaidAdaptor) GetDevices() []*baremetal.BaremetalStorage {
ret := []*baremetal.BaremetalStorage{}
for idx, dev := range ada.devs {
ret = append(ret, dev.ToBaremetalStorage(idx))
}
return ret
}
func (ada *AdaptecRaidAdaptor) GetLogicVolumes() ([]*raid.RaidLogicalVolume, error) {
cmd := GetCommand("GETCONFIG", fmt.Sprintf("%d", ada.index), "LD")
ret, err := ada.remoteRun("get logic volumes", cmd)
if err != nil {
return nil, fmt.Errorf("Get logic volumes error: %v", err)
}
return getLogicalVolumes(ada.index, ret)
}
func getLogicalVolumes(adapter int, lines []string) ([]*raid.RaidLogicalVolume, error) {
lvs := make([]*raid.RaidLogicalVolume, 0)
for _, line := range lines {
m := regutils2.SubGroupMatch(`Logical Device number\s+(?P<idx>\d+)`, line)
if len(m) > 0 {
idxStr := m["idx"]
idx, err := strconv.Atoi(idxStr)
if err != nil {
return nil, errors.Errorf("%s index str is not digit: %v", idxStr, err)
}
lvs = append(lvs, &raid.RaidLogicalVolume{
Index: idx,
Adapter: adapter,
})
}
}
return lvs, nil
}
func (ada *AdaptecRaidAdaptor) removeJBODDisks() error {
cmd := GetCommand("DELETE", fmt.Sprintf("%d", ada.index), "JBOD", "ALL", "noprompt")
out, err := ada.remoteRun("delete JBOD disks", cmd)
if err != nil {
return errors.Wrapf(err, "delete all JBOD output: %q", out)
}
return nil
}
func (ada *AdaptecRaidAdaptor) RemoveLogicVolumes() error {
lvs, err := ada.GetLogicVolumes()
if err != nil {
return errors.Wrap(err, "get logic volumes")
}
if len(lvs) == 0 {
return nil
}
cmd := GetCommand("DELETE", fmt.Sprintf("%d", ada.index), "LOGICALDRIVE", "ALL", "noprompt")
out, err := ada.remoteRun("delete logical volumes", cmd)
if err != nil {
return errors.Wrapf(err, "delete all logicaldrive output: %q", out)
}
return nil
}
type adaptorInfo struct {
status string
mode string
name string
sn string
wwn string
slot string
}
func (ada *adaptorInfo) key() string {
return ada.name + ada.sn
}
func (ada *adaptorInfo) isRaidExposeRawMode() bool {
return ada.mode == ControllerModeRaidExposeRaw
}
func (ada *adaptorInfo) isRaidHideRawMode() bool {
return ada.mode == ControllerModeRaidHideRaw
}
func (ada *adaptorInfo) isMixedMode() bool {
return ada.mode == ControllerModeMixed
}
func getAdaptorInfo(lines []string) (*adaptorInfo, error) {
ada := new(adaptorInfo)
for _, l := range lines {
key, val := stringutils.SplitKeyValue(l)
if len(key) == 0 {
continue
}
switch key {
case "Controller Status":
ada.status = val
case "Controller Mode":
ada.mode = val
case "Controller Model":
ada.name = val
case "Controller Serial Number":
ada.sn = val
case "Controller World Wide Name":
ada.wwn = val
case "Physical Slot":
ada.slot = val
}
}
if len(ada.key()) == 0 {
return nil, errors.Errorf("Not found SN and model name")
}
return ada, nil
}
type AdaptecRaidPhyDev struct {
*raid.RaidBasePhyDev
// channelId and deviceId is parsed by Reported Channel,Device(T:L)
// e.g.: Reported Channel,Device(T:L) : 0,6(6:0)
channelId string
deviceId string
}
func newPhyDev(adapter int) *AdaptecRaidPhyDev {
dev := &AdaptecRaidPhyDev{
RaidBasePhyDev: raid.NewRaidBasePhyDev(api.DISK_DRIVER_ADAPTECRAID),
}
dev.Adapter = adapter
return dev
}
func (dev *AdaptecRaidPhyDev) isComplete() bool {
if !dev.RaidBasePhyDev.IsComplete() {
return false
}
if dev.channelId == "" || dev.deviceId == "" {
return false
}
return true
}
func (dev *AdaptecRaidPhyDev) ToBaremetalStorage(index int) *baremetal.BaremetalStorage {
s := dev.RaidBasePhyDev.ToBaremetalStorage(index)
s.Addr = fmt.Sprintf("%s:%s", dev.channelId, dev.deviceId)
return s
}
var (
channelDeviceRegexp = regexp.MustCompile(`Reported Channel,Device\(T:L\).*(?P<channel>\d+),(?P<device>\d+)\(\d+:\d+\)`)
)
func (dev *AdaptecRaidPhyDev) parseLine(line string) bool {
chanDevMatch := regutils2.GetParams(channelDeviceRegexp, line)
if len(chanDevMatch) != 0 {
channelId := chanDevMatch["channel"]
deviceId := chanDevMatch["device"]
dev.channelId = channelId
dev.deviceId = deviceId
return true
}
key, val := stringutils.SplitKeyValue(line)
if key == "" {
return false
}
switch key {
case "Total Size":
dat := strings.Split(val, " ")
szStr, unitStr := dat[0], dat[1]
var sz int64
szInt, err := strconv.Atoi(szStr)
if err != nil {
log.Errorf("Parse size string %s: %v", szStr, err)
return false
}
switch unitStr {
case "GB":
sz = int64(szInt * 1000 * 1000 * 100)
case "TB":
sz = int64(szInt * 1000 * 1000 * 1000 * 1000)
case "MB":
sz = int64(szInt * 1000 * 1000)
default:
log.Errorf("Unsupported unit: %s", unitStr)
return false
}
dev.Size = sz / 1024 / 1024
case "Model":
dev.Model = strings.Join(regexp.MustCompile(`\s+`).Split(val, -1), " ")
case "State":
dev.Status = val
case "SSD":
if val == "No" {
dev.Rotate = tristate.True
} else {
dev.Rotate = tristate.False
}
default:
return false
}
return true
}

View File

@@ -0,0 +1,422 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package adaptec
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func Test_getAdaptorIndex(t *testing.T) {
tests := []struct {
name string
args string
want int
}{
{
name: "Controllers found: 1",
args: "Controllers found: 1",
want: -1,
},
{
name: " Controller 1: : Optimal, Slot 4, RAID (Expose RAW), Adaptec ASR8805, 6A2263667CA, 50000D1701B47780",
args: " Controller 1: : Optimal, Slot 4, RAID (Expose RAW), Adaptec ASR8805, 6A2263667CA, 50000D1701B47780",
want: 1,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := getAdaptorIndex(tt.args); got != tt.want {
t.Errorf("getAdaptorIndex() = %v, want %v", got, tt.want)
}
})
}
}
func Test_getAdaptorInfo(t *testing.T) {
input := `Controllers found: 1
----------------------------------------------------------------------
Controller information
----------------------------------------------------------------------
Controller Status : Optimal
Controller Mode : RAID (Expose RAW)
Channel description : SAS/SATA
Controller Model : Adaptec ASR8805
Controller Serial Number : 6A2263667CA
Controller World Wide Name : 50000D1701B47780
Controller Alarm : Disabled
Physical Slot : 4
Temperature : 42 C/ 107 F (Normal)
Installed memory : 1024 MB
Host bus type : PCIe
Host bus speed : 8000 MHz
Host bus link width : 8 bit(s)/link(s)
Global task priority : High
Performance Mode : Default/Dynamic
PCI Device ID : 653
Stayawake period : Disabled
Spinup limit internal drives : 0
Spinup limit external drives : 0
Defunct disk drive count : 0
NCQ status : Enabled
Statistics data collection mode : Disabled
Monitor Log Severity Level : Informational
Global Max SAS Phy Link Rate : 12 Gbps
Verify Write Setting : Not Applicable
Save Custom Defaults Setting : Disabled
Smart Poll : Enabled
Error Tunable Profile : Normal
--------------------------------------------------------
Cache Properties
--------------------------------------------------------
Controller Cache Preservation : Disabled
Global Physical Device Write Cache Policy: Drive Specific
--------------------------------------------------------
RAID Properties
--------------------------------------------------------
Logical devices/Failed/Degraded : 0/0/0
Copyback : Disabled
Automatic Failover : Enabled
Background consistency check : Disabled
Background consistency check period : 0
--------------------------------------------------------
Controller BIOS Setting Information
--------------------------------------------------------
Runtime BIOS : Enabled
Array BBS Support : Disabled
Physical Drives Displayed during POST : Disabled
Backplane Mode : IBPI
BIOS Halt on Missing Drive Count : 255
--------------------------------------------------------
Controller Version Information
--------------------------------------------------------
BIOS : 7.18-0 (33556)
Firmware : 7.18-0 (33556)
Driver : 1.2-1 (50983)
Boot Flash : 7.18-0 (33556)
CPLD (Load version/ Flash version) : 8/ 11
SEEPROM (Load version/ Flash version) : 1/ 1
FCT Custom Init String Version : 0x0
--------------------------------------------------------
Controller Cache Backup Unit Information
--------------------------------------------------------
Overall Backup Unit Status : Not Present
--------------------------------------------------------
Connector information
--------------------------------------------------------
Connector #0
Connector Name : CN0
--------------------------------------
Lane Information
--------------------------------------
Lane #0
Channel ID : 0
Device ID : 0
SAS Address : 50000D1701B47780
PHY Identifier : 3
-----------------------------------
Lane SAS Phy Information
-----------------------------------
SAS Address : 50000D1701B47780
Lane #1
Channel ID : 0
Device ID : 1
SAS Address : 50000D1701B47780
PHY Identifier : 2
-----------------------------------
Lane SAS Phy Information
-----------------------------------
SAS Address : 50000D1701B47780
Lane #2
Channel ID : 0
Device ID : 2
SAS Address : 50000D1701B47780
PHY Identifier : 0
-----------------------------------
Lane SAS Phy Information
-----------------------------------
SAS Address : 50000D1701B47780
Lane #3
Channel ID : 0
Device ID : 3
SAS Address : 50000D1701B47780
PHY Identifier : 1
-----------------------------------
Lane SAS Phy Information
-----------------------------------
SAS Address : 50000D1701B47780
Connector #1
Connector Name : CN1
--------------------------------------
Lane Information
--------------------------------------
Lane #0
Channel ID : 0
Device ID : 4
SAS Address : 50000D1701B47780
PHY Identifier : 5
-----------------------------------
Lane SAS Phy Information
-----------------------------------
SAS Address : 50000D1701B47780
Lane #1
Channel ID : 0
Device ID : 5
SAS Address : 50000D1701B47780
PHY Identifier : 6
-----------------------------------
Lane SAS Phy Information
-----------------------------------
SAS Address : 50000D1701B47780
Lane #2
Channel ID : 0
Device ID : 6
SAS Address : 50000D1701B47780
PHY Identifier : 4
-----------------------------------
Lane SAS Phy Information
-----------------------------------
SAS Address : 50000D1701B47780
Attached PHY Identifier : 0
Attached SAS Address : 5000C50077893141
Negotiated Logical Link Rate : PHY enabled - 6 Gbps
Lane #3
Channel ID : 0
Device ID : 7
SAS Address : 50000D1701B47780
PHY Identifier : 7
-----------------------------------
Lane SAS Phy Information
-----------------------------------
SAS Address : 50000D1701B47780
Attached PHY Identifier : 0
Attached SAS Address : 50000395B839D9AE
Negotiated Logical Link Rate : PHY enabled - 6 Gbps
Command completed successfully.`
lines := strings.Split(input, "\n")
info, err := getAdaptorInfo(lines)
if err != nil {
t.Errorf("getAdaptorInfo: %v", err)
}
assert := assert.New(t)
assert.Equal("Optimal", info.status)
assert.Equal("RAID (Expose RAW)", info.mode)
assert.Equal(true, info.isRaidExposeRawMode(), "should be raid expose raw mode")
assert.Equal("Adaptec ASR8805", info.name)
assert.Equal("6A2263667CA", info.sn)
assert.Equal("50000D1701B47780", info.wwn)
assert.Equal("4", info.slot)
}
func Test_getPhyDevices(t *testing.T) {
input := `Controllers found: 1
----------------------------------------------------------------------
Physical Device information
----------------------------------------------------------------------
Device #0
Device is a Hard drive
State : Online
Block Size : 512 Bytes
Supported : Yes
Programmed Max Speed : SAS 6.0 Gb/s
Transfer Speed : SAS 6.0 Gb/s
Reported Channel,Device(T:L) : 0,6(6:0)
Reported Location : Connector 1, Device 2
Vendor : SEAGATE
Model : ST300MM0006
Firmware : LS0A
Serial number : S0K30A4N
World-wide name : 5000C50077893140
Reserved Size : 415982 KB
Used Size : 285696 MB
Unused Size : 64 KB
Total Size : 286102 MB
Write Cache : Disabled (write-through)
FRU : None
S.M.A.R.T. : No
S.M.A.R.T. warnings : 0
Power State : Full rpm
Supported Power States : Full rpm,Powered off
SSD : No
Temperature : 34 C/ 93 F
----------------------------------------------------------------
Device Phy Information
----------------------------------------------------------------
Phy #0
PHY Identifier : 0
SAS Address : 5000C50077893141
Attached PHY Identifier : 4
Attached SAS Address : 50000D1701B47780
Phy #1
PHY Identifier : 1
SAS Address : 5000C50077893142
----------------------------------------------------------------
Runtime Error Counters
----------------------------------------------------------------
Hardware Error Count : 0
Medium Error Count : 0
Parity Error Count : 0
Link Failure Count : 0
Aborted Command Count : 0
SMART Warning Count : 0
Device #1
Device is a Hard drive
State : Online
Block Size : 512 Bytes
Supported : Yes
Programmed Max Speed : SAS 6.0 Gb/s
Transfer Speed : SAS 6.0 Gb/s
Reported Channel,Device(T:L) : 0,7(7:0)
Reported Location : Connector 1, Device 3
Vendor : TOSHIBA
Model : AL13SEB300
Firmware : DE0D
Serial number : 84T0A31SFRD6
World-wide name : 50000395B839D9AC
Reserved Size : 415982 KB
Used Size : 285696 MB
Unused Size : 64 KB
Total Size : 286102 MB
Write Cache : Disabled (write-through)
FRU : None
S.M.A.R.T. : No
S.M.A.R.T. warnings : 0
Power State : Full rpm
Supported Power States : Full rpm,Powered off
SSD : No
Temperature : 33 C/ 91 F
----------------------------------------------------------------
Device Phy Information
----------------------------------------------------------------
Phy #0
PHY Identifier : 0
SAS Address : 50000395B839D9AE
Attached PHY Identifier : 7
Attached SAS Address : 50000D1701B47780
Phy #1
PHY Identifier : 1
SAS Address : 50000395B839D9AF
----------------------------------------------------------------
Runtime Error Counters
----------------------------------------------------------------
Hardware Error Count : 0
Medium Error Count : 0
Parity Error Count : 0
Link Failure Count : 0
Aborted Command Count : 0
SMART Warning Count : 0
Command completed successfully.`
lines := strings.Split(input, "\n")
devs := getPhyDevices(1, lines)
assert := assert.New(t)
assert.Equal(2, len(devs), "physical devices should be 2")
dev1 := devs[0]
assert.Equal("0", dev1.channelId)
assert.Equal("6", dev1.deviceId)
assert.Equal("Online", dev1.Status)
assert.Equal("ST300MM0006", dev1.Model)
assert.Equal(true, dev1.Rotate.Bool())
dev2 := devs[1]
assert.Equal("0", dev2.channelId)
assert.Equal("7", dev2.deviceId)
assert.Equal("Online", dev2.Status)
assert.Equal("AL13SEB300", dev2.Model)
assert.Equal(true, dev2.Rotate.Bool())
}
func Test_getLogicalVolums(t *testing.T) {
input := `Controllers found: 1
----------------------------------------------------------------------
Logical device information
----------------------------------------------------------------------
Logical Device number 0
Logical Device name : LogicalDrv 0
Block Size of member drives : 512 Bytes
RAID level : 1
Unique Identifier : 7D30DCD4
Status of Logical Device : Optimal
Additional details : Quick initialized
Size : 285686 MB
Parity space : 285696 MB
Interface Type : Serial Attached SCSI
Device Type : HDD
Read-cache setting : Enabled
Read-cache status : On
Write-cache setting : Enabled
Write-cache status : On
Partitioned : No
Protected by Hot-Spare : No
Bootable : Yes
Failed stripes : No
Power settings : Disabled
--------------------------------------------------------
Logical Device segment information
--------------------------------------------------------
Segment 0 : Present (286102MB, SAS, HDD, Connector:1, Device:2) S0K30A4N
Segment 1 : Present (286102MB, SAS, HDD, Connector:1, Device:3) 84T0A31SFRD6
Command completed successfully.`
lines := strings.Split(input, "\n")
lvs, err := getLogicalVolumes(1, lines)
if err != nil {
t.Errorf("getLogicalVolumes: %v", err)
}
assert := assert.New(t)
assert.Equal(1, len(lvs), "logical volume len should be 1")
lv := lvs[0]
assert.Equal(1, lv.Adapter)
assert.Equal(0, lv.Index)
inputNoLV := `Controllers found: 1
----------------------------------------------------------------------
Logical device information
----------------------------------------------------------------------
No logical devices configured
Command completed successfully.`
lines = strings.Split(inputNoLV, "\n")
lvs, err = getLogicalVolumes(1, lines)
if err != nil {
t.Errorf("getLogicalVolumes: %v", err)
}
assert.Equal(0, len(lvs), "logical volume len should be 0")
}

View File

@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package client // import "yunion.io/x/onecloud/pkg/multicloud/huaweistack/client"
package adaptec // import "yunion.io/x/onecloud/pkg/baremetal/utils/raid/adaptec"

View File

@@ -24,6 +24,7 @@ import (
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/baremetal/utils/raid"
_ "yunion.io/x/onecloud/pkg/baremetal/utils/raid/adaptec"
_ "yunion.io/x/onecloud/pkg/baremetal/utils/raid/hpssactl"
_ "yunion.io/x/onecloud/pkg/baremetal/utils/raid/megactl"
_ "yunion.io/x/onecloud/pkg/baremetal/utils/raid/mvcli"
@@ -64,6 +65,8 @@ func GetDriverByKernelModule(module string, term raid.IExecTerm) (raid.IRaidDriv
name = baremetal.DISK_DRIVER_HPSARAID
case raid.MODULE_MPT2SAS, raid.MODULE_MPT3SAS:
name = baremetal.DISK_DRIVER_MPT2SAS
case raid.MODULE_AACRAID, raid.MODULE_SMARTPQI:
name = baremetal.DISK_DRIVER_ADAPTECRAID
}
if name == "" {
return nil, errors.Errorf("Not support module %q", module)
@@ -93,13 +96,13 @@ func BuildRaid(driver raid.IRaidDriver, confs []*api.BaremetalDiskConfig, adapte
if adapter == nil {
return fmt.Errorf("Not found adapter by index %d", adapterIdx)
}
if err := buildRaid(adapter, confs); err != nil {
if err := buildRaid(driver, adapter, confs); err != nil {
return fmt.Errorf("Driver %s, adapter %d build raid: %v", driver.GetName(), adapterIdx, err)
}
return nil
}
func buildRaid(adapter raid.IRaidAdapter, confs []*api.BaremetalDiskConfig) error {
func buildRaid(driver raid.IRaidDriver, adapter raid.IRaidAdapter, confs []*api.BaremetalDiskConfig) error {
if err := adapter.PreBuildRaid(confs); err != nil {
return fmt.Errorf("PreBuildRaid: %v", err)
}
@@ -139,6 +142,7 @@ func buildRaid(adapter raid.IRaidAdapter, confs []*api.BaremetalDiskConfig) erro
if err != nil {
return fmt.Errorf("Build raid %s: %v", conf.Conf, err)
}
log.Infof("Build %s:%d raid %s", driver.GetName(), adapter.GetIndex(), conf.Conf)
}
if len(nonDisks) > 0 {
if err := adapter.BuildNoneRaid(nonDisks); err != nil {

View File

@@ -36,6 +36,8 @@ const (
MODULE_HPSA = "hpsa"
MODULE_MPT2SAS = "mpt2sas"
MODULE_MPT3SAS = "mpt3sas"
MODULE_AACRAID = "aacraid"
MODULE_SMARTPQI = "smartpqi"
)
const (

View File

@@ -38,7 +38,7 @@ type Mpt2SASRaidPhyDev struct {
}
func newMpt2SASRaidPhyDev(adapter int) *Mpt2SASRaidPhyDev {
b := raid.NewRaidBasePhyDev(baremetal.DISK_DRIVER_MARVELRAID)
b := raid.NewRaidBasePhyDev(baremetal.DISK_DRIVER_MPT2SAS)
b.Adapter = adapter
return &Mpt2SASRaidPhyDev{
RaidBasePhyDev: b,
@@ -116,6 +116,7 @@ func (dev *Mpt2SASRaidPhyDev) isComplete() bool {
func (dev *Mpt2SASRaidPhyDev) ToBaremetalStorage(idx int) *baremetal.BaremetalStorage {
s := dev.RaidBasePhyDev.ToBaremetalStorage(idx)
s.Index = int64(idx)
s.Slot = dev.slot
s.Enclosure = dev.enclosure
s.Block = int64(dev.block)
@@ -296,7 +297,9 @@ func (adapter *Mpt2SASRaidAdaptor) BuildRaid10(devs []*baremetal.BaremetalStorag
}
func (adapter *Mpt2SASRaidAdaptor) BuildNoneRaid(devs []*baremetal.BaremetalStorage) error {
return fmt.Errorf("Not impl")
// TODO: not impl
// return fmt.Errorf("Not impl")
return nil
}
func (adapter *Mpt2SASRaidAdaptor) RemoveLogicVolumes() error {
@@ -338,11 +341,25 @@ func (r *Mpt2SASRaid) ParsePhyDevs() error {
return r.parseAdapters(ret)
}
func getLineAdapterIndex(line string) int {
dat := regexp.MustCompile(`\s+`).Split(strings.TrimSpace(line), -1)
if len(dat) == 0 {
return -1
}
if regexp.MustCompile(`\d+`).MatchString(dat[0]) {
if !regexp.MustCompile(`^\d+`).MatchString(dat[0]) {
return -1
}
idx, _ := strconv.Atoi(dat[0])
return idx
}
return -1
}
func (r *Mpt2SASRaid) parseAdapters(lines []string) error {
for _, line := range lines {
dat := regexp.MustCompile(`\s+`).Split(strings.TrimSpace(line), -1)
if regexp.MustCompile(`\d+`).MatchString(dat[0]) {
idx, _ := strconv.Atoi(dat[0])
idx := getLineAdapterIndex(line)
if idx >= 0 {
adapter := newMpt2SASRaidAdaptor(idx, r)
r.adapters = append(r.adapters, adapter)
}

View File

@@ -0,0 +1,40 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package sas2iru
import "testing"
func Test_getLineAdapterIndex(t *testing.T) {
tests := []struct {
line string
want int
}{
{
line: "0 SAS3008 100h 97h 00h:5eh:00h:00h 1000h 0097h",
want: 0,
},
{
line: "SAS3IRCU: Utility Completed Successfully.",
want: -1,
},
}
for _, tt := range tests {
t.Run(tt.line, func(t *testing.T) {
if got := getLineAdapterIndex(tt.line); got != tt.want {
t.Errorf("getLineAdapterIndex() = %v, want %v", got, tt.want)
}
})
}
}

View File

@@ -53,7 +53,7 @@ func ServeForeverExtended(app *appsrv.Application, options *common_options.BaseO
if options.EnableSsl {
proto = "https"
}
log.Infof("Start listen on %s://%s", proto, addr)
log.Infof("Start listen on %s://%s, isMaster: %v", proto, addr, isMaster)
var certfile string
var sslfile string
if options.EnableSsl {

View File

@@ -19,9 +19,11 @@ import (
"database/sql"
"fmt"
"net/http"
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/sqlchemy"
"yunion.io/x/onecloud/pkg/appsrv"
@@ -86,25 +88,45 @@ func InitDB(options *common_options.DBOptions) {
}
// lm := lockman.NewNoopLockManager()
if len(options.EtcdEndpoints) != 0 {
log.Infof("using etcd as resource informer backend")
tlsCfg, err := options.GetEtcdTLSConfig()
if err != nil {
log.Fatalf("get etcd informer backend tls config err: %v", err)
startInitInformer(options)
}
// startInitInformer starts goroutine init informer backend
func startInitInformer(options *common_options.DBOptions) {
go func() {
if len(options.EtcdEndpoints) == 0 {
return
}
informerBackend, err := informer.NewEtcdBackend(&etcd.SEtcdOptions{
EtcdEndpoint: options.EtcdEndpoints,
EtcdTimeoutSeconds: 5,
EtcdRequestTimeoutSeconds: 2,
EtcdLeaseExpireSeconds: 5,
EtcdEnabldSsl: options.EtcdUseTLS,
TLSConfig: tlsCfg,
}, nil)
if err != nil {
log.Fatalf("new etcd informer backend error: %v", err)
for {
log.Infof("using etcd as resource informer backend")
if err := initInformer(options); err != nil {
log.Errorf("Init informer error: %v", err)
time.Sleep(10 * time.Second)
} else {
break
}
}
informer.Init(informerBackend)
}()
}
func initInformer(options *common_options.DBOptions) error {
tlsCfg, err := options.GetEtcdTLSConfig()
if err != nil {
return errors.Wrap(err, "get etcd informer backend tls config")
}
informerBackend, err := informer.NewEtcdBackend(&etcd.SEtcdOptions{
EtcdEndpoint: options.EtcdEndpoints,
EtcdTimeoutSeconds: 5,
EtcdRequestTimeoutSeconds: 2,
EtcdLeaseExpireSeconds: 5,
EtcdEnabldSsl: options.EtcdUseTLS,
TLSConfig: tlsCfg,
}, nil)
if err != nil {
return errors.Wrap(err, "new etcd informer backend")
}
informer.Init(informerBackend)
return nil
}
func CloseDB() {

View File

@@ -24,6 +24,7 @@ import (
"yunion.io/x/pkg/gotypes"
"yunion.io/x/sqlchemy"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/util/stringutils2"
@@ -284,12 +285,40 @@ func FetchCustomizeColumns(
if ret[0].Len() != len(objs) {
return nil, httperrors.NewInternalServerError("Invalid FetchCustomizeColumns return value, inconsistent obj count: input %d != output %d", len(objs), ret[0].Len())
}
showReason := false
if query.Contains("show_fail_reason") {
showReason = true
}
retVal := make([]*jsonutils.JSONDict, ret[0].Len())
for i := 0; i < ret[0].Len(); i += 1 {
jsonDict := ValueToJSONDict(ret[0].Index(i))
// NOTE: don't use obj update jsonDict as retval
jsonDict.Update(jsonutils.Marshal(objs[i]).(*jsonutils.JSONDict))
out := apis.ModelBaseDetails{
CanDelete: true,
CanUpdate: true,
}
err = ValidateDeleteCondition(objs[i].(IModel), ctx, jsonDict)
if err != nil {
out.CanDelete = false
if showReason {
out.DeleteFailReason = httperrors.NewErrorFromGeneralError(ctx, err)
}
}
err = ValidateUpdateCondition(objs[i].(IModel), ctx)
if err != nil {
out.CanUpdate = false
if showReason {
out.UpdateFailReason = httperrors.NewErrorFromGeneralError(ctx, err)
}
}
jsonDict.Update(jsonutils.Marshal(out))
retVal[i] = jsonDict
}
return retVal, nil
}
@@ -319,3 +348,25 @@ func CustomizeDelete(model IModel, ctx context.Context, userCred mcclient.TokenC
}
return ValueToError(ret[0])
}
func ValidateDeleteCondition(model IModel, ctx context.Context, data jsonutils.JSONObject) error {
ret, err := call(model, "ValidateDeleteCondition", ctx, data)
if err != nil {
return httperrors.NewGeneralError(err)
}
if len(ret) != 1 {
return httperrors.NewInternalServerError("Invald ValidateDeleteCondition return value")
}
return ValueToError(ret[0])
}
func ValidateUpdateCondition(model IModel, ctx context.Context) error {
ret, err := call(model, "ValidateUpdateCondition", ctx)
if err != nil {
return httperrors.NewGeneralError(err)
}
if len(ret) != 1 {
return httperrors.NewInternalServerError("Invald ValidateUpdateCondition return value")
}
return ValueToError(ret[0])
}

Some files were not shown because too many files have changed in this diff Show More