Anka tutorial 02

1.Joining Nodes

在mac上(anka build 节点)执行 sudo ankacluster join http://localhost:80/

output:

1
2
3
4
5
6
➜  ~ sudo ankacluster join http://localhost:80/ -n demo-mac
Setting tls config
Testing connection to controller...: Ok
Testing connection to the registry...: Ok
Ok
Cluster join success

去页面 http://localhost/#/nodes 查看

先下载mac OS安装包 (安装包7G多,需要提前下载)
https://www.macworld.co.uk/how-to/mac-software/download-old-os-x-3629363/#el%20cap

1
2
3
➜  ~ anka create --ram-size 4G --cpu-count 2 --disk-size 40G --app /Applications/Install\ macOS\ Catalina.app CatalinaVm
Installing macOS 10.15.1...
Preparing target disk...

Note For Catalina Anka VMs, –ram-size value should be 4G and –disk-size should be 80G.
由于电脑空间不够了,于是报错了

清理电脑空间后,再来一次,大约 30min

1
2
3
4
5
6
7
➜  ~ anka create --ram-size 4G --cpu-count 2 --disk-size 80G --app /Applications/Install\ macOS\ Catalina.app  CatalinaVm
Installing macOS 10.15.1...
Preparing target disk...
Installing addons...
Converting to ANKA format...
Waiting for installation to complete in the guest (about thirty minutes approx.)...
vm created successfully with uuid: a23d5a05-xx89-4xx4-a8b7-6f7b9xxxxxx

3. Run VM

VM 状态之间的转换如下:

需要区别 VM 和后面提到的 instance 关系,VM 更准确点讲是 VM Template,是创建instance的模版,但模版需要通过上面的方法才可以修改;新建VM后,相当于有一个基础的模版,但是要满足其他要求,可以自行在running的 vm 中操作,然后随时保存,类似于docker container的commit操作,但anka build是suspend一个running的 vm 来保存。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#罗列仓库
➜ anka registry list-repos
++
++
#添加一个新仓库
➜ anka registry add demo-repo http://localhost:8089
➜ anka registry list-repos
++
++
demo-repo (default)
+--------+-----------+
| host | localhost |
+--------+-----------+
| scheme | http |
+--------+-----------+
| port | 8089 |
+--------+-----------+
#推送VM Templates 到新仓库,
➜ anka registry push CatalinaVm -d "first push" -t v1
Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.

扫一扫,分享到微信

微信分享二维码
  • Copyrights © 2019-2024 John Doe
  • Visitors: | Views:

请我喝杯咖啡吧~