Compare commits

...

554 Commits

Author SHA1 Message Date
Zexi Li
1264fb0835 Merge pull request #11410 from yousong/automated-cherry-pick-of-#11406-upstream-release-3.4
Automated cherry pick of #11406: webconsole: wait zombies
2021-06-16 20:09:15 +08:00
Yousong Zhou
ac09f79dca webconsole: wait zombies 2021-06-16 19:35:09 +08:00
Yousong Zhou
4b6b85a629 Merge pull request #11271 from yousong/automated-cherry-pick-of-#10849-upstream-release-3.4
Automated cherry pick of #10849: Feature/yousong zombie
2021-06-16 19:30:14 +08:00
Zexi Li
d3856e26d2 Merge pull request #11345 from ioito/automated-cherry-pick-of-#11340-upstream-release-3.4
Automated cherry pick of #11340: fix(cloudid): huawei group role attach and detach
2021-06-08 23:15:29 +08:00
Qu Xuan
bc47ac7d3e fix(cloudid): huawei group role attach and detach 2021-06-07 18:19:28 +08:00
Zexi Li
14afdc74cd Merge pull request #11287 from ioito/automated-cherry-pick-of-#11286-upstream-release-3.4
Automated cherry pick of #11286: fix(region): avoid region service restart
2021-06-03 11:44:10 +08:00
Qu Xuan
c4bb8a3323 fix(region): avoid region service restart 2021-06-02 20:00:50 +08:00
Yousong Zhou
c8eb0d575d treewide: wait possible zombies 2021-05-31 10:17:16 +08:00
Yousong Zhou
f0785033a7 procutils: WaitZombieLoop: remove unneeded info request 2021-05-31 10:17:16 +08:00
Yousong Zhou
4f476cb137 procutils: WaitZombieLoop: less verbose iota 2021-05-31 10:17:16 +08:00
Yousong Zhou
41d332c43b procutils: WaitZombieLoop: use const str "1" for my pid 2021-05-31 10:17:16 +08:00
Yousong Zhou
372f23717a procutils: add WaitZombieLoop 2021-05-31 10:17:16 +08:00
Zexi Li
2945567906 Merge pull request #11004 from ioito/automated-cherry-pick-of-#11000-upstream-release-3.4
Automated cherry pick of #11000: fix(region): wire sql fix
2021-05-08 16:10:29 +08:00
Qu Xuan
9fdcc5db3c fix(region): wire sql fix 2021-05-08 15:52:51 +08:00
Zexi Li
4f2086896b Merge pull request #10947 from zexi/automated-cherry-pick-of-#10941-upstream-release-3.4
Automated cherry pick of #10941: fix(region): download cached image from source host before migrating
2021-04-27 20:09:36 +08:00
Zexi Li
44d420c4e3 fix(region): download cached image from source host before migrating 2021-04-27 17:16:09 +08:00
Zexi Li
04f2fce3c1 Merge pull request #10910 from rainzm/automated-cherry-pick-of-#10906-upstream-release-3.4
Automated cherry pick of #10906: fix(region): use special localtask to run time-consuming provider synchronization task
2021-04-23 17:39:35 +08:00
rainzm
087b7f2c94 fix(region): use special localtask to run time-consuming provider synchronization task
CloudProviderSyncInfoTask will local cloudprovider. Make locaktask run
time-consuming task can avoid holding locks for a long time.
2021-04-23 17:06:03 +08:00
yunion-ci-robot
537f2d5d53 Merge pull request #10833 from zexi/fix/image-cache-from-host
fix(region): fetch cached image from glance by default
2021-04-21 10:53:50 +08:00
Zexi Li
a43c3724c1 Merge pull request #10859 from rainzm/automated-cherry-pick-of-#10851-upstream-release-3.4
Automated cherry pick of #10851: fix(region): avoid using LocalTaskworker in time-consuming synchronization of cloudaccount
2021-04-21 10:32:24 +08:00
rainzm
b9d8873277 fix(region): avoid using LocalTaskworker in time-consuming synchronization of cloudaccount 2021-04-21 10:10:24 +08:00
Zexi Li
f88350a3ac fix(region): fetch cached image from glance by default 2021-04-20 17:51:11 +08:00
Zexi Li
9ec7aa5da2 Merge pull request #10769 from yousong/automated-cherry-pick-of-#10765-upstream-release-3.4
Automated cherry pick of #10765: ansibleserver: wait zombie subprocesses
2021-04-16 13:15:43 +08:00
Zexi Li
ffa1a5bbe1 Merge pull request #10754 from yousong/automated-cherry-pick-of-#10750-upstream-release-3.4
Automated cherry pick of #10750: vpcagent: ovn: fix port match condition formation
2021-04-16 10:07:20 +08:00
Yousong Zhou
b260eeff60 ansibleserver: wait zombie subprocesses 2021-04-16 09:56:45 +08:00
Yousong Zhou
f157726cc6 vpcagent: ovn: fix port match condition formation 2021-04-15 16:10:40 +08:00
yunion-ci-robot
7a15c502c2 Merge pull request #10719 from zexi/automated-cherry-pick-of-#10718-upstream-release-3.4
Automated cherry pick of #10718: fix(baremetal): use command timeout context replace timeout command
2021-04-14 17:42:48 +08:00
Zexi Li
e9e53b1c0f fix(baremetal): use command timeout context replace timeout command 2021-04-14 17:15:27 +08:00
Zexi Li
8ba2b34a67 Merge pull request #10687 from swordqiu/automated-cherry-pick-of-#10683-upstream-release-3.4
Automated cherry pick of #10683: fix(baremetal-agent): baremetal will probe status in status unknown
2021-04-12 13:15:30 +08:00
Qiu Jian
b7518d76d2 fix(baremetal-agent): baremetal will probe status in status unknown 2021-04-12 00:24:21 +08:00
yunion-ci-robot
4e3b2b8334 Merge pull request #10640 from tb365/automated-cherry-pick-of-#10637-upstream-release-3.4
Automated cherry pick of #10637: fix(region): guest associate eip checking fix
2021-04-07 16:14:47 +08:00
TangBin
3af2372ebf make format 2021-04-06 18:53:25 +08:00
tangbin
363a2c2e3f fix(region): guest sync eip fix 2021-04-06 18:51:02 +08:00
tangbin
d0decd7f97 fix(region): guest associate eip checking fix 2021-04-06 18:51:02 +08:00
Zexi Li
d37e2a730e Merge pull request #10626 from swordqiu/automated-cherry-pick-of-#10622-upstream-release-3.4
Automated cherry pick of #10622: fix(keystone): role_assignment effective list ignore groups without user
2021-04-06 10:18:38 +08:00
Qiu Jian
5be60745c0 fix(keystone): role_assignment effective list ignore groups without user 2021-04-05 17:22:27 +08:00
Zexi Li
db3cf440fc Merge pull request #10607 from zexi/automated-cherry-pick-of-#10603-upstream-release-3.4
Automated cherry pick of #10603: fix(baremetal): sas2iru parse line
2021-04-02 20:04:09 +08:00
Zexi Li
d52f3bd8cc Merge pull request #10585 from swordqiu/automated-cherry-pick-of-#10581-upstream-release-3.4
Automated cherry pick of #10581: fix(hostman): recycle local disk file when rebuilding root
2021-04-02 19:43:10 +08:00
Zexi Li
1253d9187f fix(baremetal): sas2iru parse line 2021-04-02 19:29:25 +08:00
Qiu Jian
d270983f8a fix(hostman): recycle local disk file when rebuilding root 2021-04-02 02:40:39 +08:00
Zexi Li
f1108cf3e4 Merge pull request #10503 from yousong/automated-cherry-pick-of-#10499-upstream-release-3.4
Automated cherry pick of #10499: vpcagent: ovn: fix qos for eip upload
2021-03-26 15:18:25 +08:00
Zexi Li
85e176be8d Merge pull request #10509 from swordqiu/automated-cherry-pick-of-#10505-upstream-release-3.4
Automated cherry pick of #10505: fix(baremetal): megactl driver fail to find device by key
2021-03-26 15:16:57 +08:00
Yousong Zhou
fefb33ab13 vpcagent: ovn: fix qos for eip upload 2021-03-26 10:29:06 +08:00
Qiu Jian
962021f120 fix(baremetal): megactl driver fail to find device by key 2021-03-26 03:29:05 +08:00
Zexi Li
89345f0e3f Merge pull request #10478 from yousong/automated-cherry-pick-of-#10477-release-3.4
Automated cherry pick of #10477: Automated cherry pick of #10474: Bugfix/yousong guestnic
2021-03-23 10:40:06 +08:00
Yousong Zhou
61c337e4c0 region: fix setting nic index
When a guest has two nics, changing ip address of the 1st will cause
the new nic after detach then attach to be "1", colliding with the
original nic of index 1
2021-03-22 19:37:19 +08:00
Yousong Zhou
26598ccb15 region: attachnetwork: allow attach by network name
isValidNetworkInfo allows names.  Otherwise the code will panic when
a named was passed and nil was returned by the fetch call
2021-03-22 19:37:19 +08:00
Zexi Li
0a8197c144 Merge pull request #10406 from swordqiu/automated-cherry-pick-of-#10402-upstream-release-3.4
Automated cherry pick of #10402: fix(region): cloud provider filter by domain_id ignore private case
2021-03-12 21:17:28 +08:00
Qiu Jian
aeb61fa3db fix(region): cloud provider filter by domain_id ignore private case 2021-03-12 20:15:51 +08:00
Zexi Li
97ca0dad2b Merge pull request #10386 from swordqiu/automated-cherry-pick-of-#10382-upstream-release-3.4
Automated cherry pick of #10382: fix(region): cloud provider filter by domain
2021-03-11 11:39:28 +08:00
Qiu Jian
442076d554 fix(region): cloud provider filter by domain 2021-03-11 01:09:14 +08:00
Zexi Li
d44a11995c Merge pull request #10344 from yousong/automated-cherry-pick-of-#10340-upstream-release-3.4
Automated cherry pick of #10340: etcd: fix "fatal error: concurrent map writes"
2021-03-08 14:20:48 +08:00
Yousong Zhou
4075333492 etcd: fix "fatal error: concurrent map writes"
Trace

	goroutine 1270434 [running]:
	runtime.throw(0x4b0cc5e, 0x15)
		/home/yousong/.usr/go/goroot-1.15.6/src/runtime/panic.go:1116 +0x72 fp=0xc0011151f8 sp=0xc0011151c8 pc=0x439292
	runtime.mapdelete_faststr(0x40876e0, 0xc0006a54a0, 0xc001e84200, 0x3e)
		/home/yousong/.usr/go/goroot-1.15.6/src/runtime/map_faststr.go:377 +0x34c fp=0xc001115260 sp=0xc0011151f8 pc=0x41664c
	yunion.io/x/onecloud/pkg/cloudcommon/etcd.(*SEtcdClient).Unwatch(0xc0003130e0, 0xc001e84200, 0x3e)
		/home/yousong/go/src/yunion.io/x/onecloud/pkg/cloudcommon/etcd/etcd.go:353 +0x134 fp=0xc0011152d0 sp=0xc001115260 pc=0x10031f4
	yunion.io/x/onecloud/pkg/compute/models.(*SHostHealthChecker).WatchHost(0xc000c222a0, 0x5229ca0, 0xc000122000, 0xc001fbc4e0, 0x24)
		/home/yousong/go/src/yunion.io/x/onecloud/pkg/compute/models/host_health.go:149 +0xd5 fp=0xc001115338 sp=0xc0011152d0 pc=0x1816395
	yunion.io/x/onecloud/pkg/compute/models.(*SHost).PerformOnline(0xc001fd8400, 0x5229d20, 0xc001c4d440, 0x52a0c60, 0xc000957c40, 0x5298900, 0xc001629aa0, 0x5298900, 0xc001629ae0, 0xc000957c40, ...)
		/home/yousong/go/src/yunion.io/x/onecloud/pkg/compute/models/hosts.go:3829 +0x227 fp=0xc0011153a0 sp=0xc001115338 pc=0x185a387
	yunion.io/x/onecloud/pkg/compute/models.(*SHost).PerformPing(0xc001fd8400, 0x5229d20, 0xc001c4d440, 0x52a0c60, 0xc000957c40, 0x5298900, 0xc001629aa0, 0x5298900, 0xc001629ae0, 0x0, ...)
		/home/yousong/go/src/yunion.io/x/onecloud/pkg/compute/models/hosts.go:3891 +0xbd fp=0xc001115430 sp=0xc0011153a0 pc=0x185acbd
2021-03-08 09:56:51 +08:00
Zexi Li
5699ac0595 Merge pull request #10324 from tb365/automated-cherry-pick-of-#10322-upstream-release-3.4
Automated cherry pick of #10322: copyright update brand_cn&brand_en fix
2021-03-05 10:15:27 +08:00
tangbin
2e5b1288f0 copyright update brand_cn&brand_en fix 2021-03-05 10:00:31 +08:00
Zexi Li
b4fbdc8fa4 Merge pull request #10306 from tb365/automated-cherry-pick-of-#10305-upstream-release-3.4
Automated cherry pick of #10305: infos copyright add brand_en&brand_cn
2021-03-04 15:25:43 +08:00
tangbin
baccc6af2e infos copyright add brand_en&brand_cn 2021-03-04 11:20:01 +08:00
Zexi Li
e939acb221 Merge pull request #10274 from ioito/automated-cherry-pick-of-#10270-upstream-release-3.4
Automated cherry pick of #10270: fix(cloudevent): optimized cloudevent sql
2021-02-25 11:36:09 +08:00
Qu Xuan
7453b5a4aa fix(cloudevent): optimized cloudevent sql 2021-02-25 11:35:06 +08:00
Zexi Li
5ddda054d4 Merge pull request #10269 from ioito/automated-cherry-pick-of-#10265-upstream-release-3.4
Automated cherry pick of #10265: fix(region): add azure new region
2021-02-25 11:23:18 +08:00
Qu Xuan
7815cb0a0c fix(region): add azure new region 2021-02-25 10:24:47 +08:00
Zexi Li
a533bdcde8 Merge pull request #10238 from ioito/automated-cherry-pick-of-#10234-upstream-release-3.4
Automated cherry pick of #10234: fix(region): avoid not sync dns zone
2021-02-22 19:50:15 +08:00
Qu Xuan
105157dd22 fix(region): avoid not sync dns zone 2021-02-22 16:16:03 +08:00
yunion-ci-robot
c825ebdcc2 Merge pull request #10188 from swordqiu/automated-cherry-pick-of-#10158-upstream-release-3.4
Automated cherry pick of #10158: fix(apigateway): add enable_quota_check and return-domain-list
2021-02-08 05:48:59 +08:00
Qiu Jian
833a8058dd fix(apigateway): add enable_quota_check and return-domain-list attributes to fe params 2021-02-07 17:01:14 +08:00
Zexi Li
510ba895c3 Merge pull request #10168 from ioito/hotfix/qx-secgroup-clone-status
fix(region): secgroup clone set status
2021-02-05 14:38:29 +08:00
Qu Xuan
e5e9d54655 fix(region): secgroup clone set status 2021-02-05 14:27:13 +08:00
Zexi Li
53bfda4849 Merge pull request #10108 from ioito/automated-cherry-pick-of-#10104-upstream-release-3.4
Automated cherry pick of #10104: fix(region): delete virtual nics with network
2021-02-02 21:04:31 +08:00
Zexi Li
d99774a3f1 Merge pull request #10121 from wanyaoqi/automated-cherry-pick-of-#10117-upstream-release-3.4
Automated cherry pick of #10117: fix(region): add option auto reconcile backup servers
2021-02-02 20:11:48 +08:00
wanyaoqi
709daa66d3 fix(region): add option auto reconcile backup servers 2021-02-02 18:40:48 +08:00
Qu Xuan
2cbb4f9784 fix(region): delete virtual nics with network 2021-02-02 10:56:28 +08:00
Zexi Li
5696d10300 Merge pull request #10077 from wanyaoqi/automated-cherry-pick-of-#10073-upstream-release-3.4
Automated cherry pick of #10073: fix(host-deployer): remove escape character on windows passwd
2021-01-30 10:40:37 +08:00
wanyaoqi
97167be073 fix(host-deployer): remove escape character on windows passwd 2021-01-29 11:59:00 +08:00
Zexi Li
3a80ccd82f Merge pull request #10052 from ioito/automated-cherry-pick-of-#10048-upstream-release-3.4
Automated cherry pick of #10048: fix(region): secgroup priority fix
2021-01-28 15:12:27 +08:00
Qu Xuan
0722788a5a fix(region): secgroup priority fix 2021-01-28 14:22:35 +08:00
Zexi Li
3673a98fef Merge pull request #10024 from ioito/automated-cherry-pick-of-#10018-upstream-release-3.4
Automated cherry pick of #10018: fix(region): optimized secgroup rule sync
2021-01-26 14:53:43 +08:00
Qu Xuan
08d969baf4 fix(region): optimized secgroup rule sync 2021-01-26 14:12:48 +08:00
Zexi Li
d58a1533ad Merge pull request #10007 from wanyaoqi/automated-cherry-pick-of-#10003-upstream-release-3.4
Automated cherry pick of #10003: fix(host): fix wait time after execute mount fuse fs
2021-01-25 21:06:05 +08:00
Zexi Li
2fe7ba8f20 Merge pull request #10017 from swordqiu/automated-cherry-pick-of-#10013-upstream-release-3.4
Automated cherry pick of #10013: fix(keystone): user create without password can login with any password
2021-01-25 21:03:40 +08:00
Qiu Jian
ec9631f992 fix(keystone): user create without password can login with any password 2021-01-23 23:52:33 +08:00
wanyaoqi
44a135bba4 fix(host): fix wait time after mount fuse fs 2021-01-22 19:22:01 +08:00
yunion-ci-robot
c4031158e3 Merge pull request #9970 from tb365/bugfix/tb-bugfix-012001
Bugfix/tb bugfix 012001
2021-01-22 17:11:05 +08:00
Zexi Li
a4f775922e Merge pull request #9978 from yousong/automated-cherry-pick-of-#9974-upstream-release-3.4
Automated cherry pick of #9974: fix(region): cloudaccount: allow only one sync func in flight
2021-01-22 02:47:37 +08:00
Zexi Li
1442973d95 Merge pull request #9988 from ioito/automated-cherry-pick-of-#9973-upstream-release-3.4
Automated cherry pick of #9973: fix(region): avoid clean all rules when sync secgroups
2021-01-22 00:39:22 +08:00
Qu Xuan
60dad15824 fix(region): avoid clean all rules when sync secgroups 2021-01-21 21:34:28 +08:00
Yousong Zhou
571d2d297e fix(region): cloudaccount: allow only one sync func in flight
Ref https://github.com/yunionio/onecloud/pull/6859
2021-01-21 16:31:45 +08:00
tangbin
f05a913cbb loadbalancer add lb purge validate 2021-01-20 21:52:49 +08:00
tangbin
7b47c9bb8c fix(region): aws elb backendgroup sync bugfix 2021-01-20 21:48:25 +08:00
Zexi Li
6f8400a7e5 Merge pull request #9929 from rainzm/automated-cherry-pick-of-#9925-upstream-release-3.4
Automated cherry pick of #9925: Notify Optimization
2021-01-18 11:47:17 +08:00
rainzm
ecb169d9f9 fix(notify): add a time limit for resending notifications 2021-01-18 11:17:47 +08:00
Jian Qiu
ce630362fb fix(cloudcommon): missing set_meta opslog (#9918)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2021-01-17 11:34:02 +08:00
Zexi Li
61d8885b60 Merge pull request #9876 from swordqiu/automated-cherry-pick-of-#9872-upstream-release-3.4
Automated cherry pick of #9872: fix(region): AWS buckets in us-east-1 have null location
2021-01-14 09:36:46 +08:00
Qiu Jian
0b7a4f08e1 fix(region): AWS buckets in us-east-1 have null location 2021-01-14 09:30:45 +08:00
Zexi Li
caa530bd60 Merge pull request #9789 from yousong/automated-cherry-pick-of-#9785-upstream-release-3.4
Automated cherry pick of #9785: guest_deploy_task: log other deploy details with i18n
2021-01-07 21:16:57 +08:00
Yousong Zhou
559d30afa8 guest_deploy_task: log other deploy details with i18n
Fixes 9f350392 ("add service tag for actionlog")
2021-01-07 11:47:12 +08:00
Zexi Li
b8c10b8e7c Merge pull request #9766 from wanyaoqi/automated-cherry-pick-of-#9762-upstream-release-3.4
Automated cherry pick of #9762: feat(region): stop guest before freeze
2021-01-05 18:33:42 +08:00
wanyaoqi
b3285aebce feat(region): stop guest before freeze 2021-01-05 15:49:25 +08:00
Zexi Li
ad01c895cf Merge pull request #9739 from wanyaoqi/automated-cherry-pick-of-#9731-upstream-release-3.4
Automated cherry pick of #9731: fix(region): server start check host memory is enough
2020-12-30 21:40:07 +08:00
Zexi Li
b2aa6dd321 Merge pull request #9748 from rainzm/automated-cherry-pick-of-#9744-upstream-release-3.4
Automated cherry pick of #9744: fix(esxiagent): nicIndex should be incremented
2020-12-30 21:36:07 +08:00
rainzm
a4dcc91d0d fix(esxiagent): nicIndex should be incremented 2020-12-30 19:04:00 +08:00
wanyaoqi
18a751548c fix(region): server start check host memory is enough 2020-12-30 15:59:07 +08:00
Zexi Li
b53b09ebb5 Merge pull request #9718 from wanyaoqi/automated-cherry-pick-of-#9711-upstream-release-3.4
Automated cherry pick of #9711: fix(region,host,host-deployer): sync status chekc block jobs
2020-12-29 20:43:49 +08:00
Zexi Li
c6941536b7 Merge pull request #9714 from rainzm/automated-cherry-pick-of-#9693-upstream-release-3.4
Automated cherry pick of #9693: Solve the permission problem of notify to create receiver
2020-12-29 20:41:56 +08:00
wanyaoqi
edba3c3dfc fix(region,host): sync status check block jobs 2020-12-29 15:39:34 +08:00
wanyaoqi
a66c1aa1ba fix(host-deployer): add log line on blkid failed 2020-12-29 15:38:59 +08:00
wanyaoqi
c5dd4389d3 fix(climc): host add netif add params bridge/interface 2020-12-29 15:38:59 +08:00
rainzm
0e4ea782e1 feat(db): progressive inspection when determining the required scope 2020-12-29 15:14:28 +08:00
rainzm
9b993f1a99 fix(notify): inject domain info in ReceiverManager.FetchOwnerId 2020-12-29 15:14:28 +08:00
Zexi Li
8a62c46a92 Merge pull request #9704 from swordqiu/automated-cherry-pick-of-#9701-upstream-release-3.4
Automated cherry pick of #9701: fix(region): omit vpc quota check if vpc created by owner
2020-12-29 09:36:04 +08:00
Qiu Jian
d3ad4967a9 fix(region): omit vpc quota check if vpc created by owner
Vpc quota check is omitted if vpc is create by owner user
2020-12-29 01:21:47 +08:00
Zexi Li
37897cadc7 Merge pull request #9543 from ioito/automated-cherry-pick-of-#9540-upstream-release-3.4
Automated cherry pick of #9540: fix(region): openstack network is regional
2020-12-28 10:20:41 +08:00
Zexi Li
9a8111de6c Merge pull request #9647 from swordqiu/automated-cherry-pick-of-#9644-upstream-release-3.4
Automated cherry pick of #9644: feature(climc): policy save data into file
2020-12-26 12:09:35 +08:00
Qiu Jian
9cdd7dd2da feature(climc): policy save data into file
Allow saveing policy data into file
2020-12-25 17:13:41 +08:00
Zexi Li
8549df1a00 Merge pull request #9632 from ioito/automated-cherry-pick-of-#9629-upstream-release-3.4
Automated cherry pick of #9629: fix(region): optimized disk allocate sched failed log
2020-12-24 17:48:17 +08:00
Qu Xuan
cd9b632d08 fix(region): optimized disk allocate sched failed log 2020-12-24 17:02:14 +08:00
Zexi Li
ac8ba1e86d Merge pull request #9602 from yousong/automated-cherry-pick-of-#9599-upstream-release-3.4
Automated cherry pick of #9599: Bugfix/yousong climc ssh
2020-12-23 22:13:12 +08:00
Yousong Zhou
2add6fc1f5 fix(mcclient): options: webconsole: fix passing ssh port 2020-12-23 13:32:25 +08:00
Yousong Zhou
45eda7c703 refactor(climc): webconsole: use helper methods of response struct 2020-12-23 13:32:25 +08:00
Yousong Zhou
85008a7b0c refactor(webconsole): api: add helper methods for response struct 2020-12-23 13:32:25 +08:00
Yousong Zhou
2f9cfae375 refactor(webconsole): use structured response 2020-12-23 13:32:25 +08:00
Zexi Li
410782cffc Merge pull request #9576 from ioito/automated-cherry-pick-of-#9573-upstream-release-3.4
Automated cherry pick of #9573: fix(region): add huawei gpssd desc
2020-12-23 09:37:26 +08:00
Zexi Li
9342ccf9c3 Merge pull request #9580 from zhaoxiangchun/automated-cherry-pick-of-#9579-upstream-release-3.4
Automated cherry pick of #9579: fix(monitor): other servier create alert add used_by param as a agreement
2020-12-23 09:35:08 +08:00
Zexi Li
29c96f2d2b Merge pull request #9592 from swordqiu/automated-cherry-pick-of-#9589-upstream-release-3.4
Automated cherry pick of #9589: fix(cloudevent,devtool): missing metadata table
2020-12-23 09:08:00 +08:00
Qiu Jian
df7d68e404 fix(cloudevent,devtool): missing metadata table 2020-12-23 03:13:02 +08:00
Qu Xuan
869744d1bb fix(region): openstack network is regional 2020-12-22 16:27:28 +08:00
--global
b01a477cb2 fix(monitor): other servier create alert add used_by param as a agreement
1.解决notify,meter中创建的对应的策略也展示在统一报警策略页面。通过used_by
  进行区分
2020-12-22 16:17:09 +08:00
Qu Xuan
1ec3d6ddf0 fix(region): add huawei gpssd desc 2020-12-22 11:34:13 +08:00
Zexi Li
984006ea31 Merge pull request #9569 from wanyaoqi/automated-cherry-pick-of-#9498-upstream-release-3.4
Automated cherry pick of #9498: server migrate misc fix
2020-12-22 10:06:19 +08:00
yunion-ci-robot
1bc2c75e06 Merge pull request #9567 from zexi/automated-cherry-pick-of-#9564-upstream-release-3.4
Automated cherry pick of #9564: Hotfix/baremetal pxe net alloc
2020-12-21 23:47:46 +08:00
wanyaoqi
cf8b548392 fix(host): add print migrate progress info 2020-12-21 21:08:04 +08:00
wanyaoqi
a898d76094 fix(region): do not change disk status on migrating 2020-12-21 21:08:04 +08:00
Zexi Li
30ee4056e1 Merge pull request #9547 from yousong/automated-cherry-pick-of-#9544-upstream-release-3.4
Automated cherry pick of #9544: fix(region): lbbackend: better error reporting for finding influxdb info
2020-12-21 21:08:02 +08:00
Zexi Li
7d64b9fffc Merge pull request #9558 from ioito/automated-cherry-pick-of-#9555-upstream-release-3.4
Automated cherry pick of #9555: fix(region): fix openstack instance os type
2020-12-21 21:04:14 +08:00
Zexi Li
3da4dd1953 fix(region,baremetal): choose candidate network not according by types 2020-12-21 20:50:03 +08:00
Zexi Li
014170e74a fix(region,baremetal): pxe net reuse converted server access ip 2020-12-21 20:50:02 +08:00
Qu Xuan
db60e37c4d fix(region): fix openstack instance os type 2020-12-21 19:50:58 +08:00
Yousong Zhou
4ac56f7fc3 fix(region): lbbackend: better error reporting for finding influxdb info 2020-12-21 16:52:50 +08:00
Zexi Li
9494c0939a Merge pull request #9372 from ioito/automated-cherry-pick-of-#9360-upstream-release-3.4
Automated cherry pick of #9360: fix(region): sync servers
2020-12-21 10:41:11 +08:00
Zexi Li
1e1941cd7b Merge pull request #9532 from swordqiu/automated-cherry-pick-of-#9529-upstream-release-3.4
Automated cherry pick of #9529: fix(taskman): use admin token if task userCred token expired
2020-12-20 02:06:22 +08:00
Qiu Jian
70d2e5c84d fix(taskman): use admin token if task userCred token expired
Use admin credential token if task cached userCred token expired
2020-12-20 01:22:37 +08:00
yunion-ci-robot
4e864a7a86 Merge pull request #9522 from zexi/automated-cherry-pick-of-#9521-upstream-release-3.4
Automated cherry pick of #9521: Storage actual size filter
2020-12-20 00:02:09 +08:00
Zexi Li
5bce2bd959 fix(scheduler): storage predicate add actualCapacity filter 2020-12-19 22:05:05 +08:00
Zexi Li
8089afa122 Merge pull request #9525 from zexi/fix/remove-sched-k8s-extender
fix(scheduler): remove unused k8s extender
2020-12-19 22:03:31 +08:00
Zexi Li
da66f26503 fix(scheduler): remove unused k8s extender 2020-12-19 21:44:57 +08:00
Zexi Li
8450fe9ea0 Merge pull request #9497 from wanyaoqi/automated-cherry-pick-of-#9494-upstream-release-3.4
Automated cherry pick of #9494: fix(region): guest to create input keep billing info
2020-12-19 20:06:31 +08:00
Zexi Li
b0163b6a70 Merge pull request #9508 from ioito/automated-cherry-pick-of-#9159-upstream-release-3.4
Automated cherry pick of #9159: feat(region): add instance storage capability
2020-12-19 20:04:41 +08:00
Zexi Li
b19762e1a9 Merge pull request #9519 from swordqiu/automated-cherry-pick-of-#9515-upstream-release-3.4
Automated cherry pick of #9515: fix(host): telegraf listen on local ipv4 address explicitly
2020-12-19 18:11:58 +08:00
Qiu Jian
c3fd4937d3 fix(host): telegraf listen on local ipv4 address explicitly
Ensure telegraf listen on local IPv4 address explicityly and host send
metrics to telegraf local IPv4 address explicityly.
2020-12-19 15:38:15 +08:00
Zexi Li
77e19e79a0 Merge pull request #9505 from swordqiu/automated-cherry-pick-of-#9502-upstream-release-3.4
Automated cherry pick of #9502: fix(keystone): always upload&refresh service config whenever service …
2020-12-19 11:39:35 +08:00
Qu Xuan
c069179adc fix(region): sync servers 2020-12-19 10:27:55 +08:00
Zexi Li
fdf51560a3 Merge pull request #9505 from swordqiu/automated-cherry-pick-of-#9502-upstream-release-3.4
Automated cherry pick of #9502: fix(keystone): always upload&refresh service config whenever service …
2020-12-19 09:32:59 +08:00
Qiu Jian
9561c0c8d4 fix(keystone): always upload&refresh service config whenever service restart
Always upload&refresh service config whenever service restart
2020-12-19 00:54:54 +08:00
yunion-ci-robot
b0d7d2f912 Merge pull request #9493 from zexi/automated-cherry-pick-of-#9490-upstream-release-3.4
Automated cherry pick of #9490: Hotfix/baremetal pd makegood
2020-12-18 20:47:01 +08:00
wanyaoqi
35c0e52de9 fix(region): guest to create input keep billing info 2020-12-18 16:41:50 +08:00
Zexi Li
ec5995da4b fix(baremetal): clear jbod disks do PDMakeGood 2020-12-18 15:51:02 +08:00
Zexi Li
21567833fd Merge pull request #9480 from yousong/automated-cherry-pick-of-#9458-upstream-release-3.4
Automated cherry pick of #9458: Bugfix/yousong eip ipaddr
2020-12-18 12:51:42 +08:00
Zexi Li
159fba33b6 Merge pull request #9475 from yousong/automated-cherry-pick-of-#9472-upstream-release-3.4
Automated cherry pick of #9472: Bugfix/yousong host mtu
2020-12-18 00:19:44 +08:00
Yousong Zhou
5b0247a35f fix(region): eip_allocate_task: set eip status allocate_fail on task failure 2020-12-17 22:03:29 +08:00
Yousong Zhou
62c39c62cd fix(region,climc): eips: rename arg name for requested eip addr 2020-12-17 22:03:29 +08:00
Yousong Zhou
995b24c319 fix(region): guestnetworks: use net calculated mtu 2020-12-17 21:52:04 +08:00
Yousong Zhou
82e1234ed4 feat(region): networks: add getMtu method 2020-12-17 21:52:04 +08:00
Yousong Zhou
208a49e3d4 feat(apis): add const VPC_OVN_ENCAP_COST 2020-12-17 21:52:04 +08:00
Yousong Zhou
c8388cab1a feat(host): startvm: set vpc nic mtu
Windows DHCP client does not respect DHCP MTU option
2020-12-17 21:52:04 +08:00
Yousong Zhou
45b538bd2a feat(host): startvm: add nic_mtu shell func 2020-12-17 21:52:04 +08:00
Yousong Zhou
f2e3766bee refactor(host): startvm: for compat
QEMU 2.12 outputs device help on stderr in the following style

```
virtio-net-pci.speed=int32
```

QEMU 5.2.0 outputs it to stdout and in the following format

```
  speed=<int32>          -  (default: -1)
```
2020-12-17 21:52:04 +08:00
Yousong Zhou
2154e7c18b refactor(host): startvm: nic_speed: use raw string 2020-12-17 21:52:03 +08:00
Yousong Zhou
27dc7b6296 refactor(host): startvm: add QEMU_CMD_KVM_ARG 2020-12-17 21:52:03 +08:00
Zexi Li
ae64d437f2 Merge pull request #9462 from swordqiu/hotfix/qj-3.4-quota-check-default-on
fix(cloudcommon): quota checkout turnd on by default at release/3.4
2020-12-17 09:31:49 +08:00
Qiu Jian
8d842b0d2f fix(cloudcommon): quota checkout turnd on by default at release/3.4 2020-12-17 08:51:49 +08:00
Zexi Li
34d0478af1 Merge pull request #9457 from zexi/automated-cherry-pick-of-#9454-upstream-release-3.4
Automated cherry pick of #9454: fix(scheduler): fetch input network when specified
2020-12-16 18:24:58 +08:00
Zexi Li
b1bec7337f fix(scheduler): fetch input network when specified 2020-12-16 17:51:40 +08:00
Zexi Li
de77edc357 Merge pull request #9423 from zexi/automated-cherry-pick-of-#9418-upstream-release-3.4
Automated cherry pick of #9418: fix(region): baremetal post update related server
2020-12-16 10:41:03 +08:00
yunion-ci-robot
2ce7f7b9fe Merge pull request #9438 from wanyaoqi/automated-cherry-pick-of-#9435-upstream-release-3.4
Automated cherry pick of #9435: fix(host): fix set windows password with escape charater
2020-12-15 20:52:14 +08:00
wanyaoqi
e6206944dd fix(host): fix set windows password with escape charater 2020-12-15 16:58:11 +08:00
Zexi Li
02bac8b9ae Merge pull request #9434 from zexi/automated-cherry-pick-of-#9431-upstream-release-3.4
Automated cherry pick of #9431: Fix/climc server create desc
2020-12-15 11:54:35 +08:00
Zexi Li
78c10c78cc Merge pull request #9429 from yousong/automated-cherry-pick-of-#9426-upstream-release-3.4
Automated cherry pick of #9426: fix(vpcagent): ovn: stable dns A record value
2020-12-15 11:45:28 +08:00
Zexi Li
433807432a fix(climc): server-create --desc not work 2020-12-15 11:37:07 +08:00
Yousong Zhou
0f973234b8 fix(vpcagent): ovn: stable dns A record value 2020-12-15 11:10:36 +08:00
Zexi Li
58810cde95 Merge pull request #9424 from wanyaoqi/automated-cherry-pick-of-#9417-upstream-release-3.4
Automated cherry pick of #9417: fix(region,host): fix hot remove nic
2020-12-15 00:08:14 +08:00
Zexi Li
36a9314427 fix(region): baremetal post update related server 2020-12-14 19:16:00 +08:00
wanyaoqi
2864b15ecc fix(region,host): fix hot remove nic
- region: check is hot remove nic enable
- host: del qemu device after del netdev
2020-12-14 19:04:04 +08:00
wanyaoqi
0ee2cbcf60 fix(host): fix check hugepage enabled 2020-12-14 19:02:21 +08:00
Zexi Li
44252983e9 Merge pull request #9414 from zexi/automated-cherry-pick-of-#9411-upstream-release-3.4
Automated cherry pick of #9411: fix(scheduler): sku filter check zone if only prefer region specified
2020-12-14 17:56:55 +08:00
Zexi Li
532ada4bf9 fix(scheduler): sku filter check zone if only prefer region specified 2020-12-14 17:27:08 +08:00
Zexi Li
df4a02ac49 Merge pull request #9408 from zexi/automated-cherry-pick-of-#9405-upstream-release-3.4
Automated cherry pick of #9405: Hotfix/webconsole trim url
2020-12-14 17:23:36 +08:00
Zexi Li
6d5941eaad Merge pull request #9397 from zexi/automated-cherry-pick-of-#9394-upstream-release-3.4
Automated cherry pick of #9394: fix(scheduler): get candidates error more info
2020-12-14 15:52:35 +08:00
yunion-ci-robot
f77c4d078a Merge pull request #9398 from wanyaoqi/bugfix/wyq/fix-unmarshal-perform-params
fix(climc): fix marshal perform params
2020-12-14 15:50:05 +08:00
Zexi Li
5364ba5641 fix(webconsole): trim api_server url if end with slashes 2020-12-14 15:48:30 +08:00
Zexi Li
f4d8225a10 Merge pull request #9402 from rainzm/automated-cherry-pick-of-#9399-upstream-release-3.4
Automated cherry pick of #9399: fix(notify): avoid deadlock
2020-12-14 15:45:41 +08:00
rainzm
9122c7e10d fix(notify): avoid deadlock 2020-12-14 15:06:53 +08:00
wanyaoqi
3e3d356ffc fix(climc): fix marshal perform params 2020-12-14 14:55:02 +08:00
Zexi Li
1c86c0d73a fix(scheduler): get candidates error more info 2020-12-14 14:39:52 +08:00
Zexi Li
aa937e6966 Merge pull request #9387 from tb365/automated-cherry-pick-of-#9386-upstream-release-3.4
Automated cherry pick of #9386: feat(region): support sync skus by cloudregion
2020-12-13 13:51:51 +08:00
Zexi Li
706980e233 Merge pull request #9393 from swordqiu/automated-cherry-pick-of-#9390-upstream-release-3.4
Automated cherry pick of #9390: fix(region): network reserved ip count not consider expiration of reserved ips
2020-12-13 12:09:31 +08:00
Qiu Jian
47fdfc78c9 fix(region): network reserved ip count not consider expiration of reserved ips
network reserved ip count not consider expiration of reserved ips
2020-12-12 19:48:51 +08:00
TangBin
96d199724e feat(region): support sync skus by cloudregion 2020-12-12 19:08:29 +08:00
Zexi Li
50a36e3906 Merge pull request #9376 from tb365/automated-cherry-pick-of-#9359-upstream-release-3.4
Automated cherry pick of #9359: Bugfix/tb bugfix cmb 1210
2020-12-12 18:28:53 +08:00
TangBin
3817b9e6ad fix(region): goimports check fix 2020-12-12 17:54:42 +08:00
TangBin
e4c07c0304 feat(region): support sync skus by cloudregion 2020-12-12 17:45:59 +08:00
TangBin
2ff318a5b8 fix(region): server login info& keypair import input parameter trimspace 2020-12-12 17:28:16 +08:00
Zexi Li
e8605a1758 Merge pull request #9369 from swordqiu/automated-cherry-pick-of-#9366-upstream-release-3.4
Automated cherry pick of #9366: fix(keystone): ignore service config update without changes
2020-12-12 00:14:21 +08:00
Qiu Jian
ee391ed98a fix(keystone): ignore service config update without changes
ignore service config updates that no changes happen. prevent service
config change infomrer messages from flushing the log.
2020-12-11 22:22:42 +08:00
yunion-ci-robot
d2702b67f9 Merge pull request #9338 from zexi/automated-cherry-pick-of-#9335-upstream-release-3.4
Automated cherry pick of #9335: Hotfix/baremetal convert host
2020-12-11 13:32:15 +08:00
Zexi Li
deae194d43 Merge pull request #9355 from zexi/automated-cherry-pick-of-#9352-upstream-release-3.4
Automated cherry pick of #9352: Bugfix/scheduler SKU net
2020-12-11 09:18:31 +08:00
Zexi Li
aad036a822 fix(scheduler): sku by region and fill onecloud vpc networks 2020-12-10 21:14:37 +08:00
Zexi Li
16f59a2f2c Merge pull request #9334 from ioito/automated-cherry-pick-of-#9331-upstream-release-3.4
Automated cherry pick of #9331: fix(region): openstack hosts sync
2020-12-10 20:40:19 +08:00
Zexi Li
4aec6e7e36 Merge pull request #9350 from swordqiu/automated-cherry-pick-of-#9347-upstream-release-3.4
Automated cherry pick of #9347: fix(cloudcommon): perform public should check the sharing scope of
2020-12-10 20:38:12 +08:00
Qiu Jian
c553099588 fix(cloudcommon): perform public should check the sharing scope of resource
perform public should check the sharing scope of resource
2020-12-10 19:16:16 +08:00
Qu Xuan
5863e4a73d fix(region): openstack hosts sync 2020-12-10 18:23:54 +08:00
Zexi Li
bc3aa5432f Merge pull request #9327 from rainzm/automated-cherry-pick-of-#9325-upstream-release-3.4
Automated cherry pick of #9325: refactor(notify): add StartSubcontactPullTask for receiver
2020-12-10 17:22:21 +08:00
Zexi Li
bd666ee815 Merge pull request #9301 from ioito/automated-cherry-pick-of-#9298-upstream-release-3.4
Automated cherry pick of #9298: fix(region): support openstack subnet allocation pools
2020-12-10 17:18:08 +08:00
Zexi Li
2ad30a0872 Merge pull request #9323 from swordqiu/automated-cherry-pick-of-#9320-upstream-release-3.4
Automated cherry pick of #9320: fix(cloudcommon): disable quota check by default
2020-12-10 17:08:50 +08:00
Zexi Li
c5655ed2ba fix(baremetal): convert to host failed
- convert schedule should include converting status
- auto register name should lowercase
- finish convert set host name by guest
2020-12-10 16:59:41 +08:00
rainzm
3d99fe914d fix(notify): repull subcontact after changing config 2020-12-10 10:31:12 +08:00
rainzm
d357f03757 fix(notify): check for changes before updating config 2020-12-10 10:31:12 +08:00
rainzm
28e5b39fff refactor(notify): add StartSubcontactPullTask for receiver 2020-12-10 10:31:12 +08:00
Qiu Jian
2d248612e0 fix(cloudcommon): disable quota check by default
1. add enable_quota_check common option
2. disable quota check by default
3. specify scope of quota limit in OutOfQuota error message
2020-12-10 01:29:08 +08:00
Zexi Li
0ebde53d20 Merge pull request #9262 from wanyaoqi/automated-cherry-pick-of-#9259-upstream-release-3.4
Automated cherry pick of #9259: fix(region): attach network on register baremetal server
2020-12-09 20:40:56 +08:00
Zexi Li
8ac922480e Merge pull request #9311 from yousong/automated-cherry-pick-of-#9308-upstream-release-3.4
Automated cherry pick of #9308: Bugfix/yousong eip chargetype
2020-12-09 20:35:14 +08:00
Zexi Li
212bdc0907 Merge pull request #9318 from wanyaoqi/automated-cherry-pick-of-#9315-upstream-release-3.4
Automated cherry pick of #9315: fix(host): check lease living on restart etcd session
2020-12-09 20:33:23 +08:00
wanyaoqi
31436641cc fix(host): check lease living on restart etcd session 2020-12-09 16:57:19 +08:00
Yousong Zhou
5e3861b28b refactor(apis): compute: remove EIP_CHARGE_TYPE_DEFAULT
The default is now cloud provider specific
2020-12-09 12:26:58 +08:00
Yousong Zhou
475842e818 fix(region): sanitize eip charge type on all callsites 2020-12-09 12:26:58 +08:00
Yousong Zhou
f3fee11711 feat(region): regiondriver: add methods on eip charge type 2020-12-09 12:18:25 +08:00
Qu Xuan
d1d62de884 fix(region): support openstack subnet allocation pools 2020-12-09 10:33:04 +08:00
Zexi Li
20f2ed2b1f Merge pull request #9267 from ioito/automated-cherry-pick-of-#9266-upstream-release-3.4
Automated cherry pick of #9266: [WIP]fix(region): openstack available zones
2020-12-08 21:37:42 +08:00
Zexi Li
529da18451 Merge pull request #9280 from wanyaoqi/automated-cherry-pick-of-#9277-upstream-release-3.4
Automated cherry pick of #9277: fix(region): validate isolated devices on migrate
2020-12-08 21:36:12 +08:00
Zexi Li
ee5351b536 Merge pull request #9289 from zhasm/automated-cherry-pick-of-#9288-upstream-release-3.4
Automated cherry pick of #9288: fix(git,make): 更新获取 git branch 的规则
2020-12-08 18:11:22 +08:00
Zhang Dongliang
f82e51af65 fix(git,make): 更新获取 git branch 的规则 2020-12-08 18:00:34 +08:00
yunion-ci-robot
91680e5fca Merge pull request #9275 from wanyaoqi/automated-cherry-pick-of-#9272-upstream-release-3.4
Automated cherry pick of #9272: fix(host-deployer): cancel rename centos vgname
2020-12-08 17:07:40 +08:00
wanyaoqi
c74b89332d fix(region): validate isolated devices on migrate 2020-12-08 16:52:07 +08:00
Zexi Li
b8e6b5db7b Merge pull request #9271 from zhasm/automated-cherry-pick-of-#9268-upstream-release-3.4
Automated cherry pick of #9268: fix(git,make): git branch 获取方式优化
2020-12-08 16:35:45 +08:00
wanyaoqi
8471421b87 fix(host-deployer): cancel rename centos vgname 2020-12-08 16:30:48 +08:00
Qu Xuan
ab6d57afea fix(region): openstack available zones 2020-12-08 16:18:53 +08:00
Zhang Dongliang
5920af6aee fix(git,make): git branch 获取方式优化 2020-12-08 15:52:35 +08:00
Zexi Li
df6d774d69 Merge pull request #9256 from zhasm/automated-cherry-pick-of-#9230-upstream-release-3.4
Automated cherry pick of #9230: fix(git,make): 修正 gitbranch 变量的获取方式,解决自动升级版本 tag 不统一的问题
2020-12-08 12:50:51 +08:00
wanyaoqi
5d69ae9a02 fix(region): attach network on register baremetal server 2020-12-08 12:08:17 +08:00
Zhang Dongliang
c3be526988 fix(git,make): 修正 gitbranch 变量的获取方式,允许外部传入,解决自动升级版本 tag 不统一的问题 2020-12-08 11:50:47 +08:00
Zexi Li
9d1267b0f7 Merge pull request #9188 from rainzm/automated-cherry-pick-of-#9183-upstream-release-3.4
Automated cherry pick of #9183: fix(region): inspect invalid guest template
2020-12-04 10:21:23 +08:00
rainzm
e762b2e2e0 fix(region): inspect invalid guest template
The glance service hangs and other external reasons may cause the guest template to be judged as invalid.
Therefore, health inspection should be performed on time for invalid guest templates.
2020-12-03 20:45:20 +08:00
Zexi Li
cfefa015fd Merge pull request #9177 from zexi/automated-cherry-pick-of-#9176-upstream-release-3.4
Automated cherry pick of #9176: fix(scheduler): select resource unordered
2020-12-03 19:55:25 +08:00
Zexi Li
986fa9881f fix(scheduler): select resource unordered 2020-12-03 18:42:50 +08:00
Zexi Li
ffe1c9050b Merge pull request #9175 from yousong/automated-cherry-pick-of-#8483-upstream-release-3.4
Automated cherry pick of #8483: fix: climc vpc-create missing cloudregion_id
2020-12-03 18:39:20 +08:00
Qiu Jian
07bcf6a7a7 fix: climc vpc-create missing cloudregion_id 2020-12-03 18:18:46 +08:00
Zexi Li
0e01df9200 Merge pull request #9166 from wanyaoqi/automated-cherry-pick-of-#9163-upstream-release-3.4
Automated cherry pick of #9163: bugfix(region): fix list by srever type normal
2020-12-03 14:43:27 +08:00
Zexi Li
9e5667c50a Merge pull request #9168 from zhaoxiangchun/automated-cherry-pick-of-#9138-upstream-release-3.4
Automated cherry pick of #9138: fix(monitor): modify influxdbSuggestDriver query err
2020-12-03 14:42:26 +08:00
zhaoxiangchun
fd7fe62930 fix(monitor): modify influxdbSuggestDriver query err
1.修复influxdb相关的建议规则查询数据失败的问题
2020-12-03 14:16:21 +08:00
wanyaoqi
eba5bd84df bugfix(region): fix list by srever type normal
server list by normal shouldn't contains gpu and backup servers

cherrypick: release/3.4
2020-12-03 12:54:28 +08:00
Zexi Li
9080fdbde3 Merge pull request #9157 from wanyaoqi/automated-cherry-pick-of-#9154-upstream-release-3.4
Automated cherry pick of #9154: feat(region): add list filter server type
2020-12-03 09:34:12 +08:00
Zexi Li
ec76d129f6 Merge pull request #9153 from ioito/automated-cherry-pick-of-#9150-upstream-release-3.4
Automated cherry pick of #9150: fix(region): avoid qcloud sync local disk error
2020-12-02 21:05:23 +08:00
wanyaoqi
ee9e59df88 feat(region): add list filter server type
list server by specific server type: normal, gpu, backup

cherrypick: release/3.4
2020-12-02 20:31:44 +08:00
Qu Xuan
c2765f5fda fix(region): avoid qcloud sync local disk error 2020-12-02 20:27:54 +08:00
Zexi Li
8cd9d39155 Merge pull request #9143 from swordqiu/automated-cherry-pick-of-#9140-upstream-release-3.4
Automated cherry pick of #9140: fix(keystone): not allow to disable sql driver
2020-12-02 17:08:49 +08:00
Qiu Jian
e77ca84876 fix(keystone): not allow to disable sql driver
not allow to disable default SQL identity_provider driver
2020-12-02 16:42:35 +08:00
Zexi Li
76ca993e8a Merge pull request #9107 from rainzm/automated-cherry-pick-of-#9104-upstream-release-3.4
Automated cherry pick of #9104: fix(notify): return the result of the second attempt to execute the rpc call
2020-12-01 21:03:29 +08:00
Zexi Li
aa96758354 Merge pull request #9112 from yousong/automated-cherry-pick-of-#9109-upstream-release-3.4
Automated cherry pick of #9109: fix(host): make sure it won't match vpc guests by accident
2020-12-01 20:21:11 +08:00
Zexi Li
8a35ef6bcc Merge pull request #9119 from rainzm/automated-cherry-pick-of-#9116-upstream-release-3.4
Automated cherry pick of #9116: fix(region): delete guest without 'purge' in GuestDetachScalingGroupTask
2020-12-01 19:32:16 +08:00
rainzm
e2ab5190c6 fix(notify): return the result of the second attempt to execute the rpc call 2020-12-01 18:25:37 +08:00
rainzm
af006498f8 fix(region): delete guest without 'purge' in GuestDetachScalingGroupTask 2020-12-01 16:03:36 +08:00
Yousong Zhou
b54ebf45f3 fix(host): make sure it won't match vpc guests by accident 2020-12-01 15:33:31 +08:00
Zexi Li
639e1f045c Merge pull request #9099 from yousong/automated-cherry-pick-of-#9096-upstream-release-3.4
Automated cherry pick of #9096: Bugfix/yousong informer
2020-12-01 09:34:11 +08:00
Yousong Zhou
1c68b97c86 fix(taskman): SSubTask: set model manager 2020-11-30 23:13:04 +08:00
Yousong Zhou
ec47e47734 fix(region): secgrouprule: set model manager 2020-11-30 23:13:04 +08:00
Zexi Li
76fd4945bd Merge pull request #9082 from yousong/automated-cherry-pick-of-#9079-upstream-release-3.4
Automated cherry pick of #9079: feat(region): options: allow setting default vpc external access mode
2020-11-30 21:49:15 +08:00
Zexi Li
60ca1f7266 Merge pull request #9090 from rainzm/automated-cherry-pick-of-#9086-upstream-release-3.4
Automated cherry pick of #9086: fix(region): sort excludedNets correctly
2020-11-30 21:47:44 +08:00
rainzm
220fb5bca5 fix(region): sort excludedNets correctly
之前,excludedNets 内部表示起始 IP 的字段是 string 类型,直接使用 <
比较是错误的。
现在,把 excludedNets 表示起始 IP 的字段改为了
netutils.IPV4Addr,这样就可以正确地进行比较排序了。
2020-11-30 19:06:12 +08:00
Yousong Zhou
0ea12ffcc6 feat(region): options: allow setting default vpc external access mode 2020-11-30 18:30:31 +08:00
Yousong Zhou
f80c6a214a fix(region): pass up error from InitializeData 2020-11-30 18:30:31 +08:00
Zexi Li
29343a6828 Merge pull request #9060 from ioito/automated-cherry-pick-of-#8995-upstream-release-3.4
Automated cherry pick of #8995: fix(cloudid): avoid new public account sync system policy delay 1 day
2020-11-30 14:13:01 +08:00
Qu Xuan
b9d08c74a3 fix(cloudid): avoid new public account sync system policy delay 1 day 2020-11-27 20:18:26 +08:00
Zexi Li
4b06ee94d0 Merge pull request #9031 from ioito/automated-cherry-pick-of-#9021-upstream-release-3.4
Automated cherry pick of #9021: fix(region): auto sync cloudaccount resources
2020-11-27 20:14:05 +08:00
yunion-ci-robot
bf625de12d Merge pull request #9039 from yousong/automated-cherry-pick-of-#9036-upstream-release-3.4
Automated cherry pick of #9036: feat(region): search server by substr of ip or mac
2020-11-27 18:46:36 +08:00
Zexi Li
60dbb28022 Merge pull request #9053 from wanyaoqi/automated-cherry-pick-of-#9049-upstream-release-3.4
Automated cherry pick of #9049: fix(region,scheduler): fix netwrok predicate
2020-11-27 18:44:08 +08:00
wanyaoqi
43407d3d77 fix(region,scheduler): fix netwrok predicate
1. Guest config to schedule input should include network exit propertites.
2. Guest migrate and create backup server should not check network count,
because of migrate and create backup server will not allocate new network to guest.

cherrypick: release/3.5
2020-11-27 18:41:17 +08:00
Yousong Zhou
9e5018b147 feat(region): search server by substr of ip or mac 2020-11-27 15:16:47 +08:00
Qu Xuan
43f5c84955 fix(region): auto sync cloudaccount resources 2020-11-27 09:51:48 +08:00
Zexi Li
91dd66b5a8 Merge pull request #9008 from yousong/automated-cherry-pick-of-#9005-upstream-release-3.4
Automated cherry pick of #9005: Feature/yousong ovn encap ip
2020-11-26 21:29:31 +08:00
Yousong Zhou
1615426f29 feat(host): add option OvnEncapIpDetectionMethod can-reach:xx 2020-11-26 17:12:18 +08:00
Yousong Zhou
3df0be2fd4 feat(netutils2): add MyIPTo 2020-11-26 17:12:18 +08:00
Zexi Li
7d9a3c04b1 Merge pull request #8986 from swordqiu/automated-cherry-pick-of-#8968-upstream-release-3.4
Automated cherry pick of #8968: fix(region,esxiagent): allow host behind a nat
2020-11-26 12:11:25 +08:00
Zexi Li
1a2204d146 Merge pull request #8923 from zhaoxiangchun/automated-cherry-pick-of-#8920-upstream-release-3.4
Automated cherry pick of #8920: fix(monitor): modify notify alertInfo and alertOk detach resource
2020-11-26 11:45:32 +08:00
yunion-ci-robot
ed6c42ae37 Merge pull request #8994 from zexi/automated-cherry-pick-of-#8991-upstream-release-3.4
Automated cherry pick of #8991: fix(scheduler): clean expire cache before schedule
2020-11-26 11:43:31 +08:00
Zexi Li
372c9a393f fix(region): wire get vpc releated hosts is empty 2020-11-26 11:03:52 +08:00
Zexi Li
37f648bfb8 fix(region): network clean schedule cache after real deleted 2020-11-26 11:03:52 +08:00
Zexi Li
1818d4853a fix(scheduler): clean expire cache before schedule 2020-11-26 11:03:52 +08:00
zhaoxiangchun
ff5396b909 fix(monitor): modify notify alertInfo and alertOk detach resource
1.修复报警信息中>等被转义的问题
2.针对:host_raid.adapter和smart_device.exit_status
  只能出现alerting和nodata
两种报警状态。在queryCondition的查询逻辑下,nodata情况也进行detach操作
3.修复报警记录中报警策略翻译异常的问题
2020-11-26 09:46:34 +08:00
Zexi Li
b2854aff23 Merge pull request #8956 from tb365/automated-cherry-pick-of-#8955-upstream-release-3.4
Automated cherry pick of #8955: fix(region): allow reset huawei system disk
2020-11-25 22:01:28 +08:00
Zexi Li
da30ae5efd Merge pull request #8964 from ioito/automated-cherry-pick-of-#8961-upstream-release-3.4
Automated cherry pick of #8961: fix(region): valid qcloud hssd for system disk
2020-11-25 21:59:40 +08:00
Zexi Li
17face8f52 Merge pull request #8981 from zhaoxiangchun/automated-cherry-pick-of-#8977-upstream-release-3.4
Automated cherry pick of #8977: fix(monitor): modify monitor serviceType in StartService()
2020-11-25 21:57:11 +08:00
Zexi Li
9a8277ff20 Merge pull request #8990 from rainzm/automated-cherry-pick-of-#8987-upstream-release-3.4
Automated cherry pick of #8987: fix(region): allow delete storagecachedimage with 'cache_failed' status
2020-11-25 21:55:55 +08:00
rainzm
61eaea8099 fix(region): allow delete storagecachedimage with 'cache_failed' status
Having status 'cache_failed' means this storagecachedimage does not actually exist.
2020-11-25 20:48:02 +08:00
Qiu Jian
6f0d6cbeac fix(region,esxiagent): allow host behind a nat
check host by ip may fail if host is behind a nat. ignore this case.
2020-11-25 20:34:42 +08:00
zhaoxiangchun
09ed698ae8 fix(monitor): modify monitor serviceType in StartService()
1.修改monitor服务在service代码中注册的serviceType:
   alerter ===> monitor
2020-11-25 20:31:19 +08:00
TangBin
7bf1bef04a fix(region): update translations 2020-11-25 18:17:40 +08:00
TangBin
024a17de83 fix(region): allow reset huawei system disk 2020-11-25 18:11:26 +08:00
Qu Xuan
0f5a8b6407 fix(region): valid qcloud hssd for system disk 2020-11-25 11:53:04 +08:00
Zexi Li
cd4ce681b0 Merge pull request #8954 from ioito/automated-cherry-pick-of-#8895-upstream-release-3.4
Automated cherry pick of #8895: fix(region): 避免OneCloud密码校验通过,公有云厂商密码校验不通过
2020-11-25 10:06:19 +08:00
Qu Xuan
fc16c37eab fix(region): 避免OneCloud密码校验通过,公有云厂商密码校验不通过 2020-11-25 09:56:37 +08:00
Zexi Li
3dfd086a27 Merge pull request #8950 from yousong/automated-cherry-pick-of-#8947-upstream-release-3.4
Automated cherry pick of #8947: fix(region): change_ipaddr: retain eip_id on detach and attach
2020-11-25 09:28:23 +08:00
yunion-ci-robot
8e2cd5112d Merge pull request #8945 from yousong/automated-cherry-pick-of-#8942-upstream-release-3.4
Automated cherry pick of #8942: feat(cloudcommon): db: jointbase: add list:"user" for RowId
2020-11-25 09:17:18 +08:00
Yousong Zhou
a5d82922bd fix(region): change_ipaddr: retain eip_id on detach and attach 2020-11-24 21:59:33 +08:00
Yousong Zhou
9d19bf34b0 fix(vpcagent): models: guestnetworks: accomodate change_ipaddr
change_ipaddr does detach, then attach of network.  It's not solely an
update of ipaddr, but a combination of deletion then creation.
2020-11-24 21:56:05 +08:00
Yousong Zhou
e4bf0fa8dc feat(cloudcommon): db: jointbase: add list:"user" for RowId 2020-11-24 21:56:05 +08:00
Zexi Li
6bd82d216d Merge pull request #8932 from tb365/bugfix/tb-elasticcache-empty-error-fix
fix(region): elastic cache task fail message fix
2020-11-24 21:31:09 +08:00
Zexi Li
60138f6401 Merge pull request #8927 from zhaoxiangchun/automated-cherry-pick-of-#8926-upstream-release-3.4
Automated cherry pick of #8926: fix(monitor): modify suggestrule  process influxdb data
2020-11-24 21:29:36 +08:00
yunion-ci-robot
a43f747bdc Merge pull request #8936 from ioito/automated-cherry-pick-of-#8933-upstream-release-3.4
Automated cherry pick of #8933: fix(region): avoid public ip bandwidth is zero
2020-11-24 20:25:27 +08:00
Qu Xuan
2560198943 fix(region): avoid public ip bandwidth is zero 2020-11-24 18:11:38 +08:00
zhaoxiangchun
6e0d4cb35c fix(monitor): modify suggestrule process influxdb data
1. 调整与监控相关的时间范围的判断逻辑:不再要求时间范围内必须都有数据
2020-11-24 17:48:05 +08:00
TangBin
71535f670e fix(region): elastic cache task fail message fix
#6399
2020-11-24 17:07:30 +08:00
Zexi Li
5e47566b42 Merge pull request #8900 from wanyaoqi/automated-cherry-pick-of-#8889-upstream-release-3.4
Automated cherry pick of #8889: fix(host): wait put host offline success
2020-11-23 13:04:31 +08:00
wanyaoqi
c325d8355c fix(host): wait put host offline success
Unregister host wait for host offline success,
in case region is in upgrading.

cherrypick: release/3.4
2020-11-22 15:30:56 +08:00
Zexi Li
206dc2a62d Merge pull request #8894 from yousong/automated-cherry-pick-of-#8892-upstream-release-3.4
Automated cherry pick of #8892: fix(locales): fix translation text
2020-11-22 11:00:07 +08:00
yunion-ci-robot
55a7de9ba6 Merge pull request #8867 from swordqiu/automated-cherry-pick-of-#8865-upstream-release-3.4
Automated cherry pick of #8865: fix: allow disk attach to multiple guests
2020-11-21 19:25:00 +08:00
Yousong Zhou
3b2938380a fix(region): elasticcache_instances: fix error fmt 2020-11-21 17:36:36 +08:00
Yousong Zhou
3774549979 fix(locales): fix translation text 2020-11-21 17:35:45 +08:00
Zexi Li
9c2cc664f6 Merge pull request #8883 from ioito/hotfix/qx-rds-network-params
fix(region): compatible rds network params
2020-11-20 12:03:19 +08:00
Qu Xuan
42582043ee fix(region): compatible rds network params 2020-11-20 11:44:10 +08:00
Zexi Li
690aef8f4e Merge pull request #8875 from ioito/automated-cherry-pick-of-#8873-upstream-release-3.4
Automated cherry pick of #8873: optimized: server delete log and wait time
2020-11-20 10:04:32 +08:00
Zexi Li
eb7173085e Merge pull request #8880 from ioito/automated-cherry-pick-of-#8876-upstream-release-3.4
Automated cherry pick of #8876: feat: rds recovery new instance from backup supported
2020-11-19 20:53:14 +08:00
Qu Xuan
b6917c5604 feat: rds recovery new instance from backup supported 2020-11-19 20:39:56 +08:00
Qu Xuan
47349e71b9 optimized: server delete log and wait time 2020-11-19 16:27:18 +08:00
Qiu Jian
3d2b24a351 fix: allow disk attach to multiple guests 2020-11-19 13:27:30 +08:00
Zexi Li
b9565f288a Merge pull request #8862 from swordqiu/automated-cherry-pick-of-#8860-upstream-release-3.4
Automated cherry pick of #8860: fix: add host.memoty.total and host.cpu.total usage stats
2020-11-19 11:03:21 +08:00
Qiu Jian
6b0ae74acb fix: add host.memoty.total and host.cpu.total usage stats 2020-11-19 01:26:37 +08:00
Zexi Li
438a0cb0b7 Merge pull request #8846 from zhaoxiangchun/automated-cherry-pick-of-#8844-upstream-release-3.4
Automated cherry pick of #8844: detach AlertResource on alertDisable
2020-11-18 21:16:36 +08:00
Zexi Li
3fb97c99b6 Merge pull request #8852 from swordqiu/automated-cherry-pick-of-#8850-upstream-release-3.4
Automated cherry pick of #8850: fix: add host-joint resources into domain level resources
2020-11-18 21:15:07 +08:00
yunion-ci-robot
ad8459053f Merge pull request #8855 from zhasm/automated-cherry-pick-of-#8849-upstream-release-3.4
Automated cherry pick of #8849: docker 交叉编译规则更新
2020-11-18 16:36:13 +08:00
Zhang Dongliang
491a9ece55 docker 交叉编译规则更新 2020-11-18 16:14:31 +08:00
Qiu Jian
ba2a188f0d fix: add host-joint resources into domain level resources 2020-11-18 15:26:39 +08:00
zhaoxiangchun
ea793d9902 detach AlertResource on alertDisable
1. 报警规则禁用时,detach 关联的报警资源

影响范围:报警规则的禁用;logger日志服务i18n的日志展示
2020-11-18 12:21:25 +08:00
Zexi Li
4b4964e58e Merge pull request #8840 from rainzm/automated-cherry-pick-of-#8827-upstream-release-3.4
Automated cherry pick of #8827: fix(notify): be compatible with keystone's UsersV3.GetById
2020-11-17 17:52:11 +08:00
rainzm
4a06b38da8 fix: add err handler for notifyRobot 2020-11-17 17:13:15 +08:00
rainzm
96400124ba feat(notify): enable watching user in keystone 2020-11-17 17:13:15 +08:00
rainzm
aee0299d71 fix(notify): be compatible with keystone's UsersV3.GetById
Fill UsersV3.GetById with user's name, it will return user's info.
2020-11-17 17:13:15 +08:00
Zexi Li
cbea17b4c4 Merge pull request #8835 from ioito/automated-cherry-pick-of-#8823-upstream-release-3.4
Automated cherry pick of #8823: optimized: aliyun create rds backup
2020-11-17 14:52:30 +08:00
Zexi Li
4acb237f70 Merge pull request #8833 from zhaoxiangchun/automated-cherry-pick-of-#8816-upstream-release-3.4
Automated cherry pick of #8816: modify  alertResource ws info
2020-11-17 14:51:29 +08:00
Qu Xuan
3a8e998718 optimized: aliyun create rds backup 2020-11-17 14:30:42 +08:00
zhaoxiangchun
bef9af4c3b modify alertResource ws info
ignore_alert:ture 前端不再进行弹窗提示
2020-11-17 14:23:28 +08:00
Zexi Li
3e17ee7519 Merge pull request #8805 from wanyaoqi/automated-cherry-pick-of-#8803-upstream-release-3.4
Automated cherry pick of #8803: host: restart etcd session on keepalive failed
2020-11-17 14:20:24 +08:00
yunion-ci-robot
d3aba7285a Merge pull request #8819 from ioito/automated-cherry-pick-of-#8817-upstream-release-3.4
Automated cherry pick of #8817: fix: add error cause
2020-11-16 21:42:06 +08:00
Qu Xuan
43f4f5f946 fix: add error cause 2020-11-16 14:57:37 +08:00
Zexi Li
4d3c7f3059 Merge pull request #8785 from tb365/automated-cherry-pick-of-#8783-upstream-release-3.4
Automated cherry pick of #8783: aliyun finance cloud region add suffix
2020-11-15 08:00:55 +08:00
Zexi Li
fd26fc1947 Merge pull request #8808 from zhaoxiangchun/automated-cherry-pick-of-#8806-upstream-release-3.4
Automated cherry pick of #8806: commonalert bugfix:
2020-11-15 07:55:32 +08:00
Zexi Li
b74f61fe1d Merge pull request #8811 from swordqiu/automated-cherry-pick-of-#8809-upstream-release-3.4
Automated cherry pick of #8809: fix: baremetal usage should exclude converted hypervisor
2020-11-15 07:52:46 +08:00
Qiu Jian
dc19e7b035 fix: baremetal usage should exclude converted hypervisor 2020-11-15 01:42:32 +08:00
zhaoxiangchun
37272588fa commonalert bugfix:
1.修改消息模版内容:对matches信息进行聚合只返回对应的name信息。解决body消息超过限制
2.报警资源:每次以策略匹配的最新matches为标准。进行updateOrCreate 和
  delete操作。

影响范围:消息模版、报警资源数量
2020-11-14 18:44:14 +08:00
wanyaoqi
029530ac34 host: restart etcd session on keepalive failed 2020-11-14 15:27:10 +08:00
yunion-ci-robot
c047d69a53 Merge pull request #8802 from swordqiu/automated-cherry-pick-of-#8800-upstream-release-3.4
Automated cherry pick of #8800: fix: host memory usage status not correct
2020-11-14 11:22:04 +08:00
yunion-ci-robot
6f76c5d670 Merge pull request #8798 from yousong/automated-cherry-pick-of-#8796-upstream-release-3.4
Automated cherry pick of #8796: vendor: update yunion.io/x/jsonutils
2020-11-14 00:11:06 +08:00
Qiu Jian
71ddac232d fix: host memory usage status not correct 2020-11-13 23:59:51 +08:00
Yousong Zhou
ca9859f126 vendor: update yunion.io/x/jsonutils
See yunionio/onecloud#8357
2020-11-13 18:46:27 +08:00
Zexi Li
7db6ad9a01 Merge pull request #8788 from swordqiu/automated-cherry-pick-of-#8786-upstream-release-3.4
Automated cherry pick of #8786: fix: keystone init empty catalogy cause panic
2020-11-13 15:24:09 +08:00
Qiu Jian
b545066e05 fix: keystone init empty catalogy cause panic 2020-11-13 14:56:24 +08:00
TangBin
befef016dc aliyun finance cloud zone add suffix 2020-11-13 14:44:30 +08:00
TangBin
c32ad0ac5b aliyun finance cloud region add suffix 2020-11-13 14:44:29 +08:00
Zexi Li
ecc75aa231 Merge pull request #8773 from swordqiu/automated-cherry-pick-of-#8771-upstream-release-3.4
Automated cherry pick of #8771: feature: allow join project across domain
2020-11-13 10:39:50 +08:00
Zexi Li
202e0bf266 Merge pull request #8778 from zhaoxiangchun/automated-cherry-pick-of-#8776-upstream-release-3.4
Automated cherry pick of #8776: suggestalet bugfix
2020-11-13 10:39:14 +08:00
zhaoxiangchun
c4d4700d26 suggestalet bugfix
1.安全组规则的in规则为全开放的主机 筛选逻辑修改
2.修复无法正确过滤用户所属资源的bug
2020-11-12 21:32:15 +08:00
Qiu Jian
1fce2ec30c feature: allow join project across domain 2020-11-12 20:41:27 +08:00
Zexi Li
dfe7661c61 Merge pull request #8762 from ioito/automated-cherry-pick-of-#8760-upstream-release-3.4
Automated cherry pick of #8760: fix: avoid panic
2020-11-12 19:31:31 +08:00
Zexi Li
5a28b3c13e Merge pull request #8766 from ioito/automated-cherry-pick-of-#8764-upstream-release-3.4
Automated cherry pick of #8764: fix: support resize qcloud hssd disk
2020-11-12 18:51:40 +08:00
Qu Xuan
27c8861b64 fix: support resize qcloud hssd disk 2020-11-12 16:48:17 +08:00
Qu Xuan
e9459b4a7d fix: avoid panic 2020-11-12 16:20:16 +08:00
yunion-ci-robot
5861a18051 Merge pull request #8755 from rainzm/automated-cherry-pick-of-#8753-upstream-release-3.4
Automated cherry pick of #8753: fix(region): prevent infinite recursion
2020-11-12 11:54:03 +08:00
rainzm
0bbe2e7590 fix(region): prevent infinite recursion
When weekDays is [1,2,3,4,5,6,7] and timePoints is [0], It will recurse infinitely.
2020-11-12 11:39:58 +08:00
Zexi Li
b93d695fe9 Merge pull request #8751 from ioito/automated-cherry-pick-of-#8749-upstream-release-3.4
Automated cherry pick of #8749: fix: renew rds
2020-11-12 00:49:52 +08:00
Qu Xuan
39fe8b2133 fix: renew rds 2020-11-11 20:20:25 +08:00
Zexi Li
c357d61add Merge pull request #8725 from tb365/automated-cherry-pick-of-#8723-upstream-release-3.4
Automated cherry pick of #8723: batch user create bugifx
2020-11-11 11:57:08 +08:00
Zexi Li
749ca9dc63 Merge pull request #8745 from wanyaoqi/automated-cherry-pick-of-#8722-upstream-release-3.4
Automated cherry pick of #8722: add success note on guest start and stop
2020-11-11 11:55:48 +08:00
Zexi Li
5aa0bbb091 Merge pull request #8721 from tb365/automated-cherry-pick-of-#8719-upstream-release-3.4
Automated cherry pick of #8719: huawei create disk bugfix
2020-11-11 11:54:17 +08:00
wanyaoqi
7d35397d50 host: specifie bash for start guest 2020-11-11 11:05:30 +08:00
wanyaoqi
30776fc707 usage: host show isolated dev reserved memory 2020-11-11 11:05:30 +08:00
wanyaoqi
ea70090f6b add success note on guest start and stop 2020-11-11 11:05:30 +08:00
TangBin
e9a4a6380e batch user create bugifx 2020-11-10 16:49:49 +08:00
TangBin
642b137332 huawei create disk bugfix 2020-11-10 16:18:05 +08:00
Zexi Li
ce60116ba3 Merge pull request #8717 from ioito/automated-cherry-pick-of-#8715-upstream-release-3.4
Automated cherry pick of #8715: fix: aws secgroup out rule is deny any
2020-11-10 12:54:34 +08:00
Qu Xuan
1ee8fd05b3 fix: aws secgroup out rule is deny any 2020-11-10 11:04:58 +08:00
Zexi Li
e1d1ef0dd8 Merge pull request #8695 from lvyangyang/automated-cherry-pick-of-#8694-upstream-release-3.4
Automated cherry pick of #8694: fix:修复dns record name校验的问题
2020-11-07 18:42:59 +08:00
lvyangyang
e108d17556 fix:修复dns record name校验的问题 2020-11-06 19:59:52 +08:00
yunion-ci-robot
fe6cb8a9cf Merge pull request #8691 from swordqiu/automated-cherry-pick-of-#8689-upstream-release-3.4
Automated cherry pick of #8689: fix: change owner should update quota usages
2020-11-06 15:11:19 +08:00
yunion-ci-robot
9a9f77c9d9 Merge pull request #8688 from rainzm/automated-cherry-pick-of-#8686-upstream-release-3.4
Automated cherry pick of #8686: feat(region): add option NoCheckOsTypeForCachedImage
2020-11-06 15:07:17 +08:00
yunion-ci-robot
35ac1f9fdd Merge pull request #8685 from ioito/automated-cherry-pick-of-#8683-upstream-release-3.4
Automated cherry pick of #8683: fix: aliyun eip api
2020-11-06 15:04:20 +08:00
Qiu Jian
6927652a65 fix: change owner should update quota usages 2020-11-06 14:48:29 +08:00
Zexi Li
c4afca7187 Merge pull request #8682 from ioito/automated-cherry-pick-of-#8680-upstream-release-3.4
Automated cherry pick of #8680: fix: 支持多内存过滤套餐
2020-11-06 13:50:07 +08:00
Zexi Li
a49d0b280c Merge pull request #8679 from swordqiu/automated-cherry-pick-of-#8677-upstream-release-3.4
Automated cherry pick of #8677: fix: missing column error when order by extra fields
2020-11-06 13:49:42 +08:00
Zexi Li
f797f062f8 Merge pull request #8674 from zexi/automated-cherry-pick-of-#8672-upstream-release-3.4
Automated cherry pick of #8672: scheduler: ignore non running guests only exclude ready status
2020-11-06 13:48:23 +08:00
rainzm
6f60f1a48b fix(esxi): don't specify spec.Identity when osName is empty 2020-11-06 12:58:51 +08:00
rainzm
c3b8e7bbd4 fix(esxi): add device after cloning vm 2020-11-06 12:57:19 +08:00
rainzm
edc651a308 refactor(region): faster GetIImageById 2020-11-06 12:01:41 +08:00
rainzm
76b1796c7e refactor(region): faster sync CapacityUsed for Storage
1. replace cronjob SyncCapacityUsedForStorage with
SyncCapacityUsedForEsxiStorage
2. do not sync capacityUsed for storage when deleting and creating vm
for now because of performance issues。
2020-11-06 12:01:41 +08:00
rainzm
b5201a352f feat(region): add option NoCheckOsTypeForCachedImage 2020-11-06 12:01:41 +08:00
Qu Xuan
fc4460fa39 fix: aliyun eip api 2020-11-06 11:10:32 +08:00
Qu Xuan
e975fc6713 fix: 支持多内存过滤套餐 2020-11-06 10:32:20 +08:00
Qiu Jian
c8ddd7653f fix: missing column error when order by extra fields 2020-11-05 23:52:32 +08:00
Zexi Li
827be9167e scheduler: ignore non running guests only exclude ready status 2020-11-05 18:23:51 +08:00
Zexi Li
f55022a26d Merge pull request #8666 from swordqiu/automated-cherry-pick-of-#8664-upstream-release-3.4
Automated cherry pick of #8664: update vendor for jsonutils
2020-11-05 13:10:35 +08:00
Qiu Jian
aae3da8c2b update vendor for jsonutils 2020-11-05 11:34:28 +08:00
yunion-ci-robot
e6828a1665 Merge pull request #8656 from lvyangyang/automated-cherry-pick-of-#8655-upstream-release-3.4
Automated cherry pick of #8655: fix:域名正则校验dnsrecord name,同步中文域名取punycode
2020-11-04 18:42:10 +08:00
lvyangyang
6bfff8b70d fix:域名正则校验dnsrecord name,同步中文域名取punycode 2020-11-04 17:38:27 +08:00
Zexi Li
a3753fc311 Merge pull request #8634 from tb365/automated-cherry-pick-of-#8633-upstream-release-3.4
Automated cherry pick of #8633: aws create bugfix
2020-11-04 11:19:57 +08:00
Zexi Li
2b7ba4df63 Merge pull request #8642 from rainzm/automated-cherry-pick-of-#8640-upstream-release-3.4
Automated cherry pick of #8640: fix(notify): customize the title of the verification email based on the copyright
2020-11-04 10:57:16 +08:00
Zexi Li
4fde5eab04 Merge pull request #8639 from ioito/automated-cherry-pick-of-#8636-upstream-release-3.4
Automated cherry pick of #8636: fix: add qcloud hssd
2020-11-03 20:41:32 +08:00
rainzm
58c5514a01 fix(notify): customize the title of the verification email based on the copyright 2020-11-03 20:26:52 +08:00
Qu Xuan
0c19c21efa fix: add qcloud hssd 2020-11-03 20:22:07 +08:00
TangBin
41dd48e8fa lbcert cache delete bugfix 2020-11-03 16:40:37 +08:00
TangBin
3ceb0e2dc1 aws create bugfix 2020-11-03 16:40:37 +08:00
Zexi Li
ab479aea26 Merge pull request #8623 from wanyaoqi/automated-cherry-pick-of-#8619-upstream-release-3.4
Automated cherry pick of #8619: fix stream disk on add disk from snapshot
2020-11-03 10:40:01 +08:00
wanyaoqi
82f5b9ccb0 fix stream disk on add disk from snapshot 2020-11-02 19:32:37 +08:00
Zexi Li
4d7b6ef36d Merge pull request #8615 from ioito/automated-cherry-pick-of-#8613-upstream-release-3.4
Automated cherry pick of #8613: optimized: rds zone sync
2020-11-02 19:12:44 +08:00
Qu Xuan
83d0a3ce0c optimized: rds zone sync 2020-11-02 16:52:08 +08:00
yunion-ci-robot
10b4ebfd01 Merge pull request #8606 from rainzm/automated-cherry-pick-of-#8603-upstream-release-3.4
Automated cherry pick of #8603: fix(region): compute NextSyncTime for snapshotpolicydisk
2020-11-02 01:43:45 +08:00
yunion-ci-robot
bc5f255bc7 Merge pull request #8610 from swordqiu/automated-cherry-pick-of-#8608-upstream-release-3.4
Automated cherry pick of #8608: fix: save service config changes may send invalid action log
2020-11-01 11:48:48 +08:00
Qiu Jian
c8138c291b fix: save service config changes may send invalid action log 2020-10-31 19:06:22 +08:00
Rain Zheng
f290aa5d58 fix(region): compute NextSyncTime for snapshotpolicydisk
1. 如果计算出来的 NextSyncTime 和 base 相等,可以将 base 加1一个小时递归处理。
2. 对于 retentionday 有效的快照策略,比如某一个 snaphsotpolicy
是每周一生效,并且打的快照自动保留 3 天,那么,就应该在每周一(打快照)
和每周四(释放快照)进行快照的同步。
2020-10-31 15:50:51 +08:00
yunion-ci-robot
a6f97fc759 Merge pull request #8595 from rainzm/automated-cherry-pick-of-#8593-upstream-release-3.4
Automated cherry pick of #8593: fix(region): prevent dirty data when syncing snapshot
2020-10-30 19:38:45 +08:00
yunion-ci-robot
dfeee78717 Merge pull request #8592 from ioito/automated-cherry-pick-of-#8590-upstream-release-3.4
Automated cherry pick of #8590: fix: secgroup cache tenant_id
2020-10-30 19:34:56 +08:00
rainzm
7460ea1461 fix(region): clear dirty data of snapshotpolicydisks when start up 2020-10-30 15:24:56 +08:00
rainzm
250ad41c7b fix(region): detach all snapshotpolicy when realdeleting disk 2020-10-30 15:24:56 +08:00
rainzm
a53a44cb2e fix(region): prevent dirty data when syncing snapshot 2020-10-30 15:24:56 +08:00
Qu Xuan
4cbe931635 fix: secgroup cache tenant_id 2020-10-30 15:04:25 +08:00
yunion-ci-robot
45fc6d0ff1 Merge pull request #8578 from rainzm/automated-cherry-pick-of-#8576-upstream-release-3.4
Automated cherry pick of #8576: fix(region): sync automatically snapshot for external disk
2020-10-30 09:11:44 +08:00
yunion-ci-robot
a1b72712ec Merge pull request #8561 from zexi/automated-cherry-pick-of-#8558-upstream-release-3.4
Automated cherry pick of #8558: informer: ignore outside context cancel when worker run
2020-10-30 00:37:44 +08:00
yunion-ci-robot
8e474c5961 Merge pull request #8579 from tb365/automated-cherry-pick-of-#8573-upstream-release-3.4
Automated cherry pick of #8573: qcloud elb cert duplicate fix
2020-10-29 23:28:43 +08:00
TangBin
8f2f78b4ed qcloud elb cert duplicate fix 2020-10-29 22:37:09 +08:00
rainzm
a3f01f1330 fix(region): sync automatically snapshot for external disk 2020-10-29 22:32:21 +08:00
Zexi Li
a0f495db93 informer: ignore outside context cancel when worker run 2020-10-29 20:54:00 +08:00
yunion-ci-robot
605f3fea26 Merge pull request #8566 from rainzm/automated-cherry-pick-of-#8564-upstream-release-3.4
Automated cherry pick of #8564: update vendor
2020-10-29 20:08:43 +08:00
rainzm
52a72952c9 update vendor 2020-10-29 17:25:58 +08:00
Yousong Zhou
4eb1292a2d Merge pull request #8550 from swordqiu/automated-cherry-pick-of-#8548-upstream-release-3.4
Automated cherry pick of #8548: fix: fail to delete public_ip eip
2020-10-29 10:18:33 +08:00
Qiu Jian
b1e91c1c27 fix: fail to delete public_ip eip 2020-10-28 23:46:20 +08:00
yunion-ci-robot
a1760d7b86 Merge pull request #8537 from rainzm/automated-cherry-pick-of-#8535-upstream-release-3.4
Automated cherry pick of #8535: refactor(region): faster list for cachedimage
2020-10-28 17:58:42 +08:00
rainzm
c456586860 refactor(region): faster list for cachedimage
Pro version of #8440 with checking the necessity of id filtering
2020-10-28 15:36:03 +08:00
yunion-ci-robot
71e759a032 Merge pull request #8527 from rainzm/automated-cherry-pick-of-#8525-upstream-release-3.4
Automated cherry pick of #8525: fix(esxi): no callback in uploadHandler
2020-10-28 00:59:42 +08:00
yunion-ci-robot
96ce64d5f0 Merge pull request #8514 from ioito/automated-cherry-pick-of-#8512-upstream-release-3.4
Automated cherry pick of #8512: fix: avoid sync project panic
2020-10-28 00:48:42 +08:00
rainzm
d31802c87b fix(esxi): filter vmdk item in lease.info 2020-10-27 21:32:21 +08:00
rainzm
d3964bf0d1 fix(esxi): use correct device index
1. Sort devices via their Key.
2. There is no relationship between vdisk index and vnics length.
2020-10-27 21:32:21 +08:00
rainzm
57dad6281a fix(esxi): no callback in uploadHandler 2020-10-27 21:32:21 +08:00
Zexi Li
b74130903e Merge pull request #8519 from ioito/automated-cherry-pick-of-#8517-upstream-release-3.4
Automated cherry pick of #8517: fix: set secgroup status
2020-10-27 17:28:39 +08:00
Qu Xuan
44046f2861 fix: set secgroup status 2020-10-27 16:20:06 +08:00
Qu Xuan
95f7600b67 fix: avoid sync project panic 2020-10-27 16:13:48 +08:00
yunion-ci-robot
749b819a62 Merge pull request #8501 from yousong/automated-cherry-pick-of-#8499-upstream-release-3.4
Automated cherry pick of #8499: lockman: test: add prefix setting
2020-10-26 21:24:40 +08:00
Yousong Zhou
f7f7c7be81 lockman: test: add prefix setting 2020-10-26 20:36:32 +08:00
yunion-ci-robot
6a221dbc1e Merge pull request #8498 from zhaoxiangchun/automated-cherry-pick-of-#8496-upstream-release-3.4
Automated cherry pick of #8496: commalertUpdateInput increat param:
2020-10-26 19:55:47 +08:00
zhaoxiangchun
002a2af272 commalertUpdateInput increat param:
1.处理operator对alertType == system的报警策略的update请求
2020-10-26 18:21:11 +08:00
yunion-ci-robot
1757d3d6a9 Merge pull request #8494 from rainzm/automated-cherry-pick-of-#8493-upstream-release-3.4
Automated cherry pick of #8493: fix(region): roll back the optimization of cachedimage list
2020-10-26 18:17:39 +08:00
rainzm
be5a6a93cc fix(region): roll back the optimization of cachedimage list 2020-10-26 17:37:59 +08:00
yunion-ci-robot
bbbe78dbef Merge pull request #8489 from ioito/automated-cherry-pick-of-#8487-upstream-release-3.4
Automated cherry pick of #8487: fix: avoid delete public ip when sync eip list
2020-10-26 17:02:42 +08:00
Qu Xuan
a851e01330 fix: avoid delete public ip when sync eip list 2020-10-26 16:18:46 +08:00
yunion-ci-robot
29d06d52dd Merge pull request #8466 from wanyaoqi/automated-cherry-pick-of-#8464-upstream-release-3.4
Automated cherry pick of #8464: check disk is in reset before delete snapshot
2020-10-25 10:54:39 +08:00
yunion-ci-robot
1a6d4d1035 Merge pull request #8486 from swordqiu/automated-cherry-pick-of-#8484-upstream-release-3.4
Automated cherry pick of #8484: fix: server usage status not correct
2020-10-25 10:52:41 +08:00
Qiu Jian
90d649aef9 fix: server usage status not correct 2020-10-25 08:38:48 +08:00
Zexi Li
23b99a6232 Merge pull request #8472 from wanyaoqi/automated-cherry-pick-of-#8470-upstream-release-3.4
Automated cherry pick of #8470: fix on stream disk complete snapshots refcount not update
2020-10-24 13:09:42 +08:00
Zexi Li
16c38fe6be Merge pull request #8476 from zexi/automated-cherry-pick-of-#8474-upstream-release-3.4
Automated cherry pick of #8474: monitor: set default influxdb datasource by endpoint type
2020-10-24 13:07:07 +08:00
Zexi Li
b43f8b3fac monitor: set default influxdb datasource by endpoint type 2020-10-23 20:10:08 +08:00
wanyaoqi
8e5b74a3f6 fix on stream disk complete snapshots refcount not update 2020-10-23 19:11:32 +08:00
yunion-ci-robot
b0cd3bf999 Merge pull request #8414 from zhaoxiangchun/automated-cherry-pick-of-#8412-upstream-release-3.4
Automated cherry pick of #8412: bugfix:
2020-10-23 18:35:17 +08:00
yunion-ci-robot
4a15284684 Merge pull request #8463 from rainzm/automated-cherry-pick-of-#8461-upstream-release-3.4
Automated cherry pick of #8461: fix(glance): allow public and private operations of guestimage
2020-10-23 18:29:15 +08:00
wanyaoqi
d78068d43a check disk is in reset before delete snapshot 2020-10-23 18:26:22 +08:00
yunion-ci-robot
80dce5eafb Merge pull request #8452 from wanyaoqi/automated-cherry-pick-of-#8450-upstream-release-3.4
Automated cherry pick of #8450: host increase cpu mem max size
2020-10-23 18:18:20 +08:00
yunion-ci-robot
950696ddb9 Merge pull request #8458 from rainzm/automated-cherry-pick-of-#8456-upstream-release-3.4
Automated cherry pick of #8456: fix(esxi): resize root disk after cloning vm
2020-10-23 18:17:20 +08:00
zhaoxiangchun
e7674116e1 bugfix:
1.资源报警增加websocket 消息通知:admin用户
2.统一influxdb中查询到的tag展示
2020-10-23 17:58:20 +08:00
rainzm
3fae388db5 fix(glance): allow public and private operations of guestimage
The public and private operations of the guest image depends on these operations of the subimage.
2020-10-23 17:57:48 +08:00
rainzm
8f3b8c7ff1 fix(esxi): resize root disk after cloning vm
The root disk size set when the machine is cloned does not take effect,
so set the root disk size after the machine is cloned.
2020-10-23 17:03:52 +08:00
wanyaoqi
a4b1d3952d host increase cpu mem max size 2020-10-23 15:15:55 +08:00
yunion-ci-robot
a5ef16243d Merge pull request #8442 from rainzm/automated-cherry-pick-of-#8440-upstream-release-3.4
Automated cherry pick of #8440: refactor(region): faster list for cachedimage
2020-10-22 21:25:14 +08:00
rainzm
b0823a09bb refactor(region): faster list for cachedimage
修改之前:
诸如provider, zone, host_schedtag_id, valid
等过滤条件,是通过过滤出符合条件的 storagecachedimage 然后使用 cachedimage_id 来过滤 cachedimge,
问题是,每一个过滤条件都会独立的去执行上面的过程,这样同样的查询可能要经过很多次,并且如果遇到
弱的过滤条件,比如 valid ,过滤出来的 storagecachedimage
非常之多,然后在使用 cachedimage_id 去过滤 cachedimage,会非常慢。

修改之后:
过滤条件的相似的逻辑合并起来,只需要向 subQuery 中添加 filter,使用 subQuery 一次把 storagecachedimage
过滤出来,然后使用 cachedimage_id 过滤 cachedimage。
2020-10-22 20:18:40 +08:00
yunion-ci-robot
492920ac7c Merge pull request #8428 from ioito/automated-cherry-pick-of-#8426-upstream-release-3.4
Automated cherry pick of #8426: fix: 避免冲掉设置的到期释放时间
2020-10-22 20:13:22 +08:00
yunion-ci-robot
f96ac33175 Merge pull request #8433 from lvyangyang/automated-cherry-pick-of-#8416-upstream-release-3.4
Automated cherry pick of #8416: fix:get all project dns resource
2020-10-22 20:10:19 +08:00
yunion-ci-robot
1bc16d6f2e Merge pull request #8439 from rainzm/automated-cherry-pick-of-#8437-upstream-release-3.4
Automated cherry pick of #8437: fix(region): add suffix 'display' for time_points and repeat_weekdays
2020-10-22 20:07:17 +08:00
rainzm
0ba8cb7fbd fix: don't update NextSyncTime when snapshots that should be added has not 2020-10-22 19:42:26 +08:00
rainzm
93bb4022f2 fix(region): init NextSyncTimeiwhen create snapshotpolicydisks 2020-10-22 19:42:26 +08:00
rainzm
bbfb9db90a fix(region): add suffix 'display' for time_points and repeat_weekdays
TimePoints and RepeatWeekdays in SnapshotPolicyDetails is duplicated
with thess in SnapshotPolicy, which result in the fault of reponse for
request GET.
2020-10-22 19:42:26 +08:00
lvyangyang
66c81ee548 fix:get all project dns resource 2020-10-22 17:06:00 +08:00
Qu Xuan
8f3cb9cdbb fix: 避免冲掉设置的到期释放时间 2020-10-22 15:41:19 +08:00
yunion-ci-robot
1ac71d0016 Merge pull request #8409 from wanyaoqi/automated-cherry-pick-of-#8407-upstream-release-3.4
Automated cherry pick of #8407: fix informer backend
2020-10-22 15:04:16 +08:00
yunion-ci-robot
e8238a2cf5 Merge pull request #8425 from ioito/automated-cherry-pick-of-#8423-upstream-release-3.4
Automated cherry pick of #8423: fix: add aliyun new region
2020-10-22 14:31:17 +08:00
Qu Xuan
22349276d9 fix: add aliyun new region 2020-10-22 11:53:08 +08:00
wanyaoqi
d6a9b5dac2 fix informer backend 2020-10-21 10:54:14 +08:00
yunion-ci-robot
0e3aa96f77 Merge pull request #8406 from rainzm/automated-cherry-pick-of-#8404-upstream-release-3.4
Automated cherry pick of #8404: fix(notify): add AllOkContactTypes in where permanently enabled and verified ContactType
2020-10-21 10:51:16 +08:00
rainzm
5306add70a feat(notify): add IntelliNotify
IntelliNotify will try to create receiver nonexistent if createReceiver is set to true
2020-10-20 20:38:17 +08:00
rainzm
f367f1abef fix(notify): add AllOkContactTypes in where permanently enabled and verified ContactType 2020-10-20 20:38:17 +08:00
Zexi Li
93dc36134d Merge pull request #8402 from wanyaoqi/automated-cherry-pick-of-#8400-upstream-release-3.4
Automated cherry pick of #8400: fix fetch customize columns
2020-10-20 18:52:56 +08:00
wanyaoqi
f706d59ac5 fix fetch customize columns 2020-10-20 18:43:52 +08:00
Zexi Li
7438bcab23 Merge pull request #8339 from tb365/automated-cherry-pick-of-#8338-upstream-release-3.4
Automated cherry pick of #8338: add aliyun finance environment
2020-10-20 13:33:47 +08:00
yunion-ci-robot
e038eebeb7 Merge pull request #8263 from rainzm/automated-cherry-pick-of-#8258-upstream-release-3.4
Automated cherry pick of #8258: feat: add a retry mechanism to AutoSyncExtDiskSnapshot
2020-10-20 13:31:13 +08:00
Zexi Li
bd7d84aebd Merge pull request #8396 from tb365/automated-cherry-pick-of-#8395-upstream-release-3.4
Automated cherry pick of #8395: lbcert delete bugfix
2020-10-20 13:28:31 +08:00
Zexi Li
5f6f554464 Merge pull request #8398 from zexi/automated-cherry-pick-of-#8397-upstream-release-3.4
Automated cherry pick of #8397: fix: monitor commonalert not detach alert resource
2020-10-20 13:26:51 +08:00
Zexi Li
d99d93d046 fix: monitor commonalert not detach alert resource 2020-10-20 13:21:22 +08:00
Zexi Li
4a856ac688 Merge pull request #8393 from rainzm/automated-cherry-pick-of-#8392-upstream-release-3.4
Automated cherry pick of #8392: fix(region): compute binded disk count when deleting snapshotpolicy
2020-10-20 11:49:52 +08:00
TangBin
7da0a67af5 lbcert delete bugfix 2020-10-20 11:27:53 +08:00
rainzm
37c14d756d feat: use details data to cover obj data in FetchCustomizeColumns 2020-10-20 11:20:45 +08:00
rainzm
6f1417d268 fix(region): compute binded disk count when deleting snapshotpolicy 2020-10-20 11:20:45 +08:00
Zexi Li
b3105a05d3 Merge pull request #8322 from ioito/automated-cherry-pick-of-#8321-upstream-release-3.4
Automated cherry pick of #8321: fix: sync dns records after sync vpcs
2020-10-20 11:19:50 +08:00
rainzm
93ac3260a1 feat: add a retry mechanism to AutoSyncExtDiskSnapshot 2020-10-20 09:54:53 +08:00
yunion-ci-robot
3d39c20c91 Merge pull request #8391 from zhaoxiangchun/automated-cherry-pick-of-#8390-upstream-release-3.4
Automated cherry pick of #8390: bugfix: commonalert
2020-10-19 23:19:23 +08:00
zhaoxiangchun
8a0eeb7d67 bugfix: commonalert
1.报警消息中取消返回sql信息
2.commonalert 中支持top bottom 结构influxdb 查询
2020-10-19 23:06:29 +08:00
yunion-ci-robot
163be04dbb Merge pull request #8364 from zhaoxiangchun/automated-cherry-pick-of-#8357-upstream-release-3.4
Automated cherry pick of #8357: bugfix: qcloud pull metric
2020-10-19 22:34:14 +08:00
zhaoxiangchun
06db7339e4 bugfix: qcloud pull metric
get请求中增加region参数
2020-10-19 22:26:52 +08:00
yunion-ci-robot
e5b3f4673d Merge pull request #8387 from zexi/automated-cherry-pick-of-#8346-upstream-release-3.4
Automated cherry pick of #8346: monitor: add alert resource
2020-10-19 22:13:12 +08:00
yunion-ci-robot
3a6e910580 Merge pull request #8380 from yousong/automated-cherry-pick-of-#8379-upstream-release-3.4
Automated cherry pick of #8379: logger: actionlog: readability change
2020-10-19 22:07:12 +08:00
Zexi Li
0317fad04e Merge pull request #8389 from wanyaoqi/automated-cherry-pick-of-#8388-upstream-release-3.4
Automated cherry pick of #8388: remove try set informer backend
2020-10-19 22:02:39 +08:00
Zexi Li
af11737e79 monitor: add alert resource 2020-10-19 21:48:35 +08:00
wanyaoqi
15bd6bacd6 remove try set informer backend 2020-10-19 21:33:49 +08:00
Zexi Li
28ba60f630 Merge pull request #8386 from wanyaoqi/automated-cherry-pick-of-#8385-upstream-release-3.4
Automated cherry pick of #8385: telegraf-raid-plugin: update raid state to lower case
2020-10-19 21:00:06 +08:00
yunion-ci-robot
8799a0bcf9 Merge pull request #8384 from wanyaoqi/automated-cherry-pick-of-#8383-upstream-release-3.4
Automated cherry pick of #8383: keystone init etcd backend
2020-10-19 20:58:13 +08:00
wanyaoqi
6706c39f85 telegraf-raid-plugin: update raid state to lower case 2020-10-19 20:12:47 +08:00
wanyaoqi
8ce183eaf5 keystone init etcd backend 2020-10-19 20:04:42 +08:00
yunion-ci-robot
a5bec974f1 Merge pull request #8345 from rainzm/automated-cherry-pick-of-#8344-upstream-release-3.4
Automated cherry pick of #8344: feat(notify): support webhook contact type
2020-10-19 18:25:11 +08:00
Zexi Li
ac15981b5d Merge pull request #8377 from swordqiu/automated-cherry-pick-of-#8350-upstream-release-3.4
Automated cherry pick of #8350: fix: missing authenticate action log for user web login
2020-10-19 17:44:44 +08:00
Zexi Li
3c447a32f6 Merge pull request #8342 from swordqiu/automated-cherry-pick-of-#8337-upstream-release-3.4
Automated cherry pick of #8337: fix: cancel pending-delete should increase resource quota usages
2020-10-19 17:44:03 +08:00
yunion-ci-robot
3a8809e060 Merge pull request #8341 from rainzm/automated-cherry-pick-of-#8340-upstream-release-3.4
Automated cherry pick of #8340: feat: add valid filter for cachedimage list
2020-10-19 17:13:11 +08:00
Yousong Zhou
0964c6ad82 logger: actionlog: i18n for distinct-field 2020-10-19 16:42:24 +08:00
Yousong Zhou
5d0fd14cb3 cloudcommon: db: GET: i18n for result of get property calls 2020-10-19 16:42:24 +08:00
Yousong Zhou
cd123e007d cloudcommon: db: add man.GetI18N 2020-10-19 16:42:24 +08:00
Yousong Zhou
91736710ba cloudcommon: db: modelbase: distinct-field: readability change 2020-10-19 16:42:24 +08:00
Yousong Zhou
c2589e7352 logger: actionlog: readability change 2020-10-19 16:42:24 +08:00
rainzm
d454b0a792 feat: add valid filter for cachedimage list
Use the 'valid' switch to control whether to filter out
the cachedimage corresponding to invalid storage
2020-10-19 16:28:04 +08:00
Qiu Jian
2a1a640f6b fix: cancel pending-delete should increase resource quota usages 2020-10-19 16:03:26 +08:00
rainzm
9dee4c1b90 feat(region): call NotifyWebhook in the life cycle of guests 2020-10-19 16:02:55 +08:00
rainzm
0fd6481e4d feat: add NotifyWebhook in notifyclient 2020-10-19 16:02:55 +08:00
rainzm
d799a71fdb feat(notify): allow empty receivers for robot or webhook contact type 2020-10-19 16:02:55 +08:00
rainzm
436f1e5cb9 feat(notify): support webhook contact type 2020-10-19 16:02:55 +08:00
Qiu Jian
a92a0e2d05 fix: missing authenticate action log for user web login 2020-10-19 15:54:10 +08:00
yunion-ci-robot
0cafa996d7 Merge pull request #8362 from swordqiu/automated-cherry-pick-of-#8361-upstream-release-3.4
Automated cherry pick of #8361: fix: do not lock guest after lock eip, to prevent possible dead lock
2020-10-19 15:20:12 +08:00
yunion-ci-robot
2a10b72f98 Merge pull request #8348 from swordqiu/automated-cherry-pick-of-#8347-upstream-release-3.4
Automated cherry pick of #8347: fix: remote update metadata may cause metadata update loop
2020-10-19 15:19:16 +08:00
yunion-ci-robot
31c2b6270a Merge pull request #8354 from swordqiu/automated-cherry-pick-of-#8353-upstream-release-3.4
Automated cherry pick of #8353: fix: reduce change config logs
2020-10-19 15:18:18 +08:00
yunion-ci-robot
a6397d18c2 Merge pull request #8351 from swordqiu/automated-cherry-pick-of-#8350-upstream-release-3.4
Automated cherry pick of #8350: fix: missing authenticate action log for user web login
2020-10-19 15:17:12 +08:00
Zexi Li
203bf44639 Merge pull request #8367 from ioito/automated-cherry-pick-of-#8366-upstream-release-3.4
Automated cherry pick of #8366: fix: add rds cpu and memory usage
2020-10-19 15:11:56 +08:00
Zexi Li
d7a4e52b15 Merge pull request #8374 from ioito/automated-cherry-pick-of-#8373-upstream-release-3.4
Automated cherry pick of #8373: fix: 新增google存储类型
2020-10-19 15:11:08 +08:00
Zexi Li
7946dcef3f Merge pull request #8370 from ioito/automated-cherry-pick-of-#8369-upstream-release-3.4
Automated cherry pick of #8369: fix: use correct worker
2020-10-19 15:10:00 +08:00
Qu Xuan
f77bcd3bbf fix: 新增google存储类型 2020-10-19 14:16:51 +08:00
yunion-ci-robot
4841fbb843 Merge pull request #8356 from wanyaoqi/automated-cherry-pick-of-#8355-upstream-release-3.4
Automated cherry pick of #8355: host: fix sync storage info duration'
2020-10-19 11:57:12 +08:00
Qiu Jian
9b8758e191 fix: reduce change config logs 2020-10-19 11:51:38 +08:00
Qiu Jian
62f5355b11 fix: remote update metadata may cause metadata update loop 2020-10-19 11:46:20 +08:00
Qiu Jian
d774581a23 fix: do not lock guest after lock eip, to prevent possible dead lock 2020-10-19 11:43:22 +08:00
Qu Xuan
062301f54a fix: use correct worker 2020-10-19 11:42:25 +08:00
Qu Xuan
16d13941ce fix: add rds cpu and memory usage 2020-10-19 11:23:21 +08:00
yunion-ci-robot
a10b1945f6 Merge pull request #8359 from yousong/automated-cherry-pick-of-#8358-upstream-release-3.4
Automated cherry pick of #8358: .circleci: build: make with parallel level 2
2020-10-19 10:50:16 +08:00
Yousong Zhou
3aadaf15b7 .circleci: build: make with parallel level 2 2020-10-19 10:29:50 +08:00
wanyaoqi
7a9b491d13 host: fix sync storage info duration' 2020-10-18 01:02:12 +08:00
Qiu Jian
ecbe76e9ff fix: missing authenticate action log for user web login 2020-10-17 22:09:55 +08:00
yunion-ci-robot
41bdfffd57 Merge pull request #8333 from rainzm/automated-cherry-pick-of-#8332-upstream-release-3.4
Automated cherry pick of #8332: feat: support lock storage from selected cachedimage
2020-10-17 18:23:10 +08:00
TangBin
a9c44ed304 add aliyun finance environment 2020-10-17 17:41:57 +08:00
rainzm
7a2c2b8047 refactor: find the most suitable storage 2020-10-17 17:40:08 +08:00
rainzm
a35a6f3c11 feat(esxiagent): try to customize vm if deployfs failed 2020-10-17 17:40:08 +08:00
rainzm
5a7876ae47 feat: support lock storage from selected cachedimage 2020-10-17 17:40:08 +08:00
yunion-ci-robot
31de731cbd Merge pull request #8336 from wanyaoqi/automated-cherry-pick-of-#8325-upstream-release-3.4
Automated cherry pick of #8325: telegraf raid plugin
2020-10-17 11:23:11 +08:00
wanyaoqi
8b2680ed56 telegraf raid plugin 2020-10-17 11:11:30 +08:00
yunion-ci-robot
39c35359aa Merge pull request #8329 from swordqiu/automated-cherry-pick-of-#8304-upstream-release-3.4
Automated cherry pick of #8304: feature: qcloud create VM with tags
2020-10-16 22:19:05 +08:00
Qiu Jian
a764a64696 feature: remote update qcloud instance metadata and name 2020-10-16 21:41:33 +08:00
Qiu Jian
f05a56aadd feature: qcloud create VM with tags 2020-10-16 21:41:33 +08:00
yunion-ci-robot
6cd69d3587 Merge pull request #8335 from rainzm/automated-cherry-pick-of-#8334-upstream-release-3.4
Automated cherry pick of #8334: fix(compute): filter cachedimage with health storage
2020-10-16 19:41:45 +08:00
rainzm
2a1bbfd574 fix(compute): filter cachedimage with health storage 2020-10-16 18:38:44 +08:00
Qu Xuan
11f8e4f71f fix: sync dns records after sync vpcs 2020-10-16 11:14:44 +08:00
534 changed files with 14493 additions and 7855 deletions

View File

@@ -38,7 +38,7 @@ jobs:
command: |
targets="$(circleci tests glob "cmd/*" | grep -v cmd/host-image | circleci tests split)"
echo $targets | tr ' ' '\n'
make -j3 $targets
make -j2 $targets
ls -lh _output/bin/
- save_cache:
key: onecloud-build-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}

1
.gitignore vendored
View File

@@ -31,6 +31,7 @@ _output
/structargtest
.idea
.vscode
intellij.yaml
GPATH
GRTAGS
GTAGS

View File

@@ -9,7 +9,7 @@ BUILD_SCRIPT := $(ROOT_DIR)/build/build.sh
ifeq ($(ONECLOUD_CI_BUILD),)
GIT_COMMIT := $(shell git rev-parse --short HEAD)
GIT_BRANCH := $(shell git name-rev --name-only HEAD)
GIT_BRANCH := $(shell git branch -r --contains | head -1 | sed -E -e "s%(HEAD ->|origin|upstream)/?%%g" | xargs)
GIT_VERSION := $(shell git describe --always --tags --abbrev=14 $(GIT_COMMIT)^{commit})
GIT_TREE_STATE := $(shell s=`git status --porcelain 2>/dev/null`; if [ -z "$$s" ]; then echo "clean"; else echo "dirty"; fi)
BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')

View File

@@ -0,0 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/yunion-rootfs:v1.0
ADD ./_output/bin/telegraf-raid-plugin /opt/yunion/bin/telegraf-raid-plugin

View File

@@ -1,18 +0,0 @@
## {{.title}}
- 时间: {{.start_time}}
- 级别: {{.level}}
- 详情地址: {{.web_url}}/commonalerts
{{ range .matches}}
- 指标: {{.metric}}
- 触发值: {{html .value_str}}
### 触发条件:
- {{html $.description}}
### 标签
> 名称: {{ index .tags "name" }}
> ip: {{ index .tags "ip" }}
> 平台: {{ index .tags "brand" }}
------
{{- end}}

View File

@@ -1,18 +0,0 @@
## {{.title}}
- Time: {{.start_time}}
- Level: {{.level}}
- WebUrl: {{.web_url}}/commonalerts
{{ range .matches}}
- Metric: {{.metric}}
- Trigger value: {{html .value_str}}
### Trigger condition:
- {{html $.description }}
### Label
> Name: {{ index .tags "name" }}
> IP: {{ index .tags "ip" }}
> Brand: {{ index .tags "brand" }}
------
{{- end}}

View File

@@ -0,0 +1,9 @@
{{.title}}
策略名称: {{.name}}
触发时间: {{.start_time}}
报警级别: {{.level}}
触发条件: {{.description | unescaped}}
资源数量:{{len .matches}}
资源名称:{{.resource_name}}
详情地址: {{.web_url}}/commonalerts

View File

@@ -0,0 +1,9 @@
{{.title}}
AlertName: {{.name}}
Time: {{.start_time}}
Level: {{.level}}
TriggerCondition: {{.description | unescaped}}
ResourceCount: {{len .matches}}
ResourceName: {{.resource_name}}
WebUrl: {{.web_url}}/commonalerts

View File

@@ -1 +1 @@
Yunion Verify
{{.copyright}} Verify

View File

@@ -28,6 +28,7 @@ import (
type BaseOptions struct {
Debug bool `help:"debug mode"`
Help bool `help:"Show help"`
CloudEnv string `help:"Cloud environment" default:"$ALIYUN_CLOUD_ENV" choices:"InternationalCloud|FinanceCloud" metavar:"ALIYUN_CLOUD_ENV"`
AccessKey string `help:"Access key" default:"$ALIYUN_ACCESS_KEY" metavar:"ALIYUN_ACCESS_KEY"`
Secret string `help:"Secret" default:"$ALIYUN_SECRET" metavar:"ALIYUN_SECRET"`
RegionId string `help:"RegionId" default:"$ALIYUN_REGION" metavar:"ALIYUN_REGION"`
@@ -86,7 +87,9 @@ func newClient(options *BaseOptions) (*aliyun.SRegion, error) {
cli, err := aliyun.NewAliyunClient(
aliyun.NewAliyunClientConfig(
options.AccessKey, options.Secret,
options.CloudEnv,
options.AccessKey,
options.Secret,
).Debug(options.Debug),
)
if err != nil {

View File

@@ -15,9 +15,14 @@
package main
import (
"context"
"yunion.io/x/onecloud/pkg/ansibleserver/service"
"yunion.io/x/onecloud/pkg/util/procutils"
)
func main() {
go procutils.WaitZombieLoop(context.TODO())
service.StartService()
}

View File

@@ -15,12 +15,17 @@
package main
import (
"context"
"yunion.io/x/onecloud/pkg/baremetal/service"
"yunion.io/x/onecloud/pkg/util/atexit"
"yunion.io/x/onecloud/pkg/util/procutils"
)
func main() {
defer atexit.Handle()
go procutils.WaitZombieLoop(context.TODO())
service.New().StartService()
}

View File

@@ -29,6 +29,7 @@ func init() {
Zone string `help:"show images cached at zone"`
HostSchedtagId string `help:"filter cached image with host schedtag"`
Valid *bool `help:"valid cachedimage"`
}
R(&CachedImageListOptions{}, "cached-image-list", "List cached images", func(s *mcclient.ClientSession, args *CachedImageListOptions) error {
params, err := options.ListStructToParams(args)

View File

@@ -19,6 +19,7 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
@@ -26,6 +27,23 @@ import (
)
func init() {
cmd := shell.NewResourceCmd(&modules.Cloudregions).WithKeyword("cloud-region")
cmd.PerformClass("sync-skus", &options.CloudregionSkuSyncOptions{})
R(&options.SkuTaskQueryOptions{}, "cloud-region-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
params, err := args.Params()
if err != nil {
return err
}
result, err := modules.Cloudregions.Get(s, "sync-tasks", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type CloudregionListOptions struct {
options.BaseListOptions

View File

@@ -15,12 +15,30 @@
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.DBInstanceSkus).WithKeyword("dbinstance-sku")
cmd.PerformClass("sync-skus", &options.SkuSyncOptions{})
R(&options.SkuTaskQueryOptions{}, "dbinstance-sku-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
params, err := args.Params()
if err != nil {
return err
}
result, err := modules.DBInstanceSkus.Get(s, "sync-tasks", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type DBInstanceSkuListOption struct {
options.BaseListOptions
Engine string
@@ -54,5 +72,4 @@ func init() {
printObject(result)
return nil
})
}

View File

@@ -19,12 +19,30 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.ElasticcacheSkus).WithKeyword("elastic-cache-sku")
cmd.PerformClass("sync-skus", &options.SkuSyncOptions{})
R(&options.SkuTaskQueryOptions{}, "elastic-cache-sku-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
params, err := args.Params()
if err != nil {
return err
}
result, err := modules.ElasticcacheSkus.Get(s, "sync-tasks", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.BaseListOptions{}, "elastic-cache-list", "List elastisc cache instance", func(s *mcclient.ClientSession, opts *options.BaseListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {

View File

@@ -50,7 +50,7 @@ func init() {
Manager string `help:"cloud provider"`
Region string `help:"cloud region in which EIP is allocated"`
Bandwidth int `help:"Bandwidth in Mbps"`
Ip string `help:"IP address of the EIP"`
IpAddr string `help:"IP address of the EIP" json:"ip_addr"`
Network string `help:"Network of the EIP"`
ChargeType string `help:"bandwidth charge type" choices:"traffic|bandwidth"`
}
@@ -75,8 +75,8 @@ func init() {
params.Add(jsonutils.NewString(args.Network), "network")
}
if len(args.Ip) > 0 {
params.Add(jsonutils.NewString(args.Ip), "ip")
if len(args.IpAddr) > 0 {
params.Add(jsonutils.NewString(args.IpAddr), "ip_addr")
}
result, err := modules.Elasticips.Create(s, params)

View File

@@ -407,12 +407,14 @@ func init() {
})
type HostAddNetIfOptions struct {
ID string `help:"ID or Name of host"`
WIRE string `help:"ID or Name of wire to attach"`
MAC string `help:"Mac address of NIC"`
INDEX int64 `help:"nic index"`
Type string `help:"Nic type" choices:"admin|ipmi"`
IpAddr string `help:"IP address"`
ID string `help:"ID or Name of host"`
WIRE string `help:"ID or Name of wire to attach"`
MAC string `help:"Mac address of NIC"`
INDEX int64 `help:"nic index"`
Type string `help:"Nic type" choices:"admin|ipmi"`
IpAddr string `help:"IP address"`
Bridge string `help:"Bridge of hostwire"`
Interface string `help:"Interface name, eg:eth0, en0"`
}
R(&HostAddNetIfOptions{}, "host-add-netif", "Host add a NIC", func(s *mcclient.ClientSession, args *HostAddNetIfOptions) error {
params := jsonutils.NewDict()
@@ -426,6 +428,12 @@ func init() {
if len(args.IpAddr) > 0 {
params.Add(jsonutils.NewString(args.IpAddr), "ip_addr")
}
if len(args.Bridge) > 0 {
params.Add(jsonutils.NewString(args.Bridge), "bridge")
}
if len(args.Interface) > 0 {
params.Add(jsonutils.NewString(args.Interface), "interface")
}
result, err := modules.Hosts.PerformAction(s, args.ID, "add-netif", params)
if err != nil {
return err

View File

@@ -316,7 +316,7 @@ func init() {
QuotaSetBaseOptions
IdentityQuotaOptions
}
R(&IdentityQuotaSetOptions{}, "identity-quota-set", "Set identity quota for domain", func(s *mcclient.ClientSession, args *InfrasQuotaSetOptions) error {
R(&IdentityQuotaSetOptions{}, "identity-quota-set", "Set identity quota for domain", func(s *mcclient.ClientSession, args *IdentityQuotaSetOptions) error {
params := jsonutils.Marshal(args)
quotas, e := modules.IdentityQuotas.DoQuotaSet(s, params)
if e != nil {

View File

@@ -123,9 +123,10 @@ func init() {
})
type SchedulerHistoryListOptions struct {
Limit int `default:"50" help:"Page limit"`
Offset int `default:"0" help:"Page offset"`
All bool `help:"Show all histories, including scheduler-test"`
Limit int `default:"50" help:"Page limit"`
Offset int `default:"0" help:"Page offset"`
All bool `help:"Show all histories, including scheduler-test"`
IsSuggestion bool `help:"Only show forcast suggestion history"`
}
R(&SchedulerHistoryListOptions{}, "scheduler-history-list", "Show scheduler history list",
func(s *mcclient.ClientSession, args *SchedulerHistoryListOptions) error {
@@ -138,17 +139,14 @@ func init() {
if args.Offset > 0 {
params.Add(jsonutils.NewInt(int64(args.Offset)), "offset")
}
if args.All {
params.Add(jsonutils.JSONTrue, "all")
} else {
params.Add(jsonutils.JSONFalse, "all")
}
params.Add(jsonutils.NewBool(args.All), "all")
params.Add(jsonutils.NewBool(args.IsSuggestion), "is_suggestion")
result, err := modules.SchedManager.HistoryList(s, params)
if err != nil {
return err
}
printList(modulebase.JSON2ListResult(result), []string{
"session_id", "time", "status", "consuming",
"session_id", "time", "status", "consuming", "is_suggestion",
})
return nil
})

View File

@@ -34,4 +34,5 @@ func init() {
cmd.Perform("cache-secgroup", &options.SecurityGroupCacheOptions{})
cmd.Perform("uncache-secgroup", &options.SecurityGroupUncacheSecurityGroup{})
cmd.Perform("purge", &options.SecgroupIdOptions{})
cmd.Perform("change-owner", &options.SecgroupChangeOwnerOptions{})
}

View File

@@ -83,6 +83,7 @@ func init() {
cmd.Perform("publicip-to-eip", new(options.ServerPublicipToEip))
cmd.Perform("set-auto-renew", new(options.ServerSetAutoRenew))
cmd.Perform("save-template", new(options.ServerSaveImageOptions))
cmd.Perform("remote-update", new(options.ServerRemoteUpdateOptions))
cmd.Get("vnc", new(options.ServerIdOptions))
cmd.Get("desc", new(options.ServerIdOptions))

View File

@@ -17,12 +17,30 @@ package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.ServerSkus).WithKeyword("server-sku")
cmd.PerformClass("sync-skus", &options.SkuSyncOptions{})
R(&options.SkuTaskQueryOptions{}, "server-sku-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
params, err := args.Params()
if err != nil {
return err
}
result, err := modules.ServerSkus.Get(s, "sync-tasks", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type ServerSkusListOptions struct {
options.BaseListOptions
Cloudregion string `help:"region Id or name"`

View File

@@ -61,13 +61,14 @@ func init() {
ID string `help:"ID or Name of storage to update"`
Name string `help:"New Name of storage"`
Desc string `help:"Description"`
CommitBound float64 `help:"Upper bound of storage overcommit rate"`
CommitBound float64 `help:"Upper bound of storage overcommit rate" json:"cmtbound"`
MediumType string `help:"Medium type" choices:"ssd|rotate"`
RbdRadosMonOpTimeout int64 `help:"ceph rados_mon_op_timeout"`
RbdRadosOsdOpTimeout int64 `help:"ceph rados_osd_op_timeout"`
RbdClientMountTimeout int64 `help:"ceph client_mount_timeout"`
RbdKey string `help:"ceph rbd key"`
Reserved string `help:"Reserved storage space"`
Capacity int `help:"Capacity for storage"`
}
R(&StorageUpdateOptions{}, "storage-update", "Update a storage", func(s *mcclient.ClientSession, args *StorageUpdateOptions) error {
params, err := options.StructToParams(args)

View File

@@ -42,34 +42,24 @@ func init() {
if err != nil {
return err
}
connParams, err := obj.GetString("connect_params")
if err != nil {
resp := &webconsole_api.ServerRemoteConsoleResponse{}
if err := obj.Unmarshal(resp); err != nil {
return err
}
if decodeStr, err := base64.StdEncoding.DecodeString(connParams); err == nil {
connParams = string(decodeStr)
}
var query url.Values
connUrl, err := url.ParseRequestURI(connParams)
if err == nil {
query = connUrl.Query()
} else {
query, err = url.ParseQuery(connParams)
if err != nil {
return err
}
}
protocol := query.Get("protocol")
if !utils.IsInStringArray(protocol, []string{
connectParams := resp.GetConnectParams()
if protocol, err := resp.GetConnectProtocol(); err != nil {
return err
} else if !utils.IsInStringArray(protocol, []string{
command.PROTOCOL_TTY, webconsole_api.VNC,
webconsole_api.SPICE, webconsole_api.WMKS,
}) {
fmt.Println(connParams)
fmt.Println(connectParams)
return nil
}
newQuery := url.Values(make(map[string][]string))
newQuery.Set("data", base64.StdEncoding.EncodeToString([]byte(connParams)))
newQuery := url.Values{}
newQuery.Set("data", base64.StdEncoding.EncodeToString([]byte(connectParams)))
u.RawQuery = newQuery.Encode()
fmt.Println(u.String())
return nil

View File

@@ -488,7 +488,7 @@ func (cmd JointCmd) List(args IJointListOpt) {
if len(args.GetMasterOpt()) > 0 {
result, err = man.ListDescendent(s, args.GetMasterOpt(), params)
} else if len(args.GetSlaveOpt()) > 0 {
result, err = man.ListDescendent2(s, args.GetMasterOpt(), params)
result, err = man.ListDescendent2(s, args.GetSlaveOpt(), params)
} else {
result, err = man.List(s, params)
}

View File

@@ -30,6 +30,7 @@ import (
"yunion.io/x/onecloud/pkg/mcclient/auth"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
"yunion.io/x/onecloud/pkg/util/fileutils2"
"yunion.io/x/onecloud/pkg/util/rbacutils"
"yunion.io/x/onecloud/pkg/util/shellutils"
)
@@ -183,6 +184,7 @@ func init() {
type PolicyShowOptions struct {
ID string `help:"ID of policy"`
Format string `help:"policy format, default yaml" default:"yaml" choices:"yaml|json"`
Save string `help:"save policy data into a file"`
}
R(&PolicyShowOptions{}, "policy-show", "Show policy", func(s *mcclient.ClientSession, args *PolicyShowOptions) error {
query := jsonutils.NewDict()
@@ -192,6 +194,15 @@ func init() {
return err
}
printObject(result)
if len(args.Save) > 0 {
if args.Format == "yaml" {
yaml, _ := result.GetString("policy")
fileutils2.FilePutContents(args.Save, yaml, false)
} else {
p, _ := result.Get("policy")
fileutils2.FilePutContents(args.Save, p.PrettyString(), false)
}
}
return nil
})

View File

@@ -36,6 +36,8 @@ func init() {
Email string `help:"The Email"`
Docs *string `help:"the Docs website address"`
License *string `help:"the license generator website address"`
BrandCn *string `help:"the brand name in Chinese"`
BrandEn *string `help:"the brand name in English"`
}
R(&CopyrightUpdateOptions{}, "copyright-update", "update copyright", func(s *mcclient.ClientSession, args *CopyrightUpdateOptions) error {
@@ -52,6 +54,14 @@ func init() {
params.Add(jsonutils.NewString(*args.License), "license")
}
if args.BrandCn != nil {
params.Add(jsonutils.NewString(*args.BrandCn), "brand_cn")
}
if args.BrandEn != nil {
params.Add(jsonutils.NewString(*args.BrandEn), "brand_en")
}
if len(args.Copyright) > 0 {
params.Add(jsonutils.NewString(args.Copyright), "copyright")
}

View File

@@ -0,0 +1,31 @@
// 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 monitor
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
func init() {
cmd := shell.NewResourceCmd(monitor.AlertResources)
cmd.List(new(options.AlertResourceListOptions))
cmd.Show(new(options.AlertResourceShowOptions))
cmd.BatchDelete(new(options.AlertResourceDeleteOptions))
jCmd := shell.NewJointCmd(monitor.AlertResourceAlert)
jCmd.List(new(options.AlertResourceAlertListOptions))
}

View File

@@ -12,5 +12,6 @@ func init() {
cmd.Show(new(options.CommonAlertShowOptions))
cmd.Perform("enable", &options.CommonAlertShowOptions{})
cmd.Perform("disable", &options.CommonAlertShowOptions{})
cmd.Delete(new(options.CommonAlertDeleteOptions))
cmd.BatchDelete(new(options.CommonAlertDeleteOptions))
cmd.Perform("config", &options.CommonAlertUpdateOptions{})
}

View File

@@ -27,7 +27,7 @@ func init() {
cmd.Show(new(options.SuggestRuleShowOptions))
cmd.Perform("enable", new(options.SuggestRuleShowOptions))
cmd.Perform("disable", new(options.SuggestRuleShowOptions))
cmd.Delete(new(options.CommonAlertDeleteOptions))
cmd.BatchDelete(new(options.CommonAlertDeleteOptions))
cmd.Perform("config", new(options.SuggestRuleConfigOptions))
}

View File

@@ -15,12 +15,17 @@
package main
import (
"context"
"yunion.io/x/onecloud/pkg/esxi/service"
"yunion.io/x/onecloud/pkg/util/atexit"
"yunion.io/x/onecloud/pkg/util/procutils"
)
func main() {
defer atexit.Handle()
go procutils.WaitZombieLoop(context.TODO())
service.New().StartService()
}

View File

@@ -15,12 +15,17 @@
package main
import (
"context"
"yunion.io/x/onecloud/pkg/image/service"
"yunion.io/x/onecloud/pkg/util/atexit"
"yunion.io/x/onecloud/pkg/util/procutils"
)
func main() {
defer atexit.Handle()
go procutils.WaitZombieLoop(context.TODO())
service.StartService()
}

View File

@@ -14,9 +14,16 @@
package main
import "yunion.io/x/onecloud/pkg/hostman/hostdeployer/deployserver"
import (
"context"
"yunion.io/x/onecloud/pkg/hostman/hostdeployer/deployserver"
"yunion.io/x/onecloud/pkg/util/procutils"
)
func main() {
go procutils.WaitZombieLoop(context.TODO())
deployer := deployserver.NewDeployService()
deployer.StartService()
}

View File

@@ -15,14 +15,19 @@
package main
import (
"context"
"yunion.io/x/onecloud/pkg/cloudcommon/service"
"yunion.io/x/onecloud/pkg/hostman"
"yunion.io/x/onecloud/pkg/util/atexit"
"yunion.io/x/onecloud/pkg/util/procutils"
)
func main() {
defer atexit.Handle()
go procutils.WaitZombieLoop(context.TODO())
var srv = &hostman.SHostService{}
srv.SServiceBase = &service.SServiceBase{
Service: srv,

View File

@@ -33,7 +33,8 @@ type BaseOptions struct {
Host string `help:"SSH Host IP" default:"$RAID_HOST" metavar:"RAID_HOST"`
Username string `help:"Username, usually root" default:"$RAID_USERNAME" metavar:"RAID_USERNAME"`
Password string `help:"Password" default:"$RAID_PASSWORD" metavar:"RAID_PASSWORD"`
Driver string `help:"Password" default:"$RAID_DRIVER" metavar:"RAID_DRIVER" choices:"MegaRaid|HPSARaid|Mpt2SAS|MarvelRaid"`
Driver string `help:"Raid dirver" default:"$RAID_DRIVER" metavar:"RAID_DRIVER" choices:"MegaRaid|HPSARaid|Mpt2SAS|MarvelRaid"`
LocalHost bool `help:"Run raidcli in localhost"`
SUBCOMMAND string `help:"s3cli subcommand" subcommand:"true"`
}
@@ -83,43 +84,48 @@ func showErrorAndExit(e error) {
}
func newClient() (raid.IRaidDriver, error) {
if len(options.Host) == 0 {
return nil, fmt.Errorf("Missing host")
}
if len(options.Username) == 0 {
return nil, fmt.Errorf("Missing username")
}
if len(options.Password) == 0 {
return nil, fmt.Errorf("Missing password")
if options.Debug {
raid.Debug = true
}
if len(options.Driver) == 0 {
return nil, fmt.Errorf("Missing driver")
}
if options.Debug {
raid.Debug = true
var drv raid.IRaidDriver
if !options.LocalHost {
if len(options.Host) == 0 {
return nil, fmt.Errorf("Missing host")
}
if len(options.Username) == 0 {
return nil, fmt.Errorf("Missing username")
}
if len(options.Password) == 0 {
return nil, fmt.Errorf("Missing password")
}
sshClient, err := ssh.NewClient(
options.Host,
22,
options.Username,
options.Password,
"",
)
if err != nil {
return nil, fmt.Errorf("ssh client init fail: %s", err)
}
drv = drivers.GetDriver(options.Driver, sshClient)
if drv == nil {
return nil, fmt.Errorf("not supported driver %s", options.Driver)
}
} else {
drv = drivers.GetLocalDriver(options.Driver)
}
sshClient, err := ssh.NewClient(
options.Host,
22,
options.Username,
options.Password,
"",
)
if err != nil {
return nil, fmt.Errorf("ssh client init fail: %s", err)
}
drv := drivers.GetDriver(options.Driver, sshClient)
if drv == nil {
return nil, fmt.Errorf("not supported driver %s", options.Driver)
}
err = drv.ParsePhyDevs()
err := drv.ParsePhyDevs()
if err != nil {
return nil, fmt.Errorf("parse phyical devices error %s", err)
}

View File

@@ -0,0 +1,193 @@
package main
import (
"context"
"fmt"
"os"
"strings"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/onecloud/pkg/baremetal/utils/detect_storages"
"yunion.io/x/onecloud/pkg/baremetal/utils/raid/drivers"
"yunion.io/x/onecloud/pkg/compute/baremetal"
"yunion.io/x/onecloud/pkg/util/httputils"
)
const (
INTERVAL_SECOND = 300
TelegrafServer = "http://localhost:8087/write"
)
// Failed, Offline, Degraded, Rebuilding, Out of Sync (OSY)
func main() {
// creates the in-cluster config
config, err := rest.InClusterConfig()
if err != nil {
log.Fatalln(err)
}
// creates the clientset
clientset, err := kubernetes.NewForConfig(config)
if err != nil {
log.Fatalln(err)
}
nodeName := os.Getenv("NODENAME")
if len(nodeName) == 0 {
log.Fatalf("Missing env nodename")
}
node, err := clientset.CoreV1().Nodes().Get(nodeName, metav1.GetOptions{})
if err != nil {
log.Fatalln(err)
}
var masterAddress string
if length := len(node.Status.Conditions); length > 0 {
if node.Status.Conditions[length-1].Type == v1.NodeReady &&
node.Status.Conditions[length-1].Status == v1.ConditionTrue {
for _, addr := range node.Status.Addresses {
if addr.Type == v1.NodeInternalIP {
masterAddress = addr.Address
break
}
}
}
}
log.Infof("Start Colloct Raid Info And Send To Telegraf ...")
c := NewRaidInfoCollector(nodeName, masterAddress, INTERVAL_SECOND)
c.Start()
}
type RaidInfoCollector struct {
waitingReportData []string
LastCollectTime time.Time
ReportInterval int // seconds
Hostname string
HostIp string
}
func NewRaidInfoCollector(hostname, hostIp string, interval int) *RaidInfoCollector {
return &RaidInfoCollector{
waitingReportData: make([]string, 0),
ReportInterval: interval,
Hostname: hostname,
HostIp: hostIp,
}
}
func (c *RaidInfoCollector) runMain() {
timeBegin := time.Now()
elapse := timeBegin.Sub(c.LastCollectTime)
if elapse < time.Second*time.Duration(c.ReportInterval) {
return
} else {
c.LastCollectTime = timeBegin
}
c.runMonitor()
}
func (c *RaidInfoCollector) runMonitor() {
reportData := c.collectReportData()
if len(reportData) > 0 {
c.reportRaidInfoToTelegraf(reportData)
}
}
func (c *RaidInfoCollector) collectReportData() string {
if len(c.waitingReportData) > 60 {
c.waitingReportData = c.waitingReportData[1:]
}
return c.CollectReportData()
}
func (c *RaidInfoCollector) CollectReportData() string {
raidDiskInfo := make([]*baremetal.BaremetalStorage, 0)
// raidDrivers := []string{}
for _, drv := range drivers.GetDrivers(drivers.NewExecutor()) {
if err := drv.ParsePhyDevs(); err != nil {
log.Warningf("Raid driver %s ParsePhyDevs failed: %s", drv.GetName(), err)
continue
}
raidDiskInfo = append(raidDiskInfo, detect_storages.GetRaidDevices(drv)...)
// raidDrivers = append(raidDrivers, drv.GetName())
}
if len(raidDiskInfo) > 0 {
ret := c.toTelegrafReportData(raidDiskInfo)
return ret
}
return ""
}
func (c *RaidInfoCollector) Start() {
for {
c.runMain()
time.Sleep(time.Second * 1)
}
}
const MEASUREMENT = "host_raid"
func (c *RaidInfoCollector) toTelegrafReportData(raidDiskInfo []*baremetal.BaremetalStorage) string {
tag := fmt.Sprintf("%s=%s,%s=%s", "hostname", c.Hostname, "host_ip", c.HostIp)
ret := []string{}
for i := 0; i < len(raidDiskInfo); i++ {
statArr := []string{}
raidDiskInfo[i].Status = strings.ToLower(raidDiskInfo[i].Status)
jStat := jsonutils.Marshal(raidDiskInfo[i])
jMap, _ := jStat.GetMap()
for k, v := range jMap {
statArr = append(statArr, fmt.Sprintf("%s=%s", k, v.String()))
}
stat := strings.Join(statArr, ",")
diskTag := fmt.Sprintf(
"%s,%s=%s,%s=%d,%s=%d", tag, "driver", raidDiskInfo[i].Driver,
"adapter", raidDiskInfo[i].Adapter, "slot", raidDiskInfo[i].Slot,
)
line := fmt.Sprintf("%s,%s %s", MEASUREMENT, diskTag, stat)
ret = append(ret, line)
}
return strings.Join(ret, "\n")
}
func (c *RaidInfoCollector) reportRaidInfoToTelegraf(data string) {
body := strings.NewReader(data)
res, err := httputils.Request(
httputils.GetDefaultClient(), context.Background(), "POST", TelegrafServer, nil, body, false)
if err != nil {
log.Errorf("Upload guest metric failed: %s", err)
return
}
defer res.Body.Close()
if res.StatusCode != 204 {
log.Errorf("upload guest metric failed %d", res.StatusCode)
timestamp := time.Now().UnixNano()
for _, line := range strings.Split(data, "\n") {
c.waitingReportData = append(c.waitingReportData,
fmt.Sprintf("%s %d", line, timestamp))
}
} else {
if len(c.waitingReportData) > 0 {
oldDatas := strings.Join(c.waitingReportData, "\n")
body = strings.NewReader(oldDatas)
res, err = httputils.Request(
httputils.GetDefaultClient(), context.Background(), "POST", TelegrafServer, nil, body, false)
if err == nil {
defer res.Body.Close()
}
if res.StatusCode == 204 {
c.waitingReportData = c.waitingReportData[len(c.waitingReportData):]
} else {
log.Errorf("upload guest metric failed code: %d", res.StatusCode)
}
}
}
}

View File

@@ -26,6 +26,7 @@ import (
app_common "yunion.io/x/onecloud/pkg/cloudcommon/app"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
"yunion.io/x/onecloud/pkg/util/atexit"
"yunion.io/x/onecloud/pkg/util/procutils"
"yunion.io/x/onecloud/pkg/vpcagent/options"
_ "yunion.io/x/onecloud/pkg/vpcagent/ovn"
"yunion.io/x/onecloud/pkg/vpcagent/worker"
@@ -52,8 +53,12 @@ func main() {
}
{
ctx := context.Background()
ctx, cancelFunc := context.WithCancel(ctx)
go procutils.WaitZombieLoop(ctx)
wg := &sync.WaitGroup{}
ctx, cancelFunc := context.WithCancel(context.Background())
ctx = context.WithValue(ctx, "wg", wg)
wg.Add(1)
go w.Start(ctx)

View File

@@ -15,12 +15,17 @@
package main
import (
"context"
"yunion.io/x/onecloud/pkg/util/atexit"
"yunion.io/x/onecloud/pkg/util/procutils"
"yunion.io/x/onecloud/pkg/webconsole/service"
)
func main() {
defer atexit.Handle()
go procutils.WaitZombieLoop(context.TODO())
service.StartService()
}

6
go.mod
View File

@@ -141,12 +141,12 @@ require (
k8s.io/cluster-bootstrap v0.17.3
k8s.io/kubernetes v1.16.0
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74
yunion.io/x/jsonutils v0.0.0-20201014025429-7ce189228db6
yunion.io/x/jsonutils v0.0.0-20201110084044-3e4e1cb49769
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6
yunion.io/x/pkg v0.0.0-20201028134817-3ed15ee169bc
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v0.0.0-20201009235752-2ef1a29656b0
yunion.io/x/sqlchemy v0.0.0-20201029091740-cd5e77b56d4b
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce
)

12
go.sum
View File

@@ -1124,8 +1124,10 @@ vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74 h1:A15C6VdVRWvmQ9pAJHrUs9yan5qKlYH7uaRxHg1kRbk=
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
yunion.io/x/jsonutils v0.0.0-20201014025429-7ce189228db6 h1:RPpnTSCZwa9VQuWAf7S2dRjnZlYTIM0NH/j5vvUpk9g=
yunion.io/x/jsonutils v0.0.0-20201014025429-7ce189228db6/go.mod h1:p0nyMqGA/apTxxyLIU/o1k4V7Vujl2O6ey30L594sYE=
yunion.io/x/jsonutils v0.0.0-20201105032201-9d0fba742954 h1:gGU3uGxw82voqh3tVrTY4q43lLLooqgF662PqOeEpKY=
yunion.io/x/jsonutils v0.0.0-20201105032201-9d0fba742954/go.mod h1:p0nyMqGA/apTxxyLIU/o1k4V7Vujl2O6ey30L594sYE=
yunion.io/x/jsonutils v0.0.0-20201110084044-3e4e1cb49769 h1:LIQ4hhLGQuQK+XxlV+8JrKBuL37WUT+5ZTVxBwHOTD4=
yunion.io/x/jsonutils v0.0.0-20201110084044-3e4e1cb49769/go.mod h1:p0nyMqGA/apTxxyLIU/o1k4V7Vujl2O6ey30L594sYE=
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b/go.mod h1:+gauLs73omeJAPlsXcevLsJLKixV+sR/E7WSYTSx1fE=
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d h1:59zrDL7Ft+hDukguJRmLr/Gdu/9V75x+yX99ovZwfaA=
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
@@ -1137,9 +1139,11 @@ yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZV
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6 h1:UarEDTBGkgcgc+nc+PZ75uo9M9+jiOGd5P2B90TxDNw=
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20201028134817-3ed15ee169bc h1:cgwWI6k9LsXpq6yiOuEIprsXmPyPGUa60sOZu57e8Jo=
yunion.io/x/pkg v0.0.0-20201028134817-3ed15ee169bc/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-20201009235752-2ef1a29656b0 h1:ETDt3Xc3a6WnbHvhrMUemXVsnWY/RgHrsNRCVFWkCYo=
yunion.io/x/sqlchemy v0.0.0-20201009235752-2ef1a29656b0/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/sqlchemy v0.0.0-20201029091740-cd5e77b56d4b h1:xBAzDPvvmsOBjxAj0PLHMNLVdPNOlYFHAm7T3IZ2ehs=
yunion.io/x/sqlchemy v0.0.0-20201029091740-cd5e77b56d4b/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=

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -156,6 +156,9 @@ func (h *AuthHandlers) GetRegionsResponse(ctx context.Context, w http.ResponseWr
}
}
resp.Add(domains, "domains")
resp.Add(jsonutils.JSONTrue, "return_full_domains")
} else {
resp.Add(jsonutils.JSONFalse, "return_full_domains")
}
filters := jsonutils.NewDict()
@@ -962,6 +965,12 @@ func getUserInfo2(s *mcclient.ClientSession, uid string, pid string, loginIp str
data.Add(jsonutils.JSONFalse, "non_default_domain_projects")
}
if options.Options.EnableQuotaCheck {
data.Add(jsonutils.JSONTrue, "enable_quota_check")
} else {
data.Add(jsonutils.JSONFalse, "enable_quota_check")
}
data.Add(jsonutils.NewString(getSsoCallbackUrl()), "sso_callback_url")
return data, nil

View File

@@ -383,7 +383,9 @@ func (mh *MiscHandler) DoBatchUserRegister(ctx context.Context, w http.ResponseW
return
} else {
names[name+"/"+domainId] = true
_, err := modules.UsersV3.Get(s, name, nil)
params := jsonutils.NewDict()
params.Set("domain_id", jsonutils.NewString(domainId))
_, err := modules.UsersV3.Get(s, name, params)
if err == nil {
continue
}

View File

@@ -71,6 +71,8 @@ const (
CLOUD_ACCESS_ENV_AZURE_CHINA = CLOUD_PROVIDER_AZURE
CLOUD_ACCESS_ENV_HUAWEI_GLOBAL = CLOUD_PROVIDER_HUAWEI + "-int"
CLOUD_ACCESS_ENV_HUAWEI_CHINA = CLOUD_PROVIDER_HUAWEI
CLOUD_ACCESS_ENV_ALIYUN_GLOBAL = CLOUD_PROVIDER_ALIYUN
CLOUD_ACCESS_ENV_ALIYUN_FINANCE = CLOUD_PROVIDER_ALIYUN + "-fin"
CLOUD_ACCESS_ENV_CTYUN_CHINA = CLOUD_PROVIDER_CTYUN
)

View File

@@ -114,6 +114,7 @@ const (
CITY_SOUTH_CAROLINA = "South Carolina" //南卡罗来纳州
CITY_SALT_LAKE_CITY = "Salt Lake City" //盐湖城
CITY_LAS_VEGAS = "Las Vegas" //拉斯维加斯
CITY_PHOENIX = "Phoenix" //菲尼克斯
// 英国
CITY_LONDON = "London" //伦敦
@@ -150,7 +151,8 @@ const (
CITY_STOCKHOLM = "Stockholm" //斯德哥尔摩
// 巴西
CITY_SAO_PAULO = "Sao Paulo" //圣保罗
CITY_SAO_PAULO = "Sao Paulo" //圣保罗
CITY_RIO_DE_JANEIRO = "Rio de Janeiro" // 里约热内卢
// 智利
CITY_SANTIAGO = "Santiago" // 圣地亚哥

View File

@@ -24,12 +24,13 @@ type DBInstanceCreateInput struct {
apis.VirtualResourceCreateInput
DeletePreventableCreateInput
// Ip子网名称或Id,建议使用Id
// Ip子网Id
// 谷歌云并不实际使用Ip子网,仅仅通过Ip子网确定Vpc
// required: true
Network string `json:"network"`
NetworkId string `json:"network_id"`
// swagger:ignore
NetworkId string
Network string `json:"network" yunion-deprecated-by:"network_id"`
// Ip子网内的地址,不填则按照ip子网的地址分配策略分配一个ip
// required: false
@@ -66,8 +67,10 @@ type DBInstanceCreateInput struct {
// swagger:ignore
CloudregionId string
VpcId string `json:"vpc_id"`
// swagger:ignore
VpcId string
Vpc string `json:"vpc" yunion-deprecated-by:"vpc_id"`
// swagger:ignore
ManagerId string
@@ -142,6 +145,9 @@ type DBInstanceCreateInput struct {
// required: true
DiskSizeGB int `json:"disk_size_gb"`
// 指定连接端口
Port int `json:"port"`
// rds初始化密码
// 阿里云不需要此参数
// 华为云会默认创建一个用户,若不传此参数, 则为随机密码
@@ -163,6 +169,9 @@ type DBInstanceCreateInput struct {
// swagger:ignore
Provider string
// 从备份中创建新实例
DBInstancebackupId string `json:"dbinstancebackup_id"`
}
type SDBInstanceChangeConfigInput struct {

View File

@@ -67,6 +67,8 @@ type SElasticipCreateInput struct {
// 子网Id
// 私有云创建此参数必传,例如Openstack, ZStack
NetworkId string `json:"network_id"`
// 指定新建EIP的地址
IpAddr string `json:"ip_addr"`
}
type ElasticipDetails struct {

View File

@@ -42,7 +42,6 @@ const (
EIP_CHARGE_TYPE_BY_TRAFFIC = "traffic"
EIP_CHARGE_TYPE_BY_BANDWIDTH = "bandwidth"
EIP_CHARGE_TYPE_DEFAULT = EIP_CHARGE_TYPE_BY_TRAFFIC
)
var (

View File

@@ -249,6 +249,8 @@ var HOSTTYPE_HYPERVISOR = map[string]string{
}
const (
VM_DEFAULT_WINDOWS_LOGIN_USER = "Administrator"
VM_DEFAULT_LINUX_LOGIN_USER = "root"
VM_AWS_DEFAULT_LOGIN_USER = "ec2user"
VM_AWS_DEFAULT_WINDOWS_LOGIN_USER = "Administrator"
VM_AZURE_DEFAULT_LOGIN_USER = "toor"

View File

@@ -41,6 +41,11 @@ type ServerListInput struct {
Baremetal *bool `json:"baremetal"`
// 只列出GPU主机
Gpu *bool `json:"gpu"`
// 只列出还有备份机的主机
Backup *bool `json:"bakcup"`
// 列出指定类型的主机
// enum: normal,gpu,backup
ServerType string `json:"server_type"`
// 列出管理安全组为指定安全组的主机
AdminSecgroup string `json:"admin_security"`
// 列出Hypervisor为指定值的主机
@@ -98,6 +103,9 @@ type ServerListInput struct {
SrcMacCheck *bool `json:"src_mac_check"`
InstanceType []string `json:"instance_type"`
// 是否调度到宿主机上
WithHost *bool `json:"with_host"`
}
func (input *ServerListInput) AfterUnmarshal() {
@@ -206,6 +214,8 @@ type ServerDetails struct {
Vpc string `json:"vpc"`
// 归属VPC ID
VpcId string `json:"vpc_id"`
// Vpc外网访问模式
VpcExternalAccessMode string `json:"vpc_external_access_mode"`
// 关联安全组列表
Secgroups []apis.StandaloneShortDesc `json:"secgroups"`
@@ -409,3 +419,21 @@ type GuestAddSecgroupInput struct {
// | 其他 | 5 |
SecgroupIds []string `json:"secgroup_ids"`
}
type ServerRemoteUpdateInput struct {
// 是否覆盖替换所有标签
ReplaceTags *bool `json:"replace_tags" help:"replace all remote tags"`
}
type ServerAssociateEipInput struct {
// swagger:ignore
// Deprecated
Eip string `json:"eip" yunion-deprecated-by:"eip_id"`
// 弹性公网IP的ID
EipId string `json:"eip_id"`
}
type ServerDissociateEipInput struct {
// 是否自动释放
AudoDelete *bool `json:"auto_delete"`
}

View File

@@ -61,6 +61,9 @@ type CachedimageListInput struct {
// filter by host schedtag
HostSchedtagId string `json:"host_schedtag_id"`
// valid cachedimage
Valid *bool `json:"valid"`
}
type ExternalProjectListInput struct {

View File

@@ -62,6 +62,7 @@ var (
CLOUD_PROVIDER_CTYUN,
CLOUD_PROVIDER_UCLOUD,
CLOUD_PROVIDER_GOOGLE,
CLOUD_PROVIDER_OPENSTACK,
}
)

View File

@@ -18,6 +18,7 @@ import "yunion.io/x/onecloud/pkg/apis"
type SecurityGroupCacheDetails struct {
apis.StatusStandaloneResourceDetails
apis.ProjectizedResourceInfo
ManagedResourceInfo
CloudregionResourceInfo
@@ -25,4 +26,6 @@ type SecurityGroupCacheDetails struct {
// 虚拟私有网络名称
Vpc string `json:"vpc"`
ProjectId string `json:"tenant_id"`
}

View File

@@ -74,7 +74,7 @@ type ServerSkuListInput struct {
UsableResourceListInput
// filter sku by memory size in MB
MemorySizeMb int `json:"memory_size_mb"`
MemorySizeMb []int `json:"memory_size_mb"`
// filter sku by CPU core count
CpuCoreCount []int `json:"cpu_core_count"`
@@ -155,3 +155,25 @@ type DBInstanceSkuListInput struct {
Zone2 []string `json:"zone2"`
Zone3 []string `json:"zone3"`
}
type SkuSyncInput struct {
// 云平台名称
// example: Google
Provider string `json:"provider,omitempty"`
// 区域ID
CloudregionIds []string `json:"cloudregion_ids"`
}
type SkuTaskQueryInput struct {
// 异步任务ID
TaskIds []string `json:"task_ids"`
}
type CloudregionSkuSyncInput struct {
SkuSyncInput
// 同步资源类型
// choices: serversku|elasticcachesku|dbinstance_sku
Resource string `json:"resource"`
}

View File

@@ -21,10 +21,10 @@ type SnapshotPolicyDetails struct {
SSnapshotPolicy
RetentionDays int `json:"retention_days"`
RepeatWeekdays []int `json:"repeat_weekdays"`
TimePoints []int `json:"time_points"`
IsActivated *bool `json:"is_activated,omitempty"`
RetentionDays int `json:"retention_days"`
RepeatWeekdaysDisplay []int `json:"repeat_weekdays_display"`
TimePointsDisplay []int `json:"time_points_display"`
IsActivated *bool `json:"is_activated,omitempty"`
BindingDiskCount int `json:"binding_disk_count"`
}

View File

@@ -55,12 +55,14 @@ const (
STORAGE_LOCAL_SSD = "local_ssd"
STORAGE_LOCAL_PRO = "local_pro"
STORAGE_CLOUD_BASIC = "cloud_basic"
STORAGE_CLOUD_PREMIUM = "cloud_premium"
STORAGE_CLOUD_PREMIUM = "cloud_premium" //高性能云硬盘
STORAGE_CLOUD_HSSD = "cloud_hssd" //增强型SSD云硬盘
// huawei storage type
STORAGE_HUAWEI_SSD = "SSD" // 超高IO云硬盘
STORAGE_HUAWEI_SAS = "SAS" // 高IO云硬盘
STORAGE_HUAWEI_SATA = "SATA" // 普通IO云硬盘
STORAGE_HUAWEI_SSD = "SSD" // 超高IO云硬盘
STORAGE_HUAWEI_SAS = "SAS" // 高IO云硬盘
STORAGE_HUAWEI_SATA = "SATA" // 普通IO云硬盘
STORAGE_HUAWEI_GPSSD = "GPSSD" // 通用型SSD
// openstack
STORAGE_OPENSTACK_ISCSI = "iscsi"
@@ -81,6 +83,7 @@ const (
STORAGE_GOOGLE_LOCAL_SSD = "local-ssd" //本地SSD暂存盘 (最多8个)
STORAGE_GOOGLE_PD_STANDARD = "pd-standard" //标准永久性磁盘
STORAGE_GOOGLE_PD_SSD = "pd-ssd" //SSD永久性磁盘
STORAGE_GOOGLE_PD_BALANCED = "pd-balanced" //平衡永久性磁盘
// ctyun storage type
STORAGE_CTYUN_SSD = "SSD" // 超高IO云硬盘

View File

@@ -18,10 +18,13 @@ import (
"yunion.io/x/pkg/util/netutils"
)
const VPC_OVN_ENCAP_COST = 58
const (
VPC_EXTERNAL_ACCESS_MODE_DISTGW = "distgw" // distgw only
VPC_EXTERNAL_ACCESS_MODE_EIP_DISTGW = "eip-distgw" // eip when available, distgw otherwise
VPC_EXTERNAL_ACCESS_MODE_EIP = "eip" // eip only
VPC_EXTERNAL_ACCESS_MODE_NONE = "none" // no external access
)
var (
@@ -29,6 +32,7 @@ var (
VPC_EXTERNAL_ACCESS_MODE_DISTGW,
VPC_EXTERNAL_ACCESS_MODE_EIP_DISTGW,
VPC_EXTERNAL_ACCESS_MODE_EIP,
VPC_EXTERNAL_ACCESS_MODE_NONE,
}
)

View File

@@ -99,6 +99,7 @@ var (
CommonWhitelistOptionMap = map[string][]string{
"default": []string{
"enable_quota_check",
"default_quota_value",
"enable_rbac",
"non_default_domain_projects",
@@ -202,3 +203,19 @@ var (
},
}
)
func mergeConfigOptionsFrom(opt1, opt2 map[string][]string) map[string][]string {
for opt, values := range opt2 {
ovalues, _ := opt1[opt]
opt1[opt] = append(ovalues, values...)
}
return opt1
}
func MergeServiceConfigOptions(opts ...map[string][]string) map[string][]string {
ret := make(map[string][]string)
for i := range opts {
ret = mergeConfigOptionsFrom(ret, opts[i])
}
return ret
}

View File

@@ -201,6 +201,8 @@ type PerformStatusInput struct {
// 更改的目标状态值
// required:true
Status string `json:"status"`
// swagger:ignore
BlockJobsCount int `json:"block_jobs_count"`
// 更改状态的原因描述
// required:false

View File

@@ -117,6 +117,7 @@ type AlertCreateInput struct {
NoDataState string `json:"no_data_state"`
// 报警执行错误将当前报警状态设置为对应的状态
ExecutionErrorState string `json:"execution_error_state"`
UsedBy string `json:"used_by"`
}
type AlertUpdateInput struct {

View File

@@ -34,11 +34,13 @@ type AlertRecordCreateInput struct {
type AlertRecordRule struct {
Metric string `json:"metric"`
Measurement string `json:"measurement"`
MeasurementDesc string `json:"measurement_desc"`
Field string `json:"field"`
FieldDesc string `json:"field_desc"`
// 比较运算符, 比如: >, <, >=, <=
Comparator string `json:"comparator"`
// 报警阀值
Threshold float64 `json:"threshold"`
Period string `json:"period"`
Threshold string `json:"threshold"`
Period string `json:"period"`
}

View File

@@ -0,0 +1,77 @@
// 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 monitor
import (
"yunion.io/x/onecloud/pkg/apis"
)
type AlertResourceType string
const (
// AlertResourceTypeNode means onecloud system infrastructure controller or host node
AlertResourceTypeNode AlertResourceType = "node"
// AlertResourceTypeCloudaccount means cloudaccount resource
AlertResourceTypeCloudaccount AlertResourceType = "cloudaccount"
// AlertResourceTypeVM means virtual machine guest resource
// AlertResourceTypeVM AlertResourceType = "vm"
)
type AlertResourceCreateInput struct {
apis.StandaloneResourceCreateInput
Type AlertResourceType `json:"type"`
}
type AlertResourceListInput struct {
apis.StandaloneResourceListInput
Type string `json:"type"`
}
type AlertResourceAttachInput struct {
apis.Meta
AlertResourceId string `json:"alert_resource_id"`
AlertId string `json:"alert_id"`
AlertRecordId string `json:"alert_record_id"`
Data EvalMatch `json:"data"`
}
type AlertResourceDetails struct {
apis.StandaloneResourceDetails
Count int `json:"count"`
Tags map[string]string `json:"tags"`
}
type AlertResourceAlertListInput struct {
apis.JointResourceBaseListInput
AlertResourceId string `json:"alert_resource_id"`
AlertId string `json:"alert_id"`
}
type AlertResourceJointBaseDetails struct {
apis.JointResourceBaseDetails
AlertResource string `json:"alert_resource"`
Type AlertResourceType `json:"type"`
}
type AlertResourceAlertDetails struct {
AlertResourceJointBaseDetails
Alert string `json:"alert"`
AlertType string `json:"alert_type"`
Level string `json:"level"`
CommonAlertMetricDetails []*CommonAlertMetricDetails `json:"common_alert_metric_details"`
}

View File

@@ -86,6 +86,8 @@ type CommonAlertUpdateInput struct {
Channel []string `json:"channel"`
// 通知接受者
Recipients []string `json:"recipients"`
// systemalert policy may need update through operator
ForceUpdate bool `json:"force_update"`
}
type CommonAlertDetails struct {
@@ -105,13 +107,14 @@ type CommonAlertMetricDetails struct {
Comparator string `json:"comparator"`
Threshold float64 `json:"threshold"`
// metric points'value的运算方式
Reduce string `json:"reduce"`
DB string `json:"db"`
Measurement string `json:"measurement"`
MeasurementDisplayName string `json:"measurement_display_name"`
ResType string `json:"res_type"`
Field string `json:"field"`
Groupby string `json:"groupby"`
Reduce string `json:"reduce"`
DB string `json:"db"`
Measurement string `json:"measurement"`
MeasurementDisplayName string `json:"measurement_display_name"`
ResType string `json:"res_type"`
Field string `json:"field"`
Groupby string `json:"groupby"`
Filters []MetricQueryTag `json:"filters"`
FieldDescription MetricFieldDetail
FieldOpt string `json:"field_opt"`
}

View File

@@ -23,6 +23,11 @@ import (
const (
METRIC_TAG = "TAG"
METRIC_FIELD = "FIELD"
METRIC_VM_ID = "vm_id"
METRIC_OSS_ID = "oss_id"
METRIC_RDS_ID = "rds_id"
METRIC_REDIS_ID = "redis_id"
)
var PROPERTY_TYPE = []string{"databases", "measurements", "metric-measurement"}

View File

@@ -19,9 +19,10 @@ type NotificationTemplateCreateInput struct {
}
type NotificationTemplateConfig struct {
Title string `json:"title"`
Name string `json:"name"`
Matches []EvalMatch `json:"matches"`
Title string `json:"title"`
Name string `json:"name"`
ResourceName string `json:"resource_name"`
Matches []EvalMatch `json:"matches"`
// PrevAlertState AlertStateType `json:"prev_alert_state"`
// State AlertStateType `json:"state"`
NoDataFound bool `json:"no_data"`

View File

@@ -41,8 +41,11 @@ type MetricFunc struct {
}
type MetricInputQuery struct {
From string `json:"from"`
To string `json:"to"`
From string `json:"from"`
To string `json:"to"`
Scope string `json:"scope"`
//default group by
Unit bool `json:"unit"`
Interval string `json:"interval"`
DomainId string `json:"domain_id"`
ProjectId string `json:"project_id"`

View File

@@ -29,6 +29,7 @@ const (
FEISHU_ROBOT = "feishu-robot"
DINGTALK_ROBOT = "dingtalk-robot"
WORKWX_ROBOT = "workwx-robot"
WEBHOOK = "webhook"
ROBOT = "robot"
@@ -60,4 +61,7 @@ const (
TEMPLATE_TYPE_TITLE = "title"
TEMPLATE_TYPE_CONTENT = "content"
TEMPLATE_TYPE_REMOTE = "remote"
CTYPE_ROBOT_YES = "yes"
CTYPE_ROBOT_ONLY = "only"
)

View File

@@ -81,6 +81,10 @@ type ScheduleInput struct {
CpuMicrocode string `json:"cpu_microcode"`
CpuMode string `json:"cpu_mode"`
// In the migrate and create backup cases
// we don't need reallocate network
ReuseNetwork bool `json:"reuse_network"`
PendingUsages []jsonutils.JSONObject
}

View File

@@ -0,0 +1,53 @@
// 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 webconsole
import (
"encoding/base64"
"net/url"
"yunion.io/x/onecloud/pkg/apis"
)
type ServerRemoteConsoleResponse struct {
ConnectParams string `json:"connect_params"`
Session string `json:"session,omitempty"`
apis.Meta
}
func (resp *ServerRemoteConsoleResponse) GetConnectParams() string {
params := resp.ConnectParams
if data, err := base64.StdEncoding.DecodeString(params); err == nil {
params = string(data)
}
return params
}
func (resp *ServerRemoteConsoleResponse) GetConnectProtocol() (string, error) {
var (
params = resp.GetConnectParams()
query url.Values
)
if uri, err := url.ParseRequestURI(params); err == nil {
query = uri.Query()
} else if q, err := url.ParseQuery(params); err == nil {
query = q
} else {
return "", err
}
protocol := query.Get("protocol")
return protocol, nil
}

View File

@@ -93,7 +93,7 @@ func (job *SStatusProbeJob) Name() string {
func (job *SStatusProbeJob) Do(ctx context.Context, now time.Time) error {
bStatus := job.baremetal.GetStatus()
if bStatus == api.BAREMETAL_READY || bStatus == api.BAREMETAL_RUNNING {
if bStatus == api.BAREMETAL_READY || bStatus == api.BAREMETAL_RUNNING || bStatus == api.BAREMETAL_UNKNOWN {
ps, err := job.baremetal.GetPowerStatus()
if err != nil {
return errors.Wrap(err, "GetPowerStatus")

View File

@@ -368,7 +368,7 @@ func (req *dhcpRequest) createBaremetal(session *mcclient.ClientSession) (jsonut
params := jsonutils.NewDict()
mac := req.ClientMac.String()
zoneId := req.baremetalManager.GetZoneId()
name := fmt.Sprintf("BM%s", strings.Replace(mac, ":", "", -1))
name := strings.ToLower(fmt.Sprintf("BM%s", strings.Replace(mac, ":", "", -1)))
params.Add(jsonutils.NewString(name), "name")
params.Add(jsonutils.NewString(mac), "access_mac")
params.Add(jsonutils.NewString("baremetal"), "host_type")

View File

@@ -24,7 +24,6 @@ import (
"yunion.io/x/onecloud/pkg/baremetal/utils/raid/drivers"
"yunion.io/x/onecloud/pkg/cloudcommon/types"
"yunion.io/x/onecloud/pkg/compute/baremetal"
"yunion.io/x/onecloud/pkg/util/ssh"
"yunion.io/x/onecloud/pkg/util/sysutils"
)
@@ -48,7 +47,7 @@ func GetRaidLogicVolumes(drv raid.IRaidDriver) ([]*raid.RaidLogicalVolume, error
return lvs, nil
}
func DetectStorageInfo(term *ssh.Client, wait bool) ([]*baremetal.BaremetalStorage, []*baremetal.BaremetalStorage, []*baremetal.BaremetalStorage, error) {
func DetectStorageInfo(term raid.IExecTerm, wait bool) ([]*baremetal.BaremetalStorage, []*baremetal.BaremetalStorage, []*baremetal.BaremetalStorage, error) {
raidDiskInfo := make([]*baremetal.BaremetalStorage, 0)
lvDiskInfo := make([]*raid.RaidLogicalVolume, 0)

View File

@@ -15,6 +15,7 @@
package ipmitool
import (
"context"
"fmt"
"net"
"strconv"
@@ -115,21 +116,21 @@ func (ipmi *LanPlusIPMI) GetMode() string {
return "rmcp"
}
func (ipmi *LanPlusIPMI) GetCommand(args ...string) *procutils.Command {
func (ipmi *LanPlusIPMI) GetCommand(args ...string) (*procutils.Command, context.CancelFunc) {
nArgs := []string{
"--signal=KILL",
fmt.Sprintf("%s", ipmi.GetDefaultTimeout()),
"ipmitool", "-I", "lanplus", "-H", ipmi.host,
"-I", "lanplus", "-H", ipmi.host,
"-p", fmt.Sprintf("%d", ipmi.port),
"-U", ipmi.user,
"-P", ipmi.password,
}
nArgs = append(nArgs, args...)
return procutils.NewCommand("timeout", nArgs...)
ctx, cancel := context.WithTimeout(context.Background(), ipmi.GetDefaultTimeout())
return procutils.NewCommandContext(ctx, "ipmitool", nArgs...), cancel
}
func (ipmi *LanPlusIPMI) ExecuteCommand(args ...string) ([]string, error) {
cmd := ipmi.GetCommand(args...)
cmd, cancel := ipmi.GetCommand(args...)
defer cancel()
log.Debugf("[LanPlusIPMI] execute command: %s", cmd.String())
out, err := cmd.Output()
if err != nil {

View File

@@ -29,10 +29,9 @@ import (
_ "yunion.io/x/onecloud/pkg/baremetal/utils/raid/mvcli"
_ "yunion.io/x/onecloud/pkg/baremetal/utils/raid/sas2iru"
"yunion.io/x/onecloud/pkg/compute/baremetal"
"yunion.io/x/onecloud/pkg/util/ssh"
)
func GetDriver(name string, term *ssh.Client) raid.IRaidDriver {
func GetDriver(name string, term raid.IExecTerm) raid.IRaidDriver {
factory := raid.RaidDrivers[name]
if factory == nil {
return nil
@@ -40,7 +39,15 @@ func GetDriver(name string, term *ssh.Client) raid.IRaidDriver {
return factory(term)
}
func GetDriverWithInit(name string, term *ssh.Client) (raid.IRaidDriver, error) {
func GetLocalDriver(name string) raid.IRaidDriver {
factory := raid.RaidDrivers[name]
if factory == nil {
return nil
}
return factory(NewExecutor())
}
func GetDriverWithInit(name string, term raid.IExecTerm) (raid.IRaidDriver, error) {
drv := GetDriver(name, term)
if drv == nil {
return nil, errors.Errorf("Not found raid driver %q", name)
@@ -48,7 +55,7 @@ func GetDriverWithInit(name string, term *ssh.Client) (raid.IRaidDriver, error)
return drv, drv.ParsePhyDevs()
}
func GetDriverByKernelModule(module string, term *ssh.Client) (raid.IRaidDriver, error) {
func GetDriverByKernelModule(module string, term raid.IExecTerm) (raid.IRaidDriver, error) {
name := ""
switch module {
case raid.MODULE_MEGARAID:
@@ -64,7 +71,7 @@ func GetDriverByKernelModule(module string, term *ssh.Client) (raid.IRaidDriver,
return GetDriverWithInit(name, term)
}
func GetDrivers(term *ssh.Client) []raid.IRaidDriver {
func GetDrivers(term raid.IExecTerm) []raid.IRaidDriver {
ret := []raid.IRaidDriver{}
for _, factory := range raid.RaidDrivers {
ret = append(ret, factory(term))

View File

@@ -0,0 +1,56 @@
package drivers
import (
"bytes"
"fmt"
"io"
"os/exec"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/onecloud/pkg/util/ssh"
)
type Executor struct{}
func (e *Executor) Run(cmds ...string) ([]string, error) {
return e.run(true, cmds, nil)
}
func (e *Executor) RunWithInput(input io.Reader, cmds ...string) ([]string, error) {
return e.run(true, cmds, input)
}
func (e *Executor) run(parseOutput bool, cmds []string, input io.Reader) ([]string, error) {
ret := []string{}
for _, cmd := range cmds {
log.Debugf("Run command: %s", cmd)
proc := exec.Command("sh", "-c", cmd)
var stdOut bytes.Buffer
var stdErr bytes.Buffer
proc.Stdout = &stdOut
proc.Stderr = &stdErr
proc.Stdin = input
if err := proc.Run(); err != nil {
var outputErr error
errMsg := stdErr.String()
if len(stdOut.String()) != 0 {
errMsg = fmt.Sprintf("%s %s", errMsg, stdOut.String())
}
outputErr = errors.Error(errMsg)
err = errors.Wrapf(outputErr, "%q error: %v, cmd error", cmd, err)
return nil, err
}
if parseOutput {
ret = append(ret, ssh.ParseOutput(stdOut.Bytes())...)
} else {
ret = append(ret, stdOut.String())
}
}
return ret, nil
}
func NewExecutor() *Executor {
return new(Executor)
}

View File

@@ -31,7 +31,6 @@ import (
"yunion.io/x/onecloud/pkg/baremetal/utils/raid"
"yunion.io/x/onecloud/pkg/compute/baremetal"
"yunion.io/x/onecloud/pkg/util/regutils2"
"yunion.io/x/onecloud/pkg/util/ssh"
)
type HPSARaidPhyDev struct {
@@ -347,11 +346,11 @@ func (adapter *HPSARaidAdaptor) RemoveLogicVolumes() error {
}
type HPSARaid struct {
term *ssh.Client
term raid.IExecTerm
adapters []*HPSARaidAdaptor
}
func NewHPSARaid(term *ssh.Client) raid.IRaidDriver {
func NewHPSARaid(term raid.IExecTerm) raid.IRaidDriver {
return &HPSARaid{
term: term,
adapters: make([]*HPSARaidAdaptor, 0),

View File

@@ -15,6 +15,8 @@
package raid
import (
"io"
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/compute/baremetal"
)
@@ -41,3 +43,8 @@ type IRaidAdapter interface {
BuildRaid10(devs []*baremetal.BaremetalStorage, conf *api.BaremetalDiskConfig) error
BuildNoneRaid(devs []*baremetal.BaremetalStorage) error
}
type IExecTerm interface {
Run(cmds ...string) ([]string, error)
RunWithInput(input io.Reader, cmds ...string) ([]string, error)
}

View File

@@ -27,10 +27,10 @@ import (
"yunion.io/x/pkg/utils"
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/baremetal/utils/raid"
raiddrivers "yunion.io/x/onecloud/pkg/baremetal/utils/raid"
"yunion.io/x/onecloud/pkg/compute/baremetal"
"yunion.io/x/onecloud/pkg/util/regutils2"
"yunion.io/x/onecloud/pkg/util/ssh"
)
var (
@@ -320,7 +320,7 @@ func (adapter *MegaRaidAdaptor) GetIndex() int {
return adapter.index
}
func (adapter *MegaRaidAdaptor) getTerm() *ssh.Client {
func (adapter *MegaRaidAdaptor) getTerm() raid.IExecTerm {
return adapter.raid.term
}
@@ -376,7 +376,7 @@ func (adapter *MegaRaidAdaptor) parseLogicVolumes(lines []string) ([]*raiddriver
return lvs, nil
}
func getLogicVolumeDeviceById(hostNum, scsiId int, term *ssh.Client) (string, error) {
func getLogicVolumeDeviceById(hostNum, scsiId int, term raid.IExecTerm) (string, error) {
items, err := raiddrivers.SGMap(term)
if err != nil {
return "", err
@@ -624,7 +624,7 @@ func (a StorcliAdaptor) key() string {
}
func (a *StorcliAdaptor) isComplete() bool {
return a.Controller >= 0 && a.key() != ""
return a.Controller >= 0 && a.name != "" && a.sn != ""
}
func (a *StorcliAdaptor) parseLine(l string) {
@@ -756,7 +756,7 @@ func (adapter *MegaRaidAdaptor) storcliBuildNoRaid(devs []*baremetal.BaremetalSt
if err == nil {
return nil
}
log.Errorf("Try build JBOD fail: %v", err)
log.Errorf("Try storcli build JBOD fail: %v", err)
labels := []string{}
for _, dev := range devs {
labels = append(labels, GetSpecString(dev))
@@ -779,7 +779,7 @@ func (adapter *MegaRaidAdaptor) megacliBuildNoRaid(devs []*baremetal.BaremetalSt
if err == nil {
return nil
}
log.Errorf("Try build jbod fail: %v", err)
log.Errorf("Try megacli build jbod fail: %v", err)
cmds := []string{}
for _, dev := range devs {
cmd := GetCommand("-CfgLdAdd", "-r0", fmt.Sprintf("[%s]", GetSpecString(dev)),
@@ -862,29 +862,42 @@ func (adapter *MegaRaidAdaptor) RemoveLogicVolumes() error {
return nil
}
/*
def _storcli_clear_jbod_disks(self):
cmds = []
for dev in self.devs:
cmd = self.raid.get_command2(
'/c%d/e%d/s%d' % (self.index, dev.enclosure, dev.slot),
'set', 'good', 'force')
cmds.append(cmd)
logging.info('%s', cmds)
self.raid.term.exec_remote_commands(cmds)
*/
func (adapter *MegaRaidAdaptor) storcliClearJBODDisks() error {
errs := make([]error, 0)
for _, dev := range adapter.devs {
cmd := GetCommand2(fmt.Sprintf("/c%d/e%d/s%d", adapter.index, dev.enclosure, dev.slot), "set", "good", "force")
if _, err := adapter.remoteRun(cmd); err != nil {
err = errors.Wrapf(err, "Set PD good storcli cmd %v", cmd)
errs = append(errs, err)
}
}
return errors.NewAggregate(errs)
}
func (adapter *MegaRaidAdaptor) megacliClearJBODDisks() error {
devIds := []string{}
for idx, dev := range adapter.devs {
devIds = append(devIds, GetSpecString(dev.ToBaremetalStorage(idx)))
}
cmd := GetCommand("-PDMakeGood", fmt.Sprintf("-PhysDrv[%s]", strings.Join(devIds, ",")), "-Force", fmt.Sprintf("-a%d", adapter.index))
_, err := adapter.remoteRun(cmd)
return err
errs := make([]error, 0)
for _, devId := range devIds {
cmd := GetCommand("-PDMakeGood", "-PhysDrv", fmt.Sprintf("'[%s]'", devId), "-Force", fmt.Sprintf("-a%d", adapter.index))
if _, err := adapter.remoteRun(cmd); err != nil {
err = errors.Wrapf(err, "PDMakeGood megacli cmd %v", cmd)
errs = append(errs, err)
}
}
return errors.NewAggregate(errs)
}
func (adapter *MegaRaidAdaptor) clearJBODDisks() {
if err := adapter.megacliClearJBODDisks(); err != nil {
log.Errorf("megacliClearJBODDisks error: %v", err)
log.Infof("try storcliClearJBODDisks")
if err := adapter.storcliClearJBODDisks(); err != nil {
log.Errorf("storcliClearJBODDisks error: %v", err)
}
}
adapter.megacliEnableJBOD(true)
adapter.megacliEnableJBOD(false)
adapter.megacliEnableJBOD(true)
@@ -892,13 +905,13 @@ func (adapter *MegaRaidAdaptor) clearJBODDisks() {
}
type MegaRaid struct {
term *ssh.Client
term raid.IExecTerm
adapters []*MegaRaidAdaptor
PhyDevsCnt int
Capacity int64
}
func NewMegaRaid(term *ssh.Client) raiddrivers.IRaidDriver {
func NewMegaRaid(term raid.IExecTerm) raiddrivers.IRaidDriver {
return &MegaRaid{
term: term,
adapters: make([]*MegaRaidAdaptor, 0),

View File

@@ -25,7 +25,6 @@ import (
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/ssh"
)
type MarvelRaidPhyDev struct {
@@ -243,11 +242,11 @@ func (adapter *MarvelRaidAdaptor) BuildNoneRaid(devs []*baremetal.BaremetalStora
}
type MarvelRaid struct {
term *ssh.Client
term raid.IExecTerm
adapters []*MarvelRaidAdaptor
}
func NewMarvelRaid(term *ssh.Client) raid.IRaidDriver {
func NewMarvelRaid(term raid.IExecTerm) raid.IRaidDriver {
return &MarvelRaid{
term: term,
adapters: make([]*MarvelRaidAdaptor, 0),

View File

@@ -24,7 +24,6 @@ import (
"yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/compute/baremetal"
"yunion.io/x/onecloud/pkg/util/ssh"
"yunion.io/x/onecloud/pkg/util/sysutils"
)
@@ -45,7 +44,7 @@ const (
UnknownLogicalVolumeIndex = MaxInt
)
type RaidDriverFactory func(term *ssh.Client) IRaidDriver
type RaidDriverFactory func(term IExecTerm) IRaidDriver
type sRaidDrivers map[string]RaidDriverFactory
@@ -106,7 +105,7 @@ func (dev *RaidBasePhyDev) ToBaremetalStorage(index int) *baremetal.BaremetalSto
}
}
func GetModules(term *ssh.Client) []string {
func GetModules(term IExecTerm) []string {
ret := []string{}
lines, err := term.Run("/sbin/lsmod")
if err != nil {
@@ -142,7 +141,7 @@ type RaidLogicalVolume struct {
BlockDev string
}
func SGMap(term *ssh.Client) ([]compute.SGMapItem, error) {
func SGMap(term IExecTerm) ([]compute.SGMapItem, error) {
lines, err := term.Run("/usr/bin/sg_map -x")
if err != nil {
return nil, errors.Wrap(err, "run sg_map")

View File

@@ -26,7 +26,6 @@ import (
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/ssh"
)
type Mpt2SASRaidPhyDev struct {
@@ -57,7 +56,7 @@ func (dev *Mpt2SASRaidPhyDev) parseLine(line string) bool {
}
switch key {
case "Drive Type":
if strings.HasSuffix("_HDD", val) {
if strings.HasSuffix(val, "_HDD") {
dev.Rotate = tristate.True
} else {
dev.Rotate = tristate.False
@@ -307,12 +306,12 @@ func (adapter *Mpt2SASRaidAdaptor) RemoveLogicVolumes() error {
}
type Mpt2SASRaid struct {
term *ssh.Client
term raid.IExecTerm
utility string
adapters []*Mpt2SASRaidAdaptor
}
func NewMpt2SASRaid(term *ssh.Client) raid.IRaidDriver {
func NewMpt2SASRaid(term raid.IExecTerm) raid.IRaidDriver {
return &Mpt2SASRaid{
term: term,
adapters: make([]*Mpt2SASRaidAdaptor, 0),

View File

@@ -30,6 +30,7 @@ type SEndpointChangeManager struct {
func newEndpointChangeManager() *SEndpointChangeManager {
man := &SEndpointChangeManager{}
man.InitSync(man)
man.FirstSync()
return man
}

View File

@@ -35,6 +35,8 @@ var (
maxPagingLimit int64 = 2048
domainizedNamespace = true
enableQuotaCheck = false
)
func SetRegion(region string) {
@@ -85,3 +87,11 @@ func SetDomainizedNamespace(domainNS bool) {
func IsDomainizedNamespace() bool {
return nonDefaultDomainProjects && domainizedNamespace
}
func SetEnableQuotaCheck(val bool) {
enableQuotaCheck = val
}
func EnableQuotaCheck() bool {
return enableQuotaCheck
}

View File

@@ -301,6 +301,7 @@ func FetchCustomizeColumns(
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))
retVal[i] = jsonDict
}

View File

@@ -928,6 +928,12 @@ func (dispatcher *DBModelDispatcher) Get(ctx context.Context, idStr string, quer
if err != nil {
return nil, err
} else if data != nil {
if dataDict, ok := data.(*jsonutils.JSONDict); ok {
i18nDict := dispatcher.modelManager.GetI18N(ctx, idStr, data)
if i18nDict != nil {
dataDict.Set("_i18n", i18nDict)
}
}
return data, nil
}

View File

@@ -201,6 +201,9 @@ func (model *SDomainLevelResourceBase) PerformChangeOwner(ctx context.Context, u
}
}
// cancel usage
model.cleanModelUsages(ctx, userCred)
_, err = Update(model, func() error {
model.DomainId = ownerId.GetProjectDomainId()
model.DomainSrc = string(apis.OWNER_SOURCE_LOCAL)
@@ -210,6 +213,9 @@ func (model *SDomainLevelResourceBase) PerformChangeOwner(ctx context.Context, u
return nil, errors.Wrap(err, "Update")
}
// add usage
model.RecoverUsages(ctx, userCred)
OpsLog.SyncOwner(model, former, userCred)
notes := struct {
OldDomainId string

View File

@@ -127,6 +127,8 @@ type IModelManager interface {
QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)
GetPagingConfig() *SPagingConfig
GetI18N(ctx context.Context, idstr string, resObj jsonutils.JSONObject) *jsonutils.JSONDict
}
type IModel interface {
@@ -246,6 +248,10 @@ type IMetadataBaseModelManager interface {
GetMetadataHiddenKeys() []string
}
type IMetadataBaseModel interface {
OnMetadataUpdated(ctx context.Context, userCred mcclient.TokenCredential)
}
type IStandaloneModelManager interface {
IResourceModelManager
@@ -282,6 +288,8 @@ type IStandaloneModel interface {
GetAllMetadata(userCred mcclient.TokenCredential) (map[string]string, error)
IsShared() bool
IMetadataBaseModel
}
type IDomainLevelModelManager interface {

View File

@@ -34,7 +34,7 @@ import (
type SJointResourceBase struct {
SResourceBase
RowId int64 `primary:"true" auto_increment:"true"`
RowId int64 `primary:"true" auto_increment:"true" list:"user"`
}
type SJointResourceBaseManager struct {

View File

@@ -26,7 +26,8 @@ func TestEctdLockManager(t *testing.T) {
shared := newSharedObject()
for i := 0; i < 4; i++ {
lockman, err := NewEtcdLockManager(&SEtcdLockManagerConfig{
Endpoints: []string{"localhost:2379"},
LockPrefix: "test-etcd-lock-manager",
Endpoints: []string{"localhost:2379"},
})
if err != nil {
t.Skipf("new etcd lockman: %v", err)

View File

@@ -459,17 +459,17 @@ func (manager *SMetadataManager) SetValue(ctx context.Context, obj IModel, key s
}
func (manager *SMetadataManager) SetValuesWithLog(ctx context.Context, obj IModel, store map[string]interface{}, userCred mcclient.TokenCredential) error {
changes, err := manager.SetValues(ctx, obj, store, userCred)
changes, err := manager.setValues(ctx, obj, store, userCred)
if err != nil {
return err
}
if len(changes) > 0 {
OpsLog.LogEvent(obj, ACT_SET_METADATA, jsonutils.Marshal(changes), userCred)
OpsLog.LogEvent(obj.GetIModel(), ACT_SET_METADATA, jsonutils.Marshal(changes), userCred)
}
return nil
}
func (manager *SMetadataManager) SetValues(ctx context.Context, obj IModel, store map[string]interface{}, userCred mcclient.TokenCredential) ([]sMetadataChange, error) {
func (manager *SMetadataManager) setValues(ctx context.Context, obj IModel, store map[string]interface{}, userCred mcclient.TokenCredential) ([]sMetadataChange, error) {
idStr := GetObjectIdstr(obj)
// no need to lock
@@ -492,6 +492,7 @@ func (manager *SMetadataManager) SetValues(ctx context.Context, obj IModel, stor
}
newRecord := SMetadata{}
newRecord.SetModelManager(manager, &newRecord)
newRecord.ObjId = obj.GetId()
newRecord.ObjType = obj.GetModelManager().Keyword()
@@ -545,9 +546,9 @@ func (manager *SMetadataManager) SetValues(ctx context.Context, obj IModel, stor
}
func (manager *SMetadataManager) SetAll(ctx context.Context, obj IModel, store map[string]interface{}, userCred mcclient.TokenCredential, delRange string) error {
changes, err := manager.SetValues(ctx, obj, store, userCred)
changes, err := manager.setValues(ctx, obj, store, userCred)
if err != nil {
return err
return errors.Wrap(err, "setValues")
}
idStr := GetObjectIdstr(obj)
@@ -564,9 +565,9 @@ func (manager *SMetadataManager) SetAll(ctx context.Context, obj IModel, store m
q := manager.Query().Equals("id", idStr).NotLike("key", `\_\_%`) //避免删除系统内置的metadata, _ 在mysql里面有特殊含义,需要转义
switch delRange {
case USER_TAG_PREFIX:
q = q.Like("key", USER_TAG_PREFIX+"%")
q = q.Startswith("key", USER_TAG_PREFIX)
case CLOUD_TAG_PREFIX:
q = q.Like("key", CLOUD_TAG_PREFIX+"%")
q = q.Startswith("key", CLOUD_TAG_PREFIX)
}
q = q.Filter(sqlchemy.NOT(sqlchemy.In(q.Field("key"), keys)))
if err := FetchModelObjects(manager, q, &records); err != nil {
@@ -580,7 +581,7 @@ func (manager *SMetadataManager) SetAll(ctx context.Context, obj IModel, store m
changes = append(changes, sMetadataChange{Key: rec.Key, OValue: rec.Value})
}
if len(changes) > 0 {
OpsLog.LogEvent(obj, ACT_SET_METADATA, jsonutils.Marshal(changes), userCred)
OpsLog.LogEvent(obj.GetIModel(), ACT_SET_METADATA, jsonutils.Marshal(changes), userCred)
}
return nil
}

View File

@@ -359,14 +359,15 @@ func (manager *SModelBaseManager) GetPropertyDistinctField(ctx context.Context,
}
}
var res = jsonutils.NewDict()
q := im.Query()
q, err = ListItemQueryFilters(im, ctx, q, userCred, query, policy.PolicyActionList)
if err != nil {
return nil, err
}
var backupQuery = *q
var (
backupQuery = *q
res = jsonutils.NewDict()
)
// query field
for i := 0; i < len(fields); i++ {
var nq = backupQuery
@@ -424,6 +425,10 @@ func (manager *SModelBaseManager) OnCreateFailed(ctx context.Context, userCred m
return nil
}
func (manager *SModelBaseManager) GetI18N(ctx context.Context, idstr string, resObj jsonutils.JSONObject) *jsonutils.JSONDict {
return nil
}
func (model *SModelBase) GetId() string {
return ""
}
@@ -543,17 +548,24 @@ func (model *SModelBase) CustomizeDelete(ctx context.Context, userCred mcclient.
return nil
}
func cleanModelUsages(ctx context.Context, userCred mcclient.TokenCredential, model IModel) {
func (model *SModelBase) cleanModelUsages(ctx context.Context, userCred mcclient.TokenCredential) {
usages := model.GetIModel().GetUsages()
if CancelUsages != nil && len(usages) > 0 {
CancelUsages(ctx, userCred, usages)
}
}
func (model *SModelBase) RecoverUsages(ctx context.Context, userCred mcclient.TokenCredential) {
usages := model.GetIModel().GetUsages()
if AddUsages != nil && len(usages) > 0 {
AddUsages(ctx, userCred, usages)
}
}
func (model *SModelBase) PreDelete(ctx context.Context, userCred mcclient.TokenCredential) {
// clean usage on predelete
// clean usage before fakedelete for pending delete models
cleanModelUsages(ctx, userCred, model)
model.cleanModelUsages(ctx, userCred)
}
func (model *SModelBase) PostDelete(ctx context.Context, userCred mcclient.TokenCredential) {

View File

@@ -87,14 +87,17 @@ func alterNameValidator(model IModel, name string) error {
return nil
}
func GenerateAlertName(model IModel, hint string) (string, error) {
return GenerateName2(model.GetModelManager(), nil, hint, model, 1)
}
func GenerateName(manager IModelManager, ownerId mcclient.IIdentityProvider, hint string) (string, error) {
return GenerateName2(manager, ownerId, hint, nil, 1)
}
func GenerateAlterName(model IModel, hint string) (string, error) {
if hint == model.GetName() {
return hint, nil
}
return GenerateName2(nil, nil, hint, model, 1)
}
func GenerateName2(manager IModelManager, ownerId mcclient.IIdentityProvider, hint string, model IModel, baseIndex int) (string, error) {
_, pattern, patternLen := stringutils.ParseNamePattern(hint)
var name string

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