How to create a Virtual Machine in SmartOS
在SmartOS中,使用vmadm创建工具创建虚拟机。 此工具需要一个JSON有效负载,并使用输入JSON中指定的属性创建“kvm”或“joyent” brand zone。 正常输出是一系列单行JSON对象,其类型设置为以下之一:
成功
失败
更新
注意
每个对象至少具有“类型”和“消息”字段。 “成功”或“失败”类型的消息将跟随退出状态0表示成功的进程,所有其他退出指示失败。
vmadm create -f <filename.json>
Getting Started
你会需要
SmartOS的最新版本,可从http://download.joyent.com(此处的发布详情)
您的操作系统的ISO选择
VNC客户端
The Machine JSON Description
将下面的代码片段保存到一个名为“vmspec.json”的文件中。 您可以根据需要更改网络和其他变量。 这并不是所有选项的详尽列表。 对于所有选项,请参阅vmadm(1m)。 (size列在MiB中)
{ "brand": "kvm", "vcpus": 1, "autoboot": false, "ram": 1024, "resolvers": ["208.67.222.222", "208.67.220.220"], "disks": [ { "boot": true, "model": "virtio", "size": 40960 } ], "nics": [ { "nic_tag": "admin", "model": "virtio", "ip": "10.88.88.51", "netmask": "255.255.255.0", "gateway": "10.88.88.1", "primary": 1 } ]}"default_gateway": "10.88.88.1",Create the Empty Virtual Machine
使用创建机器工具创建空虚拟机。 请注意,虚拟机将不会运行。
$ vmadm create
注意UUID在最后一步。 该UUID是虚拟机的ID,将用于在其生命周期的其余部分引用它。
$ vmadm create < vmspec.json{"percent":1,"type":"update","message":"checking and applying defaults to payload"}{"percent":2,"type":"update","message":"checking required datasets"}{"percent":28,"type":"update","message":"we have all necessary datasets"}{"percent":29,"type":"update","message":"creating volumes"}{"percent":51,"type":"update","message":"creating zone container"}{"percent":94,"type":"update","message":"storing zone metadata"}{"uuid":"b8ab5fc1-8576-45ef-bb51-9826b52a4651","type":"success","message":"created VM"}Copy your OS ISO to the zone
$ cd /zones/b8ab5fc1-8576-45ef-bb51-9826b52a4651/root/$ wget http://mirrors.debian.com/path_to_an_iso/debian.isoEnsure permissions are correct on the ISO
$ chown root debian.iso$ chmod u+r debian.isoBoot the VM from the ISO Image(从ISO映像启动虚拟机)
vmadm是虚拟机管理工具。 它用于在虚拟机已存在之后管理虚拟机的生命周期。 我们将引导我们刚刚创建的虚拟机,但是在第一次出现之时,请告诉它启动ISO映像。
vmadm boot b8ab5fc1-8576-45ef-bb51-9826b52a4651 order=cd,once=d cdrom=/debian.iso,ideUse VNC to Connect to the VM
vmadm工具可以打印出VM上的信息。 您还可以附加一个部分进行特定打印。
$ vmadm info b8ab5fc1-8576-45ef-bb51-9826b52a4651 vnc{ "vnc": { "display": 39565, "port": 45465, "host": "10.99.99.7" }}Troubleshooting(故障排除)
Zone Networking Issues
如果您将SmartOS作为guest虚拟机运行,则可能会与您的zone有联网问题。 为了解决这个问题,我们需要创建一个桥梁。
如果您查看https://github.com/joyent/smartos-overlay/blob/master/lib/svc/method/net-physical#L179您可以看到该脚本将为vmare产品创建桥梁,但如果您是 使用VirtualBox或Parallells,那么您需要手动执行。
$ ifconfig -ae1000g0: flags=1100943<UP,BROADCAST,RUNNING,PROMISC,MULTICAST,ROUTER,IPv4> mtu 1500 index 2 inet 10.216.214.7 netmask ffffff00 broadcast 10.216.214.255 ether 8:0:27:e1:35:cb$ dladm create-bridge -l e1000g0 vboxbr有一种方法可以在启动时将其添加到/ opt / custom / smf中的smf脚本。 这是一个很好的写作,告诉你它是如何做的。 http://www.psychicfriends.net/blog/archives/2012/03/21/smartosorg_run_things_at_boot.html#003979
Further Reading
Those versed in JavaScript can learn a lot more by reading the vmadm.js source.
How to create a Virtual Machine in SmartOS的更多相关文章
- fail to create java virtual machine..
今天打开zend stdio 的时候 出现的错误 fail to create java virtual machine... 然后找度娘了,,都说改xxxxx, 我打开360 ,把内存清理了一遍 ...
- zend studio failed to create java virtual machine无法启动的解法
zend studio failed to create java virtual machine 解决方案:在安装目录下修改ZendStudio.ini中第十四行处改成 -Xmx512M. -sta ...
- Kettle启动时报错Cannot create java virtual machine & A java exception has occurred
开源免费--最喜欢的四个字没有之一 1.官网下载 https://sourceforge.net/projects/pentaho/files/Data%20Integration/ 下载完后,解压即 ...
- Eclipse "Could not create java virtual machine"的问题解决
今天到了新的环境,需要重新搭建Android的开发环境,下载eclipse并安装了JDK1.6后,启动eclipse,发现出现了错误“Could not create Javavirtual mach ...
- 在eclipse中启动tomcat时报错:could not create java virtual machine... a fatal error...
控制台报错:unrecoginzed option: --launcher XXMaxPermSize 解决方法:-〉 perference -> tomcat ->JVM setting ...
- How to run a (Tomcat)Java application server on a Azure virtual machine
http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-java-run-tomcat-applicatio ...
- [SQL in Azure] Provisioning a SQL Server Virtual Machine on Azure
http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-provision-sql-server/ Provi ...
- [Windows Azure] Create a Virtual Network for Site-to-Site Cross-Premises Connectivity
Create a Virtual Network for Site-to-Site Cross-Premises Connectivity This tutorial walks you throug ...
- [Windows Azure] Create a Virtual Network in Windows Azure
Create a Virtual Network in Windows Azure This tutorial walks you through the steps to create a basi ...
随机推荐
- 【python】split 和 join函数
一.关于split 和 join 方法 1只针对字符串进行处理.split:拆分字符串.join连接字符串2.string.join(sep): 以string作为分割符,将sep中所有的元素(字符串 ...
- hosts,No web site is configured at this address.
解决办法: IIS管理器->右击网站->属性->网站——>IP地址一项->选择全部未分配-> 确定关闭 问题解决.
- 获取 user-agents
user-agent "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0. ...
- 2018-2019 20165226 Exp5 MSF基础应用
2018-2019 20165226 Exp5 MSF基础应用 目录 一.实验内容说明及基础问题回答 二.实验过程 Task1 主动攻击实践 ms08_067 ms17_010 Task2 针对浏览器 ...
- python&pandas 与mysql 连接
1. python 与mysql 连接及操作,直接上代码,简单直接高效: import MySQLdb try: conn = MySQLdb.connect(host='localhost',use ...
- Unreal Engine 4 笔记 2
转自:http://blog.csdn.net/st_dark/article/details/48005947 2.Actor继承自aactor,可以看成是一个容器,用来装"组件" ...
- xgboost的遗传算法调参
遗传算法适应度的选择: 机器学习的适应度可以是任何性能指标 —准确度,精确度,召回率,F1分数等等.根据适应度值,我们选择表现最佳的父母(“适者生存”),作为幸存的种群. 交配: 存活下来的群体中的父 ...
- eventql部署过程
1. 环境准备install cmake make automake autoconf zlib-devel libtoolyum install zlib-devel---------------- ...
- 给iOS开发新手送点福利,简述UIScrollView的属性和用法
UIScrollView 1. contentOffset 默认CGPointZero,用来设置scrollView的滚动偏移量. // 设置scrollView的滚动偏移量 scrollView ...
- python输出格式化及函数format
格式 描述%% 百分号标记%c 字符及其ASCII码%s 字符串%d 有符号整数(十进制)%u 无符号整数(十进制)%o 无符号整数(八进制)%x ...