Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

How to use the vmadm command in the latest (Dec 13, 2011) release of SmartOS.

Listing VMs

Default fields + sort:

Same, but change the field order and add some more:

Same, but sort by ram in DESCENDING order then by CPU shares in ascending order:

Same but only list those with type=OS and ram=1* (1024 or 128 in this example):

Creating a new VM

The errors you see in the output below are from the check to confirm that the zone does not exist. For now these are expected, they'll go away soon.

alternatively, with the same file we could just use:

Getting a VMs properties

Lookup a VM by IP

same thing, but get an array of json as results:

Looking up all 128M VMs with an alias that starts with 'a' or 'b':

same thing, but json array output:

Updating a VM

Quota for OS VMs updates live without needing a restart:

Set the quota back and adjust the cpu_shares:

You can also do an update from JSON:

Add a NIC to a VM then remove it

First list the nics so you can see what we start with:

Then add a nic:

Show it's there (we'd need to reboot the VM to actually use it though):

change the IP:

list again:

Remove the new NIC:

Back where we started:

Stopping a VM




Starting a VM

(see above for before)


Rebooting a VM

Deleting a VM


delete, then list again:

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.