<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.lunanode.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.lunanode.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jason+Lee</id>
		<title>Luna Node - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.lunanode.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jason+Lee"/>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Special:Contributions/Jason_Lee"/>
		<updated>2026-05-31T15:16:35Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.22.5</generator>

	<entry>
		<id>https://wiki.lunanode.com/index.php/API</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/API"/>
				<updated>2017-02-10T20:06:48Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Luna Node Dynamic API enables you to write software to automate VM management. This page details how the API can be accessed. Visit the [https://dynamic.lunanode.com/panel/api API tab] to manage your API keys.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Each API token consists of an API ID and an API key. Both are needed for authentication of all API commands.&lt;br /&gt;
&lt;br /&gt;
API actions consist of a category label, action label, and a set of parameters. For example, to start a VM, the category label is &amp;quot;vm&amp;quot;, action label is &amp;quot;start&amp;quot;, and a &amp;quot;vm_id&amp;quot; parameter must be set. [[API#Action_list|See the full API action list.]]&lt;br /&gt;
&lt;br /&gt;
API requests are made over HTTPS. Once the server completes processing of your request, it will return a JSON-encoded response.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
We provide open source (under MIT License) [https://github.com/LunaNode/lndynamic-api PHP and Python libraries] for accessing the Luna Node Dynamic API. These libraries make interaction with the API easier, handling transaction from category, action, and parameters to the HTTPS request, and from the JSON-encoded response to a PHP associative array or Python dictionary. [https://github.com/LunaNode/lndynamic-api Get the libraries here.]&lt;br /&gt;
&lt;br /&gt;
Third party libraries are also available:&lt;br /&gt;
&lt;br /&gt;
* Golang: a [https://github.com/LunaNode/lobster/tree/master/vmi/lunanode Golang client API] is available as part of the Lobster project.&lt;br /&gt;
* C#: [https://github.com/rickparrish/lndapi rickparrish/lndapi] is a C# API wrapper.&lt;br /&gt;
* PHP: [https://github.com/sdavis1902/lunanode-api-php sdavis1902/lunanode-api-php]&lt;br /&gt;
* Ruby: [https://github.com/nomoon/lunanode nomoon/lunanode] Ruby Gem&lt;br /&gt;
&lt;br /&gt;
If you are using another programming language, you can view the API call [[API#Technical_details|technical details]] below. You may also find it easier to implement the [[API#Legacy_API|Legacy API]].&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
List your virtual machines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once('lndynamic.php');&lt;br /&gt;
$api_id = 'YOUR API ID';&lt;br /&gt;
$api_key = 'YOUR API KEY';&lt;br /&gt;
$api = new LNDynamic($api_id, $api_key);&lt;br /&gt;
print_r($api-&amp;gt;request('vm', 'list'));&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;from lndynamic import LNDynamic&lt;br /&gt;
api_id = 'YOUR API ID'&lt;br /&gt;
api_key = 'YOUR API KEY'&lt;br /&gt;
api = LNDynamic(api_id, api_key)&lt;br /&gt;
print api.request('vm', 'list')&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recreate a VM with the same IP:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once('lndynamic.php');&lt;br /&gt;
$api_id = 'YOUR API ID';&lt;br /&gt;
$api_key = 'YOUR API KEY';&lt;br /&gt;
$target_vm_name = 'myvm';&lt;br /&gt;
$target_image_name = 'Ubuntu 14.04 64-bit (template)';&lt;br /&gt;
$api = new LNDynamic($api_id, $api_key);&lt;br /&gt;
&lt;br /&gt;
// find the target virtual machine ID&lt;br /&gt;
$vms = $api-&amp;gt;request('vm', 'list');&lt;br /&gt;
$target_vm_id = false;&lt;br /&gt;
&lt;br /&gt;
foreach($vms['vms'] as $vm) {&lt;br /&gt;
	if(strcasecmp($vm['name'], $target_vm_name) === 0) {&lt;br /&gt;
		$target_vm_id = $vm['vm_id'];&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//find the target image ID&lt;br /&gt;
$images = $api-&amp;gt;request('image', 'list');&lt;br /&gt;
$target_image_id = false;&lt;br /&gt;
&lt;br /&gt;
foreach($images['images'] as $image) {&lt;br /&gt;
	if(strcasecmp($image['name'], $target_image_name) === 0) {&lt;br /&gt;
		$target_image_id = $image['image_id'];&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if($target_vm_id === false) {&lt;br /&gt;
	die('No VM found!');&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if($target_image_id === false) {&lt;br /&gt;
	die('No image found!');&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// disassociate the IP address&lt;br /&gt;
$info = $api-&amp;gt;request('vm', 'info', array('vm_id' =&amp;gt; $target_vm_id));&lt;br /&gt;
if(empty($info['info']['ip'])) {&lt;br /&gt;
	die('VM does not have IP!');&lt;br /&gt;
}&lt;br /&gt;
$api-&amp;gt;request('vm', 'floatingip-delete', array('vm_id' =&amp;gt; $target_vm_id, 'keep' =&amp;gt; 'yes'));&lt;br /&gt;
$api-&amp;gt;request('vm', 'delete', array('vm_id' =&amp;gt; $target_vm_id));&lt;br /&gt;
$api-&amp;gt;request('vm', 'create', array('hostname' =&amp;gt; $info['info']['hostname'], 'plan_id' =&amp;gt; $info['extra']['plan_id'], 'image_id' =&amp;gt; $target_image_id, 'ip' =&amp;gt; $info['info']['ip']));&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical details ===&lt;br /&gt;
&lt;br /&gt;
A request can be made given an API ID, API key, category, action, and parameters. The steps are described below. See the code of [https://github.com/LunaNode/lndynamic-api provided API libraries] for more details.&lt;br /&gt;
&lt;br /&gt;
* Create request array by taking parameters and adding &amp;quot;api_id&amp;quot; =&amp;gt; API ID and &amp;quot;api_partialkey&amp;quot; =&amp;gt; first 64 characters of API key.&lt;br /&gt;
* JSON-encode the request array to get a '''raw request message'''.&lt;br /&gt;
* The '''nonce''' is the current UTC time in seconds since epoch (in PHP, &amp;lt;code&amp;gt;$nonce = time();&amp;lt;/code&amp;gt;).&lt;br /&gt;
* The handler path is &amp;quot;{category}/{action}/&amp;quot;&lt;br /&gt;
* The target URL is https://dynamic.lunanode.com/api/{handler_path}&lt;br /&gt;
* Calculate the signature as SHA512-HMAC(&amp;quot;{handler path}|{raw request message}|{nonce}&amp;quot;), using the API key as the HMAC key; here, we are signing the string formed from concatenating handler path, raw request message, and nonce delimited by pipe (|) characters&lt;br /&gt;
* Submit POST request to target URL with these form keys:&lt;br /&gt;
** '''req''': the raw request message&lt;br /&gt;
** '''signature''': the hex-digest output of the SHA512-HMAC&lt;br /&gt;
** '''nonce''': the nonce value&lt;br /&gt;
* The server's response will be a JSON-encoded associative array.&lt;br /&gt;
&lt;br /&gt;
=== Legacy API ===&lt;br /&gt;
&lt;br /&gt;
The legacy API uses simple GET and POST requests for each API action. All API actions are submitted via https://dynamic.lunanode.com/api&lt;br /&gt;
&lt;br /&gt;
For example, to get the info for a virtual machine with hostname &amp;quot;hostname.example.tld&amp;quot;, you can use the following API actions (find the ID for the hostname, then get the info from the ID):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://dynamic.lunanode.com/api?api_id=YOUR_API_ID&amp;amp;api_key=YOUR_API_KEY&amp;amp;category=vm&amp;amp;action=list&lt;br /&gt;
https://dynamic.lunanode.com/api?api_id=YOUR_API_ID&amp;amp;api_key=YOUR_API_KEY&amp;amp;category=vm&amp;amp;action=info&amp;amp;vm_id=FOUND_VM_ID&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The legacy API isn't necessarily less secure than the newer API, as either way all API actions are encrypted under HTTPS; however, the new API does offer greater protection against timing attacks and hides the API key even if an attacker were able to successfully forge an SSL certificate. So, we encourage usage of the new API where it is not inconvenient, but we plan to maintain the legacy API indefinitely.&lt;br /&gt;
&lt;br /&gt;
== Action list ==&lt;br /&gt;
&lt;br /&gt;
This list serves as a reference for available API actions. See [[API Detail]] for additional details for some API operations.&lt;br /&gt;
&lt;br /&gt;
=== Virtual machine ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|start&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|stop&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|reboot&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|diskswap&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|info&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|delete&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|reimage&lt;br /&gt;
|vm_id, image_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|resize&lt;br /&gt;
|vm_id, plan_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|rescue&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|vnc&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|floatingip-add&lt;br /&gt;
|vm_id&lt;br /&gt;
|ip (string unattached floating IP address on your account), private_ip (string internal IP on VM)&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|floatingip-delete&lt;br /&gt;
|vm_id&lt;br /&gt;
|ip (string floating IP attached to VM), keep ('yes' to keep floating IP on account; default 'no')&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|iplist&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|ip-add&lt;br /&gt;
|vm_id&lt;br /&gt;
|ip (string unallocated IP in virtual network)&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|ip-delete&lt;br /&gt;
|vm_id, ip&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|securitygroup-add&lt;br /&gt;
|vm_id, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|securitygroup-remove&lt;br /&gt;
|vm_id, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|create&lt;br /&gt;
|hostname, plan_id, image_id&lt;br /&gt;
|region (default 'toronto'), ip (a floating IP on your account), net_id, securitygroups, scripts, volume_id, volume_virtio, key_id, set_password, affinity_group&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|snapshot&lt;br /&gt;
|vm_id, name (e.g. 'mysnapshot')&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|shelve&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|unshelve&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|rename&lt;br /&gt;
|vm_id, hostname&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: for create command, net_id is a network ID number, securitygroups is a comma-separated list of security group ID numbers, scripts is a comma-separated list of script ID numbers, volume_id is the ID number of an unattached volume that the new VM should be booted from (if volume_id is set, image_id is not required), and affinity_group is an affinity group UUID. Also, if volume_id is set, then the driver is ide if volume_virtio is not set, or virtio of volume_virtio is set (value of volume_virtio is ignored). Finally, key_id is an [https://dynamic.lunanode.com/panel/key SSH keypair ID], and set_password can be set if you want the system to add a startup script to set a randomly generated password (this is ignored if key_id is set; also, the system will set password by default for official templates).&lt;br /&gt;
&lt;br /&gt;
=== DNS ===&lt;br /&gt;
&lt;br /&gt;
API calls relating to DNS are listed below. Valid DNS record types are 'A', 'AAAA', 'CNAME', 'HINFO', 'MX', 'NAPTR', 'NS', 'PTR', 'RP', 'SRV', and 'TXT'.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|set&lt;br /&gt;
|ip, hostname&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|zone-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|zone-add&lt;br /&gt;
|origin (e.g., 'example.tld.')&lt;br /&gt;
|ttl&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|zone-remove&lt;br /&gt;
|zone_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|record-list&lt;br /&gt;
|zone_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|record-add&lt;br /&gt;
|zone_id, name (e.g., 'www'), data (e.g., '1.2.3.4'), ttl, type&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|record-remove&lt;br /&gt;
|record_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-add&lt;br /&gt;
|name, ip&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-update&lt;br /&gt;
|dyn_id, name, ip&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-remove&lt;br /&gt;
|dyn_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Image ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|region (will show images across all regions by default)&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|delete&lt;br /&gt;
|image_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|details&lt;br /&gt;
|image_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|replicate&lt;br /&gt;
|image_id, region&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|fetch&lt;br /&gt;
|region, name, location, format ('iso' or 'qcow2')&lt;br /&gt;
|virtio&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|retrieve&lt;br /&gt;
|image_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
image.fetch fetches an image from an external source. image.retrieve sends the contents of an existing image as the response body.&lt;br /&gt;
&lt;br /&gt;
=== Volume ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|list&lt;br /&gt;
|region&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|create&lt;br /&gt;
|region, label (e.g. 'myvolume'), size (in GB)&lt;br /&gt;
|image, snapshot_id&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|delete&lt;br /&gt;
|region, volume_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|attach&lt;br /&gt;
|region, volume_id, vm_id, target (e.g. 'auto' or '/dev/vdc')&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|detach&lt;br /&gt;
|region, volume_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|info&lt;br /&gt;
|region, volume_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|extend&lt;br /&gt;
|region, volume_id, size (in GB)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|snapshot-create&lt;br /&gt;
|region, volume_id, label&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|snapshot-delete&lt;br /&gt;
|region, snapshot_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|snapshot-list&lt;br /&gt;
|region&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For volume creation, if image parameter (which should be an image ID) and snapshot_id parameter are not set, then an empty volume will be created. If both are set, an error will be returned.&lt;br /&gt;
&lt;br /&gt;
=== Floating IP ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|floating&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|floating&lt;br /&gt;
|add&lt;br /&gt;
|region&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|floating&lt;br /&gt;
|delete&lt;br /&gt;
|region, ip&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Virtual Network ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|network&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|region&lt;br /&gt;
|-&lt;br /&gt;
|network&lt;br /&gt;
|create&lt;br /&gt;
|region, name, subnet (e.g. '192.168.30' for 192.168.30.0/24), dns (e.g. '8.8.8.8,8.8.4.4')&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|network&lt;br /&gt;
|delete&lt;br /&gt;
|region, net_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Load Balancer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|list&lt;br /&gt;
|region&lt;br /&gt;
|net_id&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|create&lt;br /&gt;
|region, net_id, name, method ('ROUND_ROBIN', 'LEAST_CONNECTIONS', or 'SOURCE_IP'), protocol ('HTTP', 'HTTPS', or 'TCP'), connection_limit (-1 for unlimited), port&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|delete&lt;br /&gt;
|region, lb_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|info&lt;br /&gt;
|region, lb_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|member_add&lt;br /&gt;
|region, lb_id, ip, port&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|member_remove&lt;br /&gt;
|region, lb_id, member_id (see lb/info output)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|associate&lt;br /&gt;
|region, lb_id, ip&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Plan and region ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|plan&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|region&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Server monitoring ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-types&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-add&lt;br /&gt;
|name, type, fail_count, success_count, check_interval, (also any parameters needed from check-types)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-remove&lt;br /&gt;
|check_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|contact-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|contact-add&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|contact-remove&lt;br /&gt;
|type ('email', 'sms_twilio', or 'http'), rel (e-mail address, phone number, or URL)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|alert-list&lt;br /&gt;
|check_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|alert-add&lt;br /&gt;
|check_id, contact_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|alert-remove&lt;br /&gt;
|alert_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Security groups ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|create&lt;br /&gt;
|region, name&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|delete&lt;br /&gt;
|region, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rename&lt;br /&gt;
|region, group_id, name&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rule-list&lt;br /&gt;
|region, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rule-insert&lt;br /&gt;
|region, group_id, direction ('ingress' or 'egress'), type (4 or 6), protocol ('*', 'tcp', 'udp', or 'icmp'), remote_type ('cidr' or 'group'), remote_value (CIDR or group ID)&lt;br /&gt;
|port_min, port_max, label&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rule-delete&lt;br /&gt;
|region, group_id, rule_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Startup scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|script&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Billing ===&lt;br /&gt;
&lt;br /&gt;
You can check your credit balance from the API.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|billing&lt;br /&gt;
|credit&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== E-mail ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|usage&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-add&lt;br /&gt;
|name&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-remove&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-dkim-set&lt;br /&gt;
|domain_id, selector, private_key&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-dkim-unset&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-list&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-add&lt;br /&gt;
|domain_id, username, password&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-set-password&lt;br /&gt;
|domain_id, user_id, password&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-remove&lt;br /&gt;
|domain_id, user_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|alias-list&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|alias-add&lt;br /&gt;
|domain_id, name, target&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|alias-remove&lt;br /&gt;
|domain_id, alias_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/API</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/API"/>
				<updated>2017-02-06T14:30:00Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Luna Node Dynamic API enables you to write software to automate VM management. This page details how the API can be accessed. Visit the [https://dynamic.lunanode.com/panel/api API tab] to manage your API keys.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Each API token consists of an API ID and an API key. Both are needed for authentication of all API commands.&lt;br /&gt;
&lt;br /&gt;
API actions consist of a category label, action label, and a set of parameters. For example, to start a VM, the category label is &amp;quot;vm&amp;quot;, action label is &amp;quot;start&amp;quot;, and a &amp;quot;vm_id&amp;quot; parameter must be set. [[API#Action_list|See the full API action list.]]&lt;br /&gt;
&lt;br /&gt;
API requests are made over HTTPS. Once the server completes processing of your request, it will return a JSON-encoded response.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
We provide open source (under MIT License) [https://github.com/LunaNode/lndynamic-api PHP and Python libraries] for accessing the Luna Node Dynamic API. These libraries make interaction with the API easier, handling transaction from category, action, and parameters to the HTTPS request, and from the JSON-encoded response to a PHP associative array or Python dictionary. [https://github.com/LunaNode/lndynamic-api Get the libraries here.]&lt;br /&gt;
&lt;br /&gt;
Third party libraries are also available:&lt;br /&gt;
&lt;br /&gt;
* Golang: a [https://github.com/LunaNode/lobster/tree/master/vmi/lunanode Golang client API] is available as part of the Lobster project.&lt;br /&gt;
* C#: [https://github.com/rickparrish/lndapi rickparrish/lndapi] is a C# API wrapper.&lt;br /&gt;
* PHP: [https://github.com/sdavis1902/lunanode-api-php sdavis1902/lunanode-api-php]&lt;br /&gt;
&lt;br /&gt;
If you are using another programming language, you can view the API call [[API#Technical_details|technical details]] below. You may also find it easier to implement the [[API#Legacy_API|Legacy API]].&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
List your virtual machines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once('lndynamic.php');&lt;br /&gt;
$api_id = 'YOUR API ID';&lt;br /&gt;
$api_key = 'YOUR API KEY';&lt;br /&gt;
$api = new LNDynamic($api_id, $api_key);&lt;br /&gt;
print_r($api-&amp;gt;request('vm', 'list'));&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;from lndynamic import LNDynamic&lt;br /&gt;
api_id = 'YOUR API ID'&lt;br /&gt;
api_key = 'YOUR API KEY'&lt;br /&gt;
api = LNDynamic(api_id, api_key)&lt;br /&gt;
print api.request('vm', 'list')&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recreate a VM with the same IP:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once('lndynamic.php');&lt;br /&gt;
$api_id = 'YOUR API ID';&lt;br /&gt;
$api_key = 'YOUR API KEY';&lt;br /&gt;
$target_vm_name = 'myvm';&lt;br /&gt;
$target_image_name = 'Ubuntu 14.04 64-bit (template)';&lt;br /&gt;
$api = new LNDynamic($api_id, $api_key);&lt;br /&gt;
&lt;br /&gt;
// find the target virtual machine ID&lt;br /&gt;
$vms = $api-&amp;gt;request('vm', 'list');&lt;br /&gt;
$target_vm_id = false;&lt;br /&gt;
&lt;br /&gt;
foreach($vms['vms'] as $vm) {&lt;br /&gt;
	if(strcasecmp($vm['name'], $target_vm_name) === 0) {&lt;br /&gt;
		$target_vm_id = $vm['vm_id'];&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//find the target image ID&lt;br /&gt;
$images = $api-&amp;gt;request('image', 'list');&lt;br /&gt;
$target_image_id = false;&lt;br /&gt;
&lt;br /&gt;
foreach($images['images'] as $image) {&lt;br /&gt;
	if(strcasecmp($image['name'], $target_image_name) === 0) {&lt;br /&gt;
		$target_image_id = $image['image_id'];&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if($target_vm_id === false) {&lt;br /&gt;
	die('No VM found!');&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if($target_image_id === false) {&lt;br /&gt;
	die('No image found!');&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// disassociate the IP address&lt;br /&gt;
$info = $api-&amp;gt;request('vm', 'info', array('vm_id' =&amp;gt; $target_vm_id));&lt;br /&gt;
if(empty($info['info']['ip'])) {&lt;br /&gt;
	die('VM does not have IP!');&lt;br /&gt;
}&lt;br /&gt;
$api-&amp;gt;request('vm', 'floatingip-delete', array('vm_id' =&amp;gt; $target_vm_id, 'keep' =&amp;gt; 'yes'));&lt;br /&gt;
$api-&amp;gt;request('vm', 'delete', array('vm_id' =&amp;gt; $target_vm_id));&lt;br /&gt;
$api-&amp;gt;request('vm', 'create', array('hostname' =&amp;gt; $info['info']['hostname'], 'plan_id' =&amp;gt; $info['extra']['plan_id'], 'image_id' =&amp;gt; $target_image_id, 'ip' =&amp;gt; $info['info']['ip']));&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical details ===&lt;br /&gt;
&lt;br /&gt;
A request can be made given an API ID, API key, category, action, and parameters. The steps are described below. See the code of [https://github.com/LunaNode/lndynamic-api provided API libraries] for more details.&lt;br /&gt;
&lt;br /&gt;
* Create request array by taking parameters and adding &amp;quot;api_id&amp;quot; =&amp;gt; API ID and &amp;quot;api_partialkey&amp;quot; =&amp;gt; first 64 characters of API key.&lt;br /&gt;
* JSON-encode the request array to get a '''raw request message'''.&lt;br /&gt;
* The '''nonce''' is the current UTC time in seconds since epoch (in PHP, &amp;lt;code&amp;gt;$nonce = time();&amp;lt;/code&amp;gt;).&lt;br /&gt;
* The handler path is &amp;quot;{category}/{action}/&amp;quot;&lt;br /&gt;
* The target URL is https://dynamic.lunanode.com/api/{handler_path}&lt;br /&gt;
* Calculate the signature as SHA512-HMAC(&amp;quot;{handler path}|{raw request message}|{nonce}&amp;quot;), using the API key as the HMAC key; here, we are signing the string formed from concatenating handler path, raw request message, and nonce delimited by pipe (|) characters&lt;br /&gt;
* Submit POST request to target URL with these form keys:&lt;br /&gt;
** '''req''': the raw request message&lt;br /&gt;
** '''signature''': the hex-digest output of the SHA512-HMAC&lt;br /&gt;
** '''nonce''': the nonce value&lt;br /&gt;
* The server's response will be a JSON-encoded associative array.&lt;br /&gt;
&lt;br /&gt;
=== Legacy API ===&lt;br /&gt;
&lt;br /&gt;
The legacy API uses simple GET and POST requests for each API action. All API actions are submitted via https://dynamic.lunanode.com/api&lt;br /&gt;
&lt;br /&gt;
For example, to get the info for a virtual machine with hostname &amp;quot;hostname.example.tld&amp;quot;, you can use the following API actions (find the ID for the hostname, then get the info from the ID):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://dynamic.lunanode.com/api?api_id=YOUR_API_ID&amp;amp;api_key=YOUR_API_KEY&amp;amp;category=vm&amp;amp;action=list&lt;br /&gt;
https://dynamic.lunanode.com/api?api_id=YOUR_API_ID&amp;amp;api_key=YOUR_API_KEY&amp;amp;category=vm&amp;amp;action=info&amp;amp;vm_id=FOUND_VM_ID&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The legacy API isn't necessarily less secure than the newer API, as either way all API actions are encrypted under HTTPS; however, the new API does offer greater protection against timing attacks and hides the API key even if an attacker were able to successfully forge an SSL certificate. So, we encourage usage of the new API where it is not inconvenient, but we plan to maintain the legacy API indefinitely.&lt;br /&gt;
&lt;br /&gt;
== Action list ==&lt;br /&gt;
&lt;br /&gt;
This list serves as a reference for available API actions. See [[API Detail]] for additional details for some API operations.&lt;br /&gt;
&lt;br /&gt;
=== Virtual machine ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|start&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|stop&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|reboot&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|diskswap&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|info&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|delete&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|reimage&lt;br /&gt;
|vm_id, image_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|resize&lt;br /&gt;
|vm_id, plan_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|rescue&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|vnc&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|floatingip-add&lt;br /&gt;
|vm_id&lt;br /&gt;
|ip (string unattached floating IP address on your account), private_ip (string internal IP on VM)&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|floatingip-delete&lt;br /&gt;
|vm_id&lt;br /&gt;
|ip (string floating IP attached to VM), keep ('yes' to keep floating IP on account; default 'no')&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|iplist&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|ip-add&lt;br /&gt;
|vm_id&lt;br /&gt;
|ip (string unallocated IP in virtual network)&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|ip-delete&lt;br /&gt;
|vm_id, ip&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|securitygroup-add&lt;br /&gt;
|vm_id, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|securitygroup-remove&lt;br /&gt;
|vm_id, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|create&lt;br /&gt;
|hostname, plan_id, image_id&lt;br /&gt;
|region (default 'toronto'), ip (a floating IP on your account), net_id, securitygroups, scripts, volume_id, volume_virtio, key_id, set_password, affinity_group&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|snapshot&lt;br /&gt;
|vm_id, name (e.g. 'mysnapshot')&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|shelve&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|unshelve&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|rename&lt;br /&gt;
|vm_id, hostname&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: for create command, net_id is a network ID number, securitygroups is a comma-separated list of security group ID numbers, scripts is a comma-separated list of script ID numbers, volume_id is the ID number of an unattached volume that the new VM should be booted from (if volume_id is set, image_id is not required), and affinity_group is an affinity group UUID. Also, if volume_id is set, then the driver is ide if volume_virtio is not set, or virtio of volume_virtio is set (value of volume_virtio is ignored). Finally, key_id is an [https://dynamic.lunanode.com/panel/key SSH keypair ID], and set_password can be set if you want the system to add a startup script to set a randomly generated password (this is ignored if key_id is set; also, the system will set password by default for official templates).&lt;br /&gt;
&lt;br /&gt;
=== DNS ===&lt;br /&gt;
&lt;br /&gt;
API calls relating to DNS are listed below. Valid DNS record types are 'A', 'AAAA', 'CNAME', 'HINFO', 'MX', 'NAPTR', 'NS', 'PTR', 'RP', 'SRV', and 'TXT'.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|set&lt;br /&gt;
|ip, hostname&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|zone-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|zone-add&lt;br /&gt;
|origin (e.g., 'example.tld.')&lt;br /&gt;
|ttl&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|zone-remove&lt;br /&gt;
|zone_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|record-list&lt;br /&gt;
|zone_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|record-add&lt;br /&gt;
|zone_id, name (e.g., 'www'), data (e.g., '1.2.3.4'), ttl, type&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|record-remove&lt;br /&gt;
|record_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-add&lt;br /&gt;
|name, ip&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-update&lt;br /&gt;
|dyn_id, name, ip&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-remove&lt;br /&gt;
|dyn_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Image ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|region (will show images across all regions by default)&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|delete&lt;br /&gt;
|image_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|details&lt;br /&gt;
|image_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|replicate&lt;br /&gt;
|image_id, region&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|fetch&lt;br /&gt;
|region, name, location, format ('iso' or 'qcow2')&lt;br /&gt;
|virtio&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|retrieve&lt;br /&gt;
|image_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
image.fetch fetches an image from an external source. image.retrieve sends the contents of an existing image as the response body.&lt;br /&gt;
&lt;br /&gt;
=== Volume ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|list&lt;br /&gt;
|region&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|create&lt;br /&gt;
|region, label (e.g. 'myvolume'), size (in GB)&lt;br /&gt;
|image, snapshot_id&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|delete&lt;br /&gt;
|region, volume_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|attach&lt;br /&gt;
|region, volume_id, vm_id, target (e.g. 'auto' or '/dev/vdc')&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|detach&lt;br /&gt;
|region, volume_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|info&lt;br /&gt;
|region, volume_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|extend&lt;br /&gt;
|region, volume_id, size (in GB)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|snapshot-create&lt;br /&gt;
|region, volume_id, label&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|snapshot-delete&lt;br /&gt;
|region, snapshot_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|snapshot-list&lt;br /&gt;
|region&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For volume creation, if image parameter (which should be an image ID) and snapshot_id parameter are not set, then an empty volume will be created. If both are set, an error will be returned.&lt;br /&gt;
&lt;br /&gt;
=== Floating IP ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|floating&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|floating&lt;br /&gt;
|add&lt;br /&gt;
|region&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|floating&lt;br /&gt;
|delete&lt;br /&gt;
|region, ip&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Virtual Network ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|network&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|region&lt;br /&gt;
|-&lt;br /&gt;
|network&lt;br /&gt;
|create&lt;br /&gt;
|region, name, subnet (e.g. '192.168.30' for 192.168.30.0/24), dns (e.g. '8.8.8.8,8.8.4.4')&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|network&lt;br /&gt;
|delete&lt;br /&gt;
|region, net_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Load Balancer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|list&lt;br /&gt;
|region&lt;br /&gt;
|net_id&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|create&lt;br /&gt;
|region, net_id, name, method ('ROUND_ROBIN', 'LEAST_CONNECTIONS', or 'SOURCE_IP'), protocol ('HTTP', 'HTTPS', or 'TCP'), connection_limit (-1 for unlimited), port&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|delete&lt;br /&gt;
|region, lb_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|info&lt;br /&gt;
|region, lb_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|member_add&lt;br /&gt;
|region, lb_id, ip, port&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|member_remove&lt;br /&gt;
|region, lb_id, member_id (see lb/info output)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|associate&lt;br /&gt;
|region, lb_id, ip&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Plan and region ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|plan&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|region&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Server monitoring ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-types&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-add&lt;br /&gt;
|name, type, fail_count, success_count, check_interval, (also any parameters needed from check-types)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-remove&lt;br /&gt;
|check_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|contact-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|contact-add&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|contact-remove&lt;br /&gt;
|type ('email', 'sms_twilio', or 'http'), rel (e-mail address, phone number, or URL)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|alert-list&lt;br /&gt;
|check_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|alert-add&lt;br /&gt;
|check_id, contact_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|alert-remove&lt;br /&gt;
|alert_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Security groups ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|create&lt;br /&gt;
|region, name&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|delete&lt;br /&gt;
|region, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rename&lt;br /&gt;
|region, group_id, name&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rule-list&lt;br /&gt;
|region, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rule-insert&lt;br /&gt;
|region, group_id, direction ('ingress' or 'egress'), type (4 or 6), protocol ('*', 'tcp', 'udp', or 'icmp'), remote_type ('cidr' or 'group'), remote_value (CIDR or group ID)&lt;br /&gt;
|port_min, port_max, label&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rule-delete&lt;br /&gt;
|region, group_id, rule_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Startup scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|script&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Billing ===&lt;br /&gt;
&lt;br /&gt;
You can check your credit balance from the API.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|billing&lt;br /&gt;
|credit&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== E-mail ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|usage&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-add&lt;br /&gt;
|name&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-remove&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-dkim-set&lt;br /&gt;
|domain_id, selector, private_key&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-dkim-unset&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-list&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-add&lt;br /&gt;
|domain_id, username, password&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-set-password&lt;br /&gt;
|domain_id, user_id, password&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-remove&lt;br /&gt;
|domain_id, user_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|alias-list&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|alias-add&lt;br /&gt;
|domain_id, name, target&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|alias-remove&lt;br /&gt;
|domain_id, alias_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/API</id>
		<title>API</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/API"/>
				<updated>2017-02-06T14:29:18Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Luna Node Dynamic API enables you to write software to automate VM management. This page details how the API can be accessed. Visit the [https://dynamic.lunanode.com/panel/api API tab] to manage your API keys.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Each API token consists of an API ID and an API key. Both are needed for authentication of all API commands.&lt;br /&gt;
&lt;br /&gt;
API actions consist of a category label, action label, and a set of parameters. For example, to start a VM, the category label is &amp;quot;vm&amp;quot;, action label is &amp;quot;start&amp;quot;, and a &amp;quot;vm_id&amp;quot; parameter must be set. [[API#Action_list|See the full API action list.]]&lt;br /&gt;
&lt;br /&gt;
API requests are made over HTTPS. Once the server completes processing of your request, it will return a JSON-encoded response.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
We provide open source (under MIT License) [https://github.com/LunaNode/lndynamic-api PHP and Python libraries] for accessing the Luna Node Dynamic API. These libraries make interaction with the API easier, handling transaction from category, action, and parameters to the HTTPS request, and from the JSON-encoded response to a PHP associative array or Python dictionary. [https://github.com/LunaNode/lndynamic-api Get the libraries here.]&lt;br /&gt;
&lt;br /&gt;
Third party libraries are also available:&lt;br /&gt;
&lt;br /&gt;
* Golang: a [https://github.com/LunaNode/lobster/tree/master/vmi/lunanode Golang client API] is available as part of the Lobster project.&lt;br /&gt;
* C#: [https://github.com/rickparrish/lndapi rickparrish/lndapi] is a C# API wrapper.&lt;br /&gt;
* PHP: [https://github.com/sdavis1902/lunanode-api-php]&lt;br /&gt;
&lt;br /&gt;
If you are using another programming language, you can view the API call [[API#Technical_details|technical details]] below. You may also find it easier to implement the [[API#Legacy_API|Legacy API]].&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
List your virtual machines:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once('lndynamic.php');&lt;br /&gt;
$api_id = 'YOUR API ID';&lt;br /&gt;
$api_key = 'YOUR API KEY';&lt;br /&gt;
$api = new LNDynamic($api_id, $api_key);&lt;br /&gt;
print_r($api-&amp;gt;request('vm', 'list'));&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;from lndynamic import LNDynamic&lt;br /&gt;
api_id = 'YOUR API ID'&lt;br /&gt;
api_key = 'YOUR API KEY'&lt;br /&gt;
api = LNDynamic(api_id, api_key)&lt;br /&gt;
print api.request('vm', 'list')&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recreate a VM with the same IP:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
require_once('lndynamic.php');&lt;br /&gt;
$api_id = 'YOUR API ID';&lt;br /&gt;
$api_key = 'YOUR API KEY';&lt;br /&gt;
$target_vm_name = 'myvm';&lt;br /&gt;
$target_image_name = 'Ubuntu 14.04 64-bit (template)';&lt;br /&gt;
$api = new LNDynamic($api_id, $api_key);&lt;br /&gt;
&lt;br /&gt;
// find the target virtual machine ID&lt;br /&gt;
$vms = $api-&amp;gt;request('vm', 'list');&lt;br /&gt;
$target_vm_id = false;&lt;br /&gt;
&lt;br /&gt;
foreach($vms['vms'] as $vm) {&lt;br /&gt;
	if(strcasecmp($vm['name'], $target_vm_name) === 0) {&lt;br /&gt;
		$target_vm_id = $vm['vm_id'];&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//find the target image ID&lt;br /&gt;
$images = $api-&amp;gt;request('image', 'list');&lt;br /&gt;
$target_image_id = false;&lt;br /&gt;
&lt;br /&gt;
foreach($images['images'] as $image) {&lt;br /&gt;
	if(strcasecmp($image['name'], $target_image_name) === 0) {&lt;br /&gt;
		$target_image_id = $image['image_id'];&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if($target_vm_id === false) {&lt;br /&gt;
	die('No VM found!');&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if($target_image_id === false) {&lt;br /&gt;
	die('No image found!');&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// disassociate the IP address&lt;br /&gt;
$info = $api-&amp;gt;request('vm', 'info', array('vm_id' =&amp;gt; $target_vm_id));&lt;br /&gt;
if(empty($info['info']['ip'])) {&lt;br /&gt;
	die('VM does not have IP!');&lt;br /&gt;
}&lt;br /&gt;
$api-&amp;gt;request('vm', 'floatingip-delete', array('vm_id' =&amp;gt; $target_vm_id, 'keep' =&amp;gt; 'yes'));&lt;br /&gt;
$api-&amp;gt;request('vm', 'delete', array('vm_id' =&amp;gt; $target_vm_id));&lt;br /&gt;
$api-&amp;gt;request('vm', 'create', array('hostname' =&amp;gt; $info['info']['hostname'], 'plan_id' =&amp;gt; $info['extra']['plan_id'], 'image_id' =&amp;gt; $target_image_id, 'ip' =&amp;gt; $info['info']['ip']));&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Technical details ===&lt;br /&gt;
&lt;br /&gt;
A request can be made given an API ID, API key, category, action, and parameters. The steps are described below. See the code of [https://github.com/LunaNode/lndynamic-api provided API libraries] for more details.&lt;br /&gt;
&lt;br /&gt;
* Create request array by taking parameters and adding &amp;quot;api_id&amp;quot; =&amp;gt; API ID and &amp;quot;api_partialkey&amp;quot; =&amp;gt; first 64 characters of API key.&lt;br /&gt;
* JSON-encode the request array to get a '''raw request message'''.&lt;br /&gt;
* The '''nonce''' is the current UTC time in seconds since epoch (in PHP, &amp;lt;code&amp;gt;$nonce = time();&amp;lt;/code&amp;gt;).&lt;br /&gt;
* The handler path is &amp;quot;{category}/{action}/&amp;quot;&lt;br /&gt;
* The target URL is https://dynamic.lunanode.com/api/{handler_path}&lt;br /&gt;
* Calculate the signature as SHA512-HMAC(&amp;quot;{handler path}|{raw request message}|{nonce}&amp;quot;), using the API key as the HMAC key; here, we are signing the string formed from concatenating handler path, raw request message, and nonce delimited by pipe (|) characters&lt;br /&gt;
* Submit POST request to target URL with these form keys:&lt;br /&gt;
** '''req''': the raw request message&lt;br /&gt;
** '''signature''': the hex-digest output of the SHA512-HMAC&lt;br /&gt;
** '''nonce''': the nonce value&lt;br /&gt;
* The server's response will be a JSON-encoded associative array.&lt;br /&gt;
&lt;br /&gt;
=== Legacy API ===&lt;br /&gt;
&lt;br /&gt;
The legacy API uses simple GET and POST requests for each API action. All API actions are submitted via https://dynamic.lunanode.com/api&lt;br /&gt;
&lt;br /&gt;
For example, to get the info for a virtual machine with hostname &amp;quot;hostname.example.tld&amp;quot;, you can use the following API actions (find the ID for the hostname, then get the info from the ID):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://dynamic.lunanode.com/api?api_id=YOUR_API_ID&amp;amp;api_key=YOUR_API_KEY&amp;amp;category=vm&amp;amp;action=list&lt;br /&gt;
https://dynamic.lunanode.com/api?api_id=YOUR_API_ID&amp;amp;api_key=YOUR_API_KEY&amp;amp;category=vm&amp;amp;action=info&amp;amp;vm_id=FOUND_VM_ID&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The legacy API isn't necessarily less secure than the newer API, as either way all API actions are encrypted under HTTPS; however, the new API does offer greater protection against timing attacks and hides the API key even if an attacker were able to successfully forge an SSL certificate. So, we encourage usage of the new API where it is not inconvenient, but we plan to maintain the legacy API indefinitely.&lt;br /&gt;
&lt;br /&gt;
== Action list ==&lt;br /&gt;
&lt;br /&gt;
This list serves as a reference for available API actions. See [[API Detail]] for additional details for some API operations.&lt;br /&gt;
&lt;br /&gt;
=== Virtual machine ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|start&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|stop&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|reboot&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|diskswap&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|info&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|delete&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|reimage&lt;br /&gt;
|vm_id, image_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|resize&lt;br /&gt;
|vm_id, plan_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|rescue&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|vnc&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|floatingip-add&lt;br /&gt;
|vm_id&lt;br /&gt;
|ip (string unattached floating IP address on your account), private_ip (string internal IP on VM)&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|floatingip-delete&lt;br /&gt;
|vm_id&lt;br /&gt;
|ip (string floating IP attached to VM), keep ('yes' to keep floating IP on account; default 'no')&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|iplist&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|ip-add&lt;br /&gt;
|vm_id&lt;br /&gt;
|ip (string unallocated IP in virtual network)&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|ip-delete&lt;br /&gt;
|vm_id, ip&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|securitygroup-add&lt;br /&gt;
|vm_id, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|securitygroup-remove&lt;br /&gt;
|vm_id, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|create&lt;br /&gt;
|hostname, plan_id, image_id&lt;br /&gt;
|region (default 'toronto'), ip (a floating IP on your account), net_id, securitygroups, scripts, volume_id, volume_virtio, key_id, set_password, affinity_group&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|snapshot&lt;br /&gt;
|vm_id, name (e.g. 'mysnapshot')&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|shelve&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|unshelve&lt;br /&gt;
|vm_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|vm&lt;br /&gt;
|rename&lt;br /&gt;
|vm_id, hostname&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: for create command, net_id is a network ID number, securitygroups is a comma-separated list of security group ID numbers, scripts is a comma-separated list of script ID numbers, volume_id is the ID number of an unattached volume that the new VM should be booted from (if volume_id is set, image_id is not required), and affinity_group is an affinity group UUID. Also, if volume_id is set, then the driver is ide if volume_virtio is not set, or virtio of volume_virtio is set (value of volume_virtio is ignored). Finally, key_id is an [https://dynamic.lunanode.com/panel/key SSH keypair ID], and set_password can be set if you want the system to add a startup script to set a randomly generated password (this is ignored if key_id is set; also, the system will set password by default for official templates).&lt;br /&gt;
&lt;br /&gt;
=== DNS ===&lt;br /&gt;
&lt;br /&gt;
API calls relating to DNS are listed below. Valid DNS record types are 'A', 'AAAA', 'CNAME', 'HINFO', 'MX', 'NAPTR', 'NS', 'PTR', 'RP', 'SRV', and 'TXT'.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|set&lt;br /&gt;
|ip, hostname&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|zone-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|zone-add&lt;br /&gt;
|origin (e.g., 'example.tld.')&lt;br /&gt;
|ttl&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|zone-remove&lt;br /&gt;
|zone_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|record-list&lt;br /&gt;
|zone_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|record-add&lt;br /&gt;
|zone_id, name (e.g., 'www'), data (e.g., '1.2.3.4'), ttl, type&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|record-remove&lt;br /&gt;
|record_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-add&lt;br /&gt;
|name, ip&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-update&lt;br /&gt;
|dyn_id, name, ip&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|dns&lt;br /&gt;
|dyn-remove&lt;br /&gt;
|dyn_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Image ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|region (will show images across all regions by default)&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|delete&lt;br /&gt;
|image_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|details&lt;br /&gt;
|image_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|replicate&lt;br /&gt;
|image_id, region&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|fetch&lt;br /&gt;
|region, name, location, format ('iso' or 'qcow2')&lt;br /&gt;
|virtio&lt;br /&gt;
|-&lt;br /&gt;
|image&lt;br /&gt;
|retrieve&lt;br /&gt;
|image_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
image.fetch fetches an image from an external source. image.retrieve sends the contents of an existing image as the response body.&lt;br /&gt;
&lt;br /&gt;
=== Volume ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|list&lt;br /&gt;
|region&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|create&lt;br /&gt;
|region, label (e.g. 'myvolume'), size (in GB)&lt;br /&gt;
|image, snapshot_id&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|delete&lt;br /&gt;
|region, volume_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|attach&lt;br /&gt;
|region, volume_id, vm_id, target (e.g. 'auto' or '/dev/vdc')&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|detach&lt;br /&gt;
|region, volume_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|info&lt;br /&gt;
|region, volume_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|extend&lt;br /&gt;
|region, volume_id, size (in GB)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|snapshot-create&lt;br /&gt;
|region, volume_id, label&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|snapshot-delete&lt;br /&gt;
|region, snapshot_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|volume&lt;br /&gt;
|snapshot-list&lt;br /&gt;
|region&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For volume creation, if image parameter (which should be an image ID) and snapshot_id parameter are not set, then an empty volume will be created. If both are set, an error will be returned.&lt;br /&gt;
&lt;br /&gt;
=== Floating IP ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|floating&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|floating&lt;br /&gt;
|add&lt;br /&gt;
|region&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|floating&lt;br /&gt;
|delete&lt;br /&gt;
|region, ip&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Virtual Network ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|network&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|region&lt;br /&gt;
|-&lt;br /&gt;
|network&lt;br /&gt;
|create&lt;br /&gt;
|region, name, subnet (e.g. '192.168.30' for 192.168.30.0/24), dns (e.g. '8.8.8.8,8.8.4.4')&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|network&lt;br /&gt;
|delete&lt;br /&gt;
|region, net_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Load Balancer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|list&lt;br /&gt;
|region&lt;br /&gt;
|net_id&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|create&lt;br /&gt;
|region, net_id, name, method ('ROUND_ROBIN', 'LEAST_CONNECTIONS', or 'SOURCE_IP'), protocol ('HTTP', 'HTTPS', or 'TCP'), connection_limit (-1 for unlimited), port&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|delete&lt;br /&gt;
|region, lb_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|info&lt;br /&gt;
|region, lb_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|member_add&lt;br /&gt;
|region, lb_id, ip, port&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|member_remove&lt;br /&gt;
|region, lb_id, member_id (see lb/info output)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|lb&lt;br /&gt;
|associate&lt;br /&gt;
|region, lb_id, ip&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Plan and region ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|plan&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|region&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Server monitoring ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-types&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-add&lt;br /&gt;
|name, type, fail_count, success_count, check_interval, (also any parameters needed from check-types)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|check-remove&lt;br /&gt;
|check_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|contact-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|contact-add&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|contact-remove&lt;br /&gt;
|type ('email', 'sms_twilio', or 'http'), rel (e-mail address, phone number, or URL)&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|alert-list&lt;br /&gt;
|check_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|alert-add&lt;br /&gt;
|check_id, contact_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|monitor&lt;br /&gt;
|alert-remove&lt;br /&gt;
|alert_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Security groups ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|create&lt;br /&gt;
|region, name&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|delete&lt;br /&gt;
|region, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rename&lt;br /&gt;
|region, group_id, name&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rule-list&lt;br /&gt;
|region, group_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rule-insert&lt;br /&gt;
|region, group_id, direction ('ingress' or 'egress'), type (4 or 6), protocol ('*', 'tcp', 'udp', or 'icmp'), remote_type ('cidr' or 'group'), remote_value (CIDR or group ID)&lt;br /&gt;
|port_min, port_max, label&lt;br /&gt;
|-&lt;br /&gt;
|securitygroup&lt;br /&gt;
|rule-delete&lt;br /&gt;
|region, group_id, rule_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Startup scripts ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|script&lt;br /&gt;
|list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Billing ===&lt;br /&gt;
&lt;br /&gt;
You can check your credit balance from the API.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|billing&lt;br /&gt;
|credit&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== E-mail ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Category&lt;br /&gt;
! Action&lt;br /&gt;
! Required parameters&lt;br /&gt;
! Optional parameters&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|usage&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-list&lt;br /&gt;
|None&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-add&lt;br /&gt;
|name&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-remove&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-dkim-set&lt;br /&gt;
|domain_id, selector, private_key&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|domain-dkim-unset&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-list&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-add&lt;br /&gt;
|domain_id, username, password&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-set-password&lt;br /&gt;
|domain_id, user_id, password&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|user-remove&lt;br /&gt;
|domain_id, user_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|alias-list&lt;br /&gt;
|domain_id&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|alias-add&lt;br /&gt;
|domain_id, name, target&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|email&lt;br /&gt;
|alias-remove&lt;br /&gt;
|domain_id, alias_id&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Application_Templates</id>
		<title>Application Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Application_Templates"/>
				<updated>2017-01-31T22:36:13Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Application templates allow you to quickly spin up a ubuntu virtual machine with preinstalled software.&lt;br /&gt;
&lt;br /&gt;
We have templates for:&lt;br /&gt;
&lt;br /&gt;
* LAMP stack - Apache, MySQL, PHP&lt;br /&gt;
* LEMP stack - nginx, MySQL, PHP&lt;br /&gt;
* [https://gitlab.com/ GitLab] - web management of git repositories&lt;br /&gt;
* [https://owncloud.org/ OwnCloud] - file synchronization and sharing platform&lt;br /&gt;
* [https://wordpress.com/ WordPress] - blog software&lt;br /&gt;
* [http://dokku.viewdocs.io/dokku/ Dokku] - single-server git-push-to-deploy PaaS&lt;br /&gt;
&lt;br /&gt;
All templates use Ubuntu 14.04 64-bit.&lt;br /&gt;
&lt;br /&gt;
After the VM is provisioned, you will receive an e-mail with details on how to proceed. In general, any login information will be written to /home/ubuntu/application.txt.&lt;br /&gt;
&lt;br /&gt;
== LAMP and LEMP ==&lt;br /&gt;
&lt;br /&gt;
These templates come with basic webserver and database installed. For PHP, mod_php is used for Apache and php5-fpm for nginx.&lt;br /&gt;
&lt;br /&gt;
The web root directory and MySQL root password can be found in /home/ubuntu/application.txt.&lt;br /&gt;
&lt;br /&gt;
We include a script /opt/ssl.py that will set up your webserver to support SSL, and to automatically obtain and renew SSL certificates via Let's Encrypt. To use it, pass the domains that will be served to the script, e.g. &amp;lt;tt&amp;gt;/opt/ssl.py example.com www.example.com&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== GitLab ==&lt;br /&gt;
&lt;br /&gt;
GitLab is a git repository management tool that includes features such as pull requests, issue tracking, and wikis.&lt;br /&gt;
&lt;br /&gt;
After the VM is provisioned, go to http://[VM external IP]/ and enter a password. You will then be prompted to login; the username is &amp;quot;root&amp;quot;, and the password is what you just entered.&lt;br /&gt;
&lt;br /&gt;
== OwnCloud ==&lt;br /&gt;
&lt;br /&gt;
After the VM is provisioned, go to http://[VM external IP]/ and enter the initial account information.&lt;br /&gt;
&lt;br /&gt;
The MySQL login details for both the root database user and the OwnCloud database can be found in /home/ubuntu/application.txt. OwnCloud will be configured to automatically detect the MySQL database, so you do not ordinarily need to use this.&lt;br /&gt;
&lt;br /&gt;
We include a script /opt/ssl.py that will set up your webserver to support SSL, and to automatically obtain and renew SSL certificates via Let's Encrypt. To use it, pass the domains that will be served to the script, e.g. &amp;lt;tt&amp;gt;/opt/ssl.py example.com www.example.com&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== WordPress ==&lt;br /&gt;
&lt;br /&gt;
After the VM is provisioned, go to http://[VM external IP]/ and enter the initial account information and other configuration details.&lt;br /&gt;
&lt;br /&gt;
The MySQL login details for both the root database user and the WordPress database can be found in /home/ubuntu/application.txt. WordPress will be configured to automatically detect the MySQL database, so you do not ordinarily need to use this.&lt;br /&gt;
&lt;br /&gt;
We include a script /opt/ssl.py that will set up your webserver to support SSL, and to automatically obtain and renew SSL certificates via Let's Encrypt. To use it, pass the domains that will be served to the script, e.g. &amp;lt;tt&amp;gt;/opt/ssl.py example.com www.example.com&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Dokku ==&lt;br /&gt;
&lt;br /&gt;
If you selected an SSH key when provisioning the VM, then Dokku will already be set up with the key. Otherwise, go to http://[VM external IP]/ to configure Dokku.&lt;br /&gt;
&lt;br /&gt;
You can modify the hostname used by Dokku later by editing /home/dokku/HOSTNAME.&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Volumes</id>
		<title>Volumes</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Volumes"/>
				<updated>2017-01-23T18:28:53Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Volumes are detachable block storage devices that are stored volumes on a fault-tolerant distributed block storage cluster (Ceph RBD), and can be attached and detached from virtual machine instances on the fly.&lt;br /&gt;
&lt;br /&gt;
== Use cases ==&lt;br /&gt;
&lt;br /&gt;
* Keep non-disposable data, such as database files or images, on a detachable volume. Then, if you need to terminate the virtual machine instance for some reason (such as OS upgrade), you can simply detach the volume from the old instance and attach it to a new one.&lt;br /&gt;
* If a host node fails, you can transfer the volume to a different VM and remain online.&lt;br /&gt;
* Increase the capacity of your virtual machine (volumes are stored on DFS so can have larger capacity than a locally-stored VM).&lt;br /&gt;
&lt;br /&gt;
== Managing volumes ==&lt;br /&gt;
&lt;br /&gt;
Start off by creating a new, empty volume. Head over to the [https://dynamic.lunanode.com/panel/volumes volume management page], enter a label (like &amp;quot;myvolume&amp;quot;) and a size in gigabytes, and press the create button. Note that volume storage is charged at $0.03 per GB per month, billed hourly.&lt;br /&gt;
&lt;br /&gt;
After a few seconds, your volume should be ready. You can view volume details by selecting the name from the volume list.&lt;br /&gt;
&lt;br /&gt;
Once the status on the volume details page shows as '''available''', the volume is ready to be attached to a virtual machine instance. You can select the virtual machine from the dropdown and hit &amp;quot;Attach volume&amp;quot; (leave target device as auto; if that fails, then try setting it to /dev/vdc or /dev/hdc, depending on your disk driver).&lt;br /&gt;
&lt;br /&gt;
Now, login to your virtual machine; in /dev, you should see the volume appear now. You will want to format it so that you can mount it as a filesystem on your VM:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkfs.ext4 /dev/vdc&lt;br /&gt;
mkdir /mnt/myvolume&lt;br /&gt;
mount /dev/vdc /mnt/myvolume&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you will be able to access the volume via '''/mnt/myvolume'''. (Note that the device might be '''/dev/hdc''' or '''/dev/sdc''' or something else instead of '''/dev/vdc'''.)&lt;br /&gt;
&lt;br /&gt;
You can also boot a new virtual machine instance from a volume by selecting the volume in the VM creation page. The volume must be available or this will throw an error.&lt;br /&gt;
&lt;br /&gt;
'''Note for IDE driver''': if you are using IDE driver (didn't select virtio when adding an image; Windows for example does not natively support virtio) then you will need to shut-down your VM prior to attaching the volume. The &amp;quot;auto&amp;quot; target will also not work, you should enter /dev/hdc instead.&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Volumes</id>
		<title>Volumes</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Volumes"/>
				<updated>2017-01-23T18:28:35Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Volumes are detachable block storage devices that are stored volumes on a fault-tolerant distributed block storage cluster (Ceph RBD), and can be attached and detached from virtual machine instances on the fly.&lt;br /&gt;
&lt;br /&gt;
== Use cases ==&lt;br /&gt;
&lt;br /&gt;
* Keep non-disposable data, such as database files or images, on a detachable volume. Then, if you need to terminate the virtual machine instance for some reason (such as OS upgrade), you can simply detach the volume from the old instance and attach it to a new one.&lt;br /&gt;
* If a host node fails, you can transfer the volume to a different VM and remain online.&lt;br /&gt;
* Increase the capacity of your virtual machine (volumes are stored on DFS so can have larger capacity than a locally-stored VM).&lt;br /&gt;
&lt;br /&gt;
== Managing volumes ==&lt;br /&gt;
&lt;br /&gt;
Start off by creating a new, empty volume. Head over to the [https://dynamic.lunanode.com/panel/volumes volume management page], enter a label (like &amp;quot;myvolume&amp;quot;) and a size in gigabytes, and press the create button. Note that volume storage is charged at $0.03 per GB per month, billed hourly.&lt;br /&gt;
&lt;br /&gt;
After a few seconds, your volume should be ready. You can view volume details by selecting the name from the volume list.&lt;br /&gt;
&lt;br /&gt;
Once the status on the volume details page shows as '''available''', the volume is ready to be attached to a virtual machine instance. You can select the virtual machine from the dropdown and hit &amp;quot;Attach volume&amp;quot; (leave target device as auto; if that fails, then try setting it to /dev/vdc or /dev/hdc, depending on your disk driver).&lt;br /&gt;
&lt;br /&gt;
Now, login to your virtual machine; in /dev, you should see the volume appear now. You will want to format it so that you can mount it as a filesystem on your VM:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkfs.ext4 /dev/vdc&lt;br /&gt;
mkdir /mnt/myvolmue&lt;br /&gt;
mount /dev/vdc /mnt/myvolume&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you will be able to access the volume via '''/mnt/myvolume'''. (Note that the device might be '''/dev/hdc''' or '''/dev/sdc''' or something else instead of '''/dev/vdc'''.)&lt;br /&gt;
&lt;br /&gt;
You can also boot a new virtual machine instance from a volume by selecting the volume in the VM creation page. The volume must be available or this will throw an error.&lt;br /&gt;
&lt;br /&gt;
'''Note for IDE driver''': if you are using IDE driver (didn't select virtio when adding an image; Windows for example does not natively support virtio) then you will need to shut-down your VM prior to attaching the volume. The &amp;quot;auto&amp;quot; target will also not work, you should enter /dev/hdc instead.&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Rescue_Mode</id>
		<title>Rescue Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Rescue_Mode"/>
				<updated>2017-01-23T17:10:11Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: Created page with &amp;quot;Rescue mode boots your virtual machine with our ubuntu rescue image.  The login for the virtual machine in rescue mode is &amp;quot;rescue/rescue&amp;quot; Once logged in you will be able to mo...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Rescue mode boots your virtual machine with our ubuntu rescue image. &lt;br /&gt;
The login for the virtual machine in rescue mode is &amp;quot;rescue/rescue&amp;quot;&lt;br /&gt;
Once logged in you will be able to mount your virtual machine's disk and perform any operations you may need.&lt;br /&gt;
Once done, click &amp;quot;Unrescue&amp;quot; button to bring the virtual machine out of rescue mode.&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Main_Page"/>
				<updated>2017-01-23T17:08:23Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the [https://lunanode.com/ Luna Node] wiki! You may have been looking for our main [https://dynamic.lunanode.com/info.php Luna Node Dynamic] website.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://dynamic.lunanode.com/info.php General information]&lt;br /&gt;
* [[Create your first instance]]&lt;br /&gt;
* [[Billing]]&lt;br /&gt;
* [http://status.lunanode.com/ Network/power status]&lt;br /&gt;
* [[Frequently asked questions]]&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
See these pages for details on how to use the core cloud features:&lt;br /&gt;
&lt;br /&gt;
* [[Snapshots]]&lt;br /&gt;
* [[Security groups]]&lt;br /&gt;
* [[Volumes]]&lt;br /&gt;
* [[Startup scripts]]&lt;br /&gt;
* [[Floating IP addresses]]&lt;br /&gt;
* [[Virtual networks]]&lt;br /&gt;
&lt;br /&gt;
We also have various miscellaneous features and information:&lt;br /&gt;
&lt;br /&gt;
* [[Server monitoring]]&lt;br /&gt;
* [[DNS]]&lt;br /&gt;
* [[API]]&lt;br /&gt;
* [[Managed Support]]&lt;br /&gt;
* [[Flexible plans]]&lt;br /&gt;
* [[Hardware specifications]]&lt;br /&gt;
* [[Application Templates]]&lt;br /&gt;
* [[Shelving]]&lt;br /&gt;
* [[Rescue Mode]]&lt;br /&gt;
== How To ==&lt;br /&gt;
&lt;br /&gt;
* [[ISO Installation]]&lt;br /&gt;
* [[Panel authentication|Control panel authentication]]&lt;br /&gt;
* [[Reselling]]&lt;br /&gt;
* [[Network configuration]]&lt;br /&gt;
* [[Volume-backed instance]]&lt;br /&gt;
&lt;br /&gt;
Below are short pages with miscellaneous information.&lt;br /&gt;
&lt;br /&gt;
* [[Increase network throughput]]&lt;br /&gt;
* [[Receive encrypted mail]]&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Frequently_asked_questions</id>
		<title>Frequently asked questions</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Frequently_asked_questions"/>
				<updated>2016-10-14T07:09:19Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Cannot connect with SSH to newly booted VM ===&lt;br /&gt;
&lt;br /&gt;
The provisioning and booting process may take as long as five minutes in some cases, depending on the specific operating system you are selecting. You can monitor progress over VNC by hitting the VNC Connection button. Once booted, you will be able to authenticate via SSH using the username and password displayed on the virtual machine page (or SSH key if you specified one).&lt;br /&gt;
&lt;br /&gt;
Note that if you selected an image marked &amp;quot;ISO&amp;quot; when provisioning the VM, you will have to install the operating system via VNC. If you simply want a ready-made VM up and running, you should select an image marked &amp;quot;template&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
=== I cannot ping my IP address 172.20.8.187 ===&lt;br /&gt;
&lt;br /&gt;
The IP address starting with 172 is the private IP address for your VM. Go to your VM details page and look for the &amp;quot;external IP address&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== How to purchase the Special XYZ plan? ===&lt;br /&gt;
&lt;br /&gt;
First, check https://dynamic.lunanode.com/info to make sure it is still in stock. If so, you can [https://dynamic.lunanode.com/register register an account] and then go to the Create VM sidebar option to create the VM of your desired special plan. Note that special plans are only available for a limited time.&lt;br /&gt;
&lt;br /&gt;
=== Do you support IPv6? ===&lt;br /&gt;
&lt;br /&gt;
Yes! We support IPv6 in Toronto. Virtual machines are automatically assigned an IPv6 address via SLAAC. User-created virtual networks receive a /64 IPv6 allocation, and virtual machines created on such networks can use any address on the allocated subnet.&lt;br /&gt;
&lt;br /&gt;
=== My account request was denied ===&lt;br /&gt;
&lt;br /&gt;
We do not accept new account registrations from proxies, hosting services, or other non-residential/business IP addresses. Please contact support@lunanode.com if you do not know why your account request was denied.&lt;br /&gt;
&lt;br /&gt;
=== How to resize my VM? ===&lt;br /&gt;
&lt;br /&gt;
To resize your VM, select the VM and use the Resize utility.&lt;br /&gt;
&lt;br /&gt;
Note that the resize will fail if you attempt to resize a local-storage-backed instance to a plan with a smaller disk size. Follow these steps to resize a VM down:&lt;br /&gt;
&lt;br /&gt;
* Take a snapshot of the VM&lt;br /&gt;
* Once the snapshot is ready (you can monitor the progress from the Images tab), go to the Volumes tab and create a volume from the snapshot with the old snapshot size&lt;br /&gt;
* Boot a new VM with &amp;quot;Ubuntu 14.04 64-bit&amp;quot; template, and attach the volume to the VM&lt;br /&gt;
* Assuming that the volume is attached at /dev/vdc, run &amp;lt;tt&amp;gt;resize2fs /dev/vdc1 10G&amp;lt;/tt&amp;gt; (replacing 10G with desired size in gigabytes; aim for as small a size as possible, so that the partition and disk will fit)&lt;br /&gt;
* Then, run fdisk /dev/vdc and re-create the partition; make sure the start sector is the same, and also make sure to set the bootable flag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# fdisk /dev/vdc&lt;br /&gt;
&lt;br /&gt;
Command (m for help): p&lt;br /&gt;
&lt;br /&gt;
Disk /dev/vdc: 37.6 GB, 37580963840 bytes&lt;br /&gt;
4 heads, 32 sectors/track, 573440 cylinders, total 73400320 sectors&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000d8e94&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/vdc1   *        2048    73400319    36699136   83  Linux&lt;br /&gt;
&lt;br /&gt;
Command (m for help): d 1&lt;br /&gt;
Selected partition 1&lt;br /&gt;
&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Partition type:&lt;br /&gt;
   p   primary (0 primary, 0 extended, 4 free)&lt;br /&gt;
   e   extended&lt;br /&gt;
Select (default p): &lt;br /&gt;
Using default response p&lt;br /&gt;
Partition number (1-4, default 1): &lt;br /&gt;
Using default value 1&lt;br /&gt;
First sector (2048-73400319, default 2048): &lt;br /&gt;
Using default value 2048&lt;br /&gt;
Last sector, +sectors or +size{K,M,G} (2048-73400319, default 73400319): 33556479&lt;br /&gt;
&lt;br /&gt;
Command (m for help): a&lt;br /&gt;
Partition number (1-4): 1&lt;br /&gt;
&lt;br /&gt;
Command (m for help): w&lt;br /&gt;
The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
Calling ioctl() to re-read partition table.&lt;br /&gt;
Syncing disks.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Above, to calculate the last sector, you can try multiplying the default last sector by the fraction that you're resizing down; e.g. if resizing from 35 GB to 15 GB, multiply (73400319 / 35 * 14) (we use 14 instead of just 15 since the partition table and other elements take up some space; do make sure that the filesystem has been resized to less than this many GB in the &amp;lt;tt&amp;gt;resize2fs&amp;lt;/tt&amp;gt; command earlier).&lt;br /&gt;
&lt;br /&gt;
* Create a new volume with the desired size, and attach it to the same VM&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;fdisk /dev/vdd&amp;lt;/tt&amp;gt; to create identical partitions on the new volume&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;dd if=/dev/vdc1 of=/dev/vdd1 bs=64k&amp;lt;/tt&amp;gt; to copy data from the partition on the old volume to the partition on the new volume&lt;br /&gt;
* Detach both volumes from the VM, and delete the volume with old size&lt;br /&gt;
* Select the volume with new size from the Volumes tab, and convert it to an image&lt;br /&gt;
* Boot the new VM from the image&lt;br /&gt;
&lt;br /&gt;
=== Unable to attach volume to my Windows VM ===&lt;br /&gt;
&lt;br /&gt;
Volumes are best used with Linux virtual machines using the virtio driver. If you are using another operating system or ide driver, then you likely will need to shut down the VM before attaching or detaching volumes. You may also need to specify the attachment target as /dev/hdc or /dev/hdd or etc.&lt;br /&gt;
&lt;br /&gt;
=== What is the default username for virtual machines provisioned using the stock templates ===&lt;br /&gt;
The administrative username for template-based virtual machines are as the following:&lt;br /&gt;
*Ubuntu: ubuntu&lt;br /&gt;
*Debian: debian&lt;br /&gt;
*CentOS: cloud-user / centos&lt;br /&gt;
*Fedora: fedora&lt;br /&gt;
*CoreOS: core&lt;br /&gt;
&lt;br /&gt;
=== I cannot login as root! ===&lt;br /&gt;
&lt;br /&gt;
As stated in the &amp;quot;VM provisioned successfully&amp;quot; email, template-based virtual machines are configured to accept connections with the administrative user. The password is displayed on the virtual machine details page. For security reasons, the VM does not accept root login by default.&lt;br /&gt;
&lt;br /&gt;
Once authenticated as the administrative user, you can execute &amp;lt;tt&amp;gt;sudo su&amp;lt;/tt&amp;gt; to login as root.&lt;br /&gt;
&lt;br /&gt;
If you wish, you can of course set a root password. First, login as root by authenticating with the administrative user and running &amp;lt;tt&amp;gt;sudo su&amp;lt;/tt&amp;gt;. Then, run &amp;lt;tt&amp;gt;passwd&amp;lt;/tt&amp;gt; to set a root user password. Finally, edit the SSH configuration:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sed -i 's/PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config&lt;br /&gt;
service ssh restart; service sshd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then logout and you should be able to authenicate via SSH directly as the root user with your newly set password.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use a [[Startup scripts|startup script]] so that the root password is set when the VM boots.&lt;br /&gt;
&lt;br /&gt;
Note: use an SSH client like [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty] to authenticate.&lt;br /&gt;
&lt;br /&gt;
Please note that our services are unmanaged and you are responsible or the security of your VM; if your VM is taken over and used in denial of service attacks, spam, or other activities that violate our [https://dynamic.lunanode.com/terms terms of service], your account may be suspended depending on the circumstances.&lt;br /&gt;
&lt;br /&gt;
=== Is additional bandwidth usage billed hourly? What about CPU usage for flexible plans? ===&lt;br /&gt;
&lt;br /&gt;
Both bandwidth and CPU are billed as '''consumable resources''', i.e., you are charged for the amount that you use. For example, if you use 5 GB bandwidth, then you will be billed $0.003 for each GB, and it does not matter how long it takes you to use that 5 GB. Similarly, for CPU usage, if you use 10 CPU-core-hours (e.g. 5% of a CPU core for 200 hours, or 100% of a CPU core for 10 hours) then you will be billed $0.22, and again it doesn't matter what timespan you use it over.&lt;br /&gt;
&lt;br /&gt;
So, the question of whether we bill &amp;quot;hourly&amp;quot; versus &amp;quot;monthly&amp;quot; doesn't make sense for flexible resources (including additional bandwidth on all plans, as well as bandwidth / CPU for flexible plans). For fixed resources (memory, disk size, etc.), though, we do bill hourly.&lt;br /&gt;
&lt;br /&gt;
If you are still confused, this is probably because you are used to monthly providers that may charge for additional CPU core or additional 1 TB bandwidth for the next month. The reason that monthly providers do this is because they don't expect you to use the full allocation, and if you only use 500 GB additional bandwidth then they save 500 GB on their end. However, in our case, we charge for resources '''as they are being consumed''' instead of in advance, so hourly versus monthly no longer matters, and you only need to pay for what you use.&lt;br /&gt;
&lt;br /&gt;
=== My disk space is smaller than the plan disk ===&lt;br /&gt;
&lt;br /&gt;
Almost all of the templates will automatically resize the partition and filesystem the first time that the virtual machine boots. If you install from ISO, you can also choose the partitioning scheme.&lt;br /&gt;
&lt;br /&gt;
So, if you are having this problem where filesystem doesn't actually get resized, it likely means you are using the CentOS 6 template, which does not support automatic filesystem resizing. You can instead run the following commands to manually resize the partition/filesystem:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
fdisk /dev/vda&lt;br /&gt;
&amp;gt; u&lt;br /&gt;
(this will switch units to sector; it is important that you use sectors and not cylinders!)&lt;br /&gt;
&amp;gt; p&lt;br /&gt;
(this will print all of the partitions, we will refer to the data later)&lt;br /&gt;
&amp;gt; d 1&lt;br /&gt;
(this will display &amp;quot;Selected partition 1&amp;quot; and delete the first partition)&lt;br /&gt;
&amp;gt; n&lt;br /&gt;
(select &amp;quot;p&amp;quot; for primary partition)&lt;br /&gt;
(partition number should be 1, but make sure it matches the number displayed in print command)&lt;br /&gt;
(first sector should be 2048, but make sure it matches the &amp;quot;Start&amp;quot; column displayed in print command)&lt;br /&gt;
(and set last sector to the default value)&lt;br /&gt;
&amp;gt; a&lt;br /&gt;
(type &amp;quot;1&amp;quot; to make new first partition bootable)&lt;br /&gt;
&amp;gt; w&lt;br /&gt;
(this will write the new partitions and exit fdisk)&lt;br /&gt;
shutdown -r 0&lt;br /&gt;
(connect to VM after it reboots, if it has resized partition but not filesystem then run resize2fs)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Warning: when creating the new partition, make sure that the first sector matches the sector displayed in print command (typically 2048). The default option that fdisk will provide is incorrect.&lt;br /&gt;
&lt;br /&gt;
=== The VNC connection doesn't work for me ===&lt;br /&gt;
&lt;br /&gt;
This is usually caused by a firewall on your computer, router, or at your ISP; or because of outdated browser software. If you are using the noVNC client, first try switching to another browser and see if it works there.&lt;br /&gt;
&lt;br /&gt;
If it still doesn't connect (e.g. you get &amp;quot;Connection Timeout&amp;quot; error), then you can try to use the VNC tunnel connection method so that you can use your own desktop VNC client instead of noVNC. To do this, go to the Account tab in the top right, scroll down to VNC Connection Method, and change to tunnel. Then, when you click the VNC button, you will be given VNC login details that you can plug into your desktop VNC client to connect to your virtual machine instance.&lt;br /&gt;
&lt;br /&gt;
Note: you may have to subtract 5900 from the port provided by the tunnel in some cases. So for example, if the panel says to connect to 167.114.159.49:6105, and that doesn't work, then also try connecting to 167.114.159.49:205.&lt;br /&gt;
&lt;br /&gt;
=== Can I shutdown my VMs to avoid being billed? ===&lt;br /&gt;
&lt;br /&gt;
You can use the Shelve functionality to deactivate your virtual machine. Once a VM is shelved, you will only be billed for the storage space, at $0.03/GB/mo, and assigned IP addresses, at $1/mo (both fees are charged hourly); the pricing change will be reflected in the billing section of the panel dashboard. You can reactivate the VM at any time by pressing Unshelve from the VM details.&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Hardware_specifications</id>
		<title>Hardware specifications</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Hardware_specifications"/>
				<updated>2016-10-05T12:51:56Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Toronto ==&lt;br /&gt;
&lt;br /&gt;
Host nodes for SSD VMs come with:&lt;br /&gt;
&lt;br /&gt;
* Dual Xeon E5-2670 CPUs&lt;br /&gt;
* Hardware RAID&lt;br /&gt;
* Pure SSD RAID10 storage array&lt;br /&gt;
* 2x10gbps ports, one for VM network and one for the storage cluster&lt;br /&gt;
&lt;br /&gt;
Host nodes for SSD-cached VMs come with:&lt;br /&gt;
&lt;br /&gt;
* Dual Xeon L5639 CPUs&lt;br /&gt;
* Hardware RAID&lt;br /&gt;
* RAID10 HDD storage array cached with high-performance SSDs in RAID1&lt;br /&gt;
* 2x10gbps ports, one for VM network and one for the storage cluster&lt;br /&gt;
&lt;br /&gt;
== Montreal ==&lt;br /&gt;
&lt;br /&gt;
Montreal servers are equipped with:&lt;br /&gt;
&lt;br /&gt;
* Dual Xeon E5-2640v3 / E5-2660v3 CPUs&lt;br /&gt;
* Hardware RAID&lt;br /&gt;
* RAID10 HDD / SSD storage array cached with high-performance SSDs in RAID1&lt;br /&gt;
* 10gbps port for VM network and storage cluster&lt;br /&gt;
* OVH Anti-DDoS Pro DDoS mitigation system&lt;br /&gt;
&lt;br /&gt;
== Roubaix ==&lt;br /&gt;
&lt;br /&gt;
In Roubaix, servers have:&lt;br /&gt;
&lt;br /&gt;
* Dual Xeon E5-2640v3&lt;br /&gt;
* Hardware RAID&lt;br /&gt;
* RAID10 HDD storage array cached with high-performance SSDs in RAID1&lt;br /&gt;
* 10gbps port for VM network and storage cluster&lt;br /&gt;
* OVH Anti-DDoS Pro DDoS mitigation system&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Frequently_asked_questions</id>
		<title>Frequently asked questions</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Frequently_asked_questions"/>
				<updated>2016-09-14T13:19:37Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Cannot connect with SSH to newly booted VM ===&lt;br /&gt;
&lt;br /&gt;
The provisioning and booting process may take as long as five minutes in some cases, depending on the specific operating system you are selecting. You can monitor progress over VNC by hitting the VNC Connection button. Once booted, you will be able to authenticate via SSH using the username and password displayed on the virtual machine page (or SSH key if you specified one).&lt;br /&gt;
&lt;br /&gt;
Note that if you selected an image marked &amp;quot;ISO&amp;quot; when provisioning the VM, you will have to install the operating system via VNC. If you simply want a ready-made VM up and running, you should select an image marked &amp;quot;template&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
=== I cannot ping my IP address 172.20.8.187 ===&lt;br /&gt;
&lt;br /&gt;
The IP address starting with 172 is the private IP address for your VM. Go to your VM details page and look for the &amp;quot;external IP address&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== How to purchase the Special XYZ plan? ===&lt;br /&gt;
&lt;br /&gt;
First, check https://dynamic.lunanode.com/info to make sure it is still in stock. If so, you can [https://dynamic.lunanode.com/register register an account] and then go to the Create VM sidebar option to create the VM of your desired special plan. Note that special plans are only available for a limited time.&lt;br /&gt;
&lt;br /&gt;
=== Do you support IPv6? ===&lt;br /&gt;
&lt;br /&gt;
Yes! We support IPv6 in Toronto. Virtual machines are automatically assigned an IPv6 address via SLAAC. User-created virtual networks receive a /64 IPv6 allocation, and virtual machines created on such networks can use any address on the allocated subnet.&lt;br /&gt;
&lt;br /&gt;
=== My account request was denied ===&lt;br /&gt;
&lt;br /&gt;
We do not accept new account registrations from proxies, hosting services, or other non-residential/business IP addresses. Please contact support@lunanode.com if you do not know why your account request was denied.&lt;br /&gt;
&lt;br /&gt;
=== How to resize my VM? ===&lt;br /&gt;
&lt;br /&gt;
To resize your VM, select the VM and use the Resize utility.&lt;br /&gt;
&lt;br /&gt;
Note that the resize will fail if you attempt to resize a local-storage-backed instance to a plan with a smaller disk size. Follow these steps to resize a VM down:&lt;br /&gt;
&lt;br /&gt;
* Take a snapshot of the VM&lt;br /&gt;
* Once the snapshot is ready (you can monitor the progress from the Images tab), go to the Volumes tab and create a volume from the snapshot with the old snapshot size&lt;br /&gt;
* Boot a new VM with &amp;quot;Ubuntu 14.04 64-bit&amp;quot; template, and attach the volume to the VM&lt;br /&gt;
* Assuming that the volume is attached at /dev/vdc, run &amp;lt;tt&amp;gt;resize2fs /dev/vdc1 10G&amp;lt;/tt&amp;gt; (replacing 10G with desired size in gigabytes; aim for as small a size as possible, so that the partition and disk will fit)&lt;br /&gt;
* Then, run fdisk /dev/vdc and re-create the partition; make sure the start sector is the same, and also make sure to set the bootable flag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# fdisk /dev/vdc&lt;br /&gt;
&lt;br /&gt;
Command (m for help): p&lt;br /&gt;
&lt;br /&gt;
Disk /dev/vdc: 37.6 GB, 37580963840 bytes&lt;br /&gt;
4 heads, 32 sectors/track, 573440 cylinders, total 73400320 sectors&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000d8e94&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/vdc1   *        2048    73400319    36699136   83  Linux&lt;br /&gt;
&lt;br /&gt;
Command (m for help): d 1&lt;br /&gt;
Selected partition 1&lt;br /&gt;
&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Partition type:&lt;br /&gt;
   p   primary (0 primary, 0 extended, 4 free)&lt;br /&gt;
   e   extended&lt;br /&gt;
Select (default p): &lt;br /&gt;
Using default response p&lt;br /&gt;
Partition number (1-4, default 1): &lt;br /&gt;
Using default value 1&lt;br /&gt;
First sector (2048-73400319, default 2048): &lt;br /&gt;
Using default value 2048&lt;br /&gt;
Last sector, +sectors or +size{K,M,G} (2048-73400319, default 73400319): 33556479&lt;br /&gt;
&lt;br /&gt;
Command (m for help): a&lt;br /&gt;
Partition number (1-4): 1&lt;br /&gt;
&lt;br /&gt;
Command (m for help): w&lt;br /&gt;
The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
Calling ioctl() to re-read partition table.&lt;br /&gt;
Syncing disks.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Above, to calculate the last sector, you can try multiplying the default last sector by the fraction that you're resizing down; e.g. if resizing from 35 GB to 15 GB, multiply (73400319 / 35 * 14) (we use 14 instead of just 15 since the partition table and other elements take up some space; do make sure that the filesystem has been resized to less than this many GB in the &amp;lt;tt&amp;gt;resize2fs&amp;lt;/tt&amp;gt; command earlier).&lt;br /&gt;
&lt;br /&gt;
* Create a new volume with the desired size, and attach it to the same VM&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;fdisk /dev/vdd&amp;lt;/tt&amp;gt; to create identical partitions on the new volume&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;dd if=/dev/vdc1 of=/dev/vdd1 bs=64k&amp;lt;/tt&amp;gt; to copy data from the partition on the old volume to the partition on the new volume&lt;br /&gt;
* Detach both volumes from the VM, and delete the volume with old size&lt;br /&gt;
* Select the volume with new size from the Volumes tab, and convert it to an image&lt;br /&gt;
* Boot the new VM from the image&lt;br /&gt;
&lt;br /&gt;
=== Unable to attach volume to my Windows VM ===&lt;br /&gt;
&lt;br /&gt;
Volumes are best used with Linux virtual machines using the virtio driver. If you are using another operating system or ide driver, then you likely will need to shut down the VM before attaching or detaching volumes. You may also need to specify the attachment target as /dev/hdc or /dev/hdd or etc.&lt;br /&gt;
&lt;br /&gt;
=== What is the default username for virtual machines provisioned using the stock templates ===&lt;br /&gt;
The administrative username for template-based virtual machines are as the following:&lt;br /&gt;
Ubuntu: ubuntu&lt;br /&gt;
Debian: debian&lt;br /&gt;
CentOS: cloud-user / centos&lt;br /&gt;
Fedora: fedora&lt;br /&gt;
&lt;br /&gt;
=== I cannot login as root! ===&lt;br /&gt;
&lt;br /&gt;
As stated in the &amp;quot;VM provisioned successfully&amp;quot; email, template-based virtual machines are configured to accept connections with the administrative user. The password is displayed on the virtual machine details page. For security reasons, the VM does not accept root login by default.&lt;br /&gt;
&lt;br /&gt;
Once authenticated as the administrative user, you can execute &amp;lt;tt&amp;gt;sudo su&amp;lt;/tt&amp;gt; to login as root.&lt;br /&gt;
&lt;br /&gt;
If you wish, you can of course set a root password. First, login as root by authenticating with the administrative user and running &amp;lt;tt&amp;gt;sudo su&amp;lt;/tt&amp;gt;. Then, run &amp;lt;tt&amp;gt;passwd&amp;lt;/tt&amp;gt; to set a root user password. Finally, edit the SSH configuration:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sed -i 's/PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config&lt;br /&gt;
service ssh restart; service sshd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then logout and you should be able to authenicate via SSH directly as the root user with your newly set password.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use a [[Startup scripts|startup script]] so that the root password is set when the VM boots.&lt;br /&gt;
&lt;br /&gt;
Note: use an SSH client like [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty] to authenticate.&lt;br /&gt;
&lt;br /&gt;
Please note that our services are unmanaged and you are responsible or the security of your VM; if your VM is taken over and used in denial of service attacks, spam, or other activities that violate our [https://dynamic.lunanode.com/terms terms of service], your account may be suspended depending on the circumstances.&lt;br /&gt;
&lt;br /&gt;
=== Is additional bandwidth usage billed hourly? What about CPU usage for flexible plans? ===&lt;br /&gt;
&lt;br /&gt;
Both bandwidth and CPU are billed as '''consumable resources''', i.e., you are charged for the amount that you use. For example, if you use 5 GB bandwidth, then you will be billed $0.003 for each GB, and it does not matter how long it takes you to use that 5 GB. Similarly, for CPU usage, if you use 10 CPU-core-hours (e.g. 5% of a CPU core for 200 hours, or 100% of a CPU core for 10 hours) then you will be billed $0.22, and again it doesn't matter what timespan you use it over.&lt;br /&gt;
&lt;br /&gt;
So, the question of whether we bill &amp;quot;hourly&amp;quot; versus &amp;quot;monthly&amp;quot; doesn't make sense for flexible resources (including additional bandwidth on all plans, as well as bandwidth / CPU for flexible plans). For fixed resources (memory, disk size, etc.), though, we do bill hourly.&lt;br /&gt;
&lt;br /&gt;
If you are still confused, this is probably because you are used to monthly providers that may charge for additional CPU core or additional 1 TB bandwidth for the next month. The reason that monthly providers do this is because they don't expect you to use the full allocation, and if you only use 500 GB additional bandwidth then they save 500 GB on their end. However, in our case, we charge for resources '''as they are being consumed''' instead of in advance, so hourly versus monthly no longer matters, and you only need to pay for what you use.&lt;br /&gt;
&lt;br /&gt;
=== My disk space is smaller than the plan disk ===&lt;br /&gt;
&lt;br /&gt;
Almost all of the templates will automatically resize the partition and filesystem the first time that the virtual machine boots. If you install from ISO, you can also choose the partitioning scheme.&lt;br /&gt;
&lt;br /&gt;
So, if you are having this problem where filesystem doesn't actually get resized, it likely means you are using the CentOS 6 template, which does not support automatic filesystem resizing. You can instead run the following commands to manually resize the partition/filesystem:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
fdisk /dev/vda&lt;br /&gt;
&amp;gt; u&lt;br /&gt;
(this will switch units to sector; it is important that you use sectors and not cylinders!)&lt;br /&gt;
&amp;gt; p&lt;br /&gt;
(this will print all of the partitions, we will refer to the data later)&lt;br /&gt;
&amp;gt; d 1&lt;br /&gt;
(this will display &amp;quot;Selected partition 1&amp;quot; and delete the first partition)&lt;br /&gt;
&amp;gt; n&lt;br /&gt;
(select &amp;quot;p&amp;quot; for primary partition)&lt;br /&gt;
(partition number should be 1, but make sure it matches the number displayed in print command)&lt;br /&gt;
(first sector should be 2048, but make sure it matches the &amp;quot;Start&amp;quot; column displayed in print command)&lt;br /&gt;
(and set last sector to the default value)&lt;br /&gt;
&amp;gt; a&lt;br /&gt;
(type &amp;quot;1&amp;quot; to make new first partition bootable)&lt;br /&gt;
&amp;gt; w&lt;br /&gt;
(this will write the new partitions and exit fdisk)&lt;br /&gt;
shutdown -r 0&lt;br /&gt;
(connect to VM after it reboots, if it has resized partition but not filesystem then run resize2fs)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Warning: when creating the new partition, make sure that the first sector matches the sector displayed in print command (typically 2048). The default option that fdisk will provide is incorrect.&lt;br /&gt;
&lt;br /&gt;
=== The VNC connection doesn't work for me ===&lt;br /&gt;
&lt;br /&gt;
This is usually caused by a firewall on your computer, router, or at your ISP; or because of outdated browser software. If you are using the noVNC client, first try switching to another browser and see if it works there.&lt;br /&gt;
&lt;br /&gt;
If it still doesn't connect (e.g. you get &amp;quot;Connection Timeout&amp;quot; error), then you can try to use the VNC tunnel connection method so that you can use your own desktop VNC client instead of noVNC. To do this, go to the Account tab in the top right, scroll down to VNC Connection Method, and change to tunnel. Then, when you click the VNC button, you will be given VNC login details that you can plug into your desktop VNC client to connect to your virtual machine instance.&lt;br /&gt;
&lt;br /&gt;
Note: you may have to subtract 5900 from the port provided by the tunnel in some cases. So for example, if the panel says to connect to 167.114.159.49:6105, and that doesn't work, then also try connecting to 167.114.159.49:205.&lt;br /&gt;
&lt;br /&gt;
=== Can I shutdown my VMs to avoid being billed? ===&lt;br /&gt;
&lt;br /&gt;
You can use the Shelve functionality to deactivate your virtual machine. Once a VM is shelved, you will only be billed for the storage space, at $0.03/GB/mo, and assigned IP addresses, at $1/mo (both fees are charged hourly); the pricing change will be reflected in the billing section of the panel dashboard. You can reactivate the VM at any time by pressing Unshelve from the VM details.&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Frequently_asked_questions</id>
		<title>Frequently asked questions</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Frequently_asked_questions"/>
				<updated>2016-09-14T06:55:45Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Cannot connect with SSH to newly booted VM ===&lt;br /&gt;
&lt;br /&gt;
The provisioning and booting process may take as long as five minutes in some cases, depending on the specific operating system you are selecting. You can monitor progress over VNC by hitting the VNC Connection button. Once booted, you will be able to authenticate via SSH using the username and password displayed on the virtual machine page (or SSH key if you specified one).&lt;br /&gt;
&lt;br /&gt;
Note that if you selected an image marked &amp;quot;ISO&amp;quot; when provisioning the VM, you will have to install the operating system via VNC. If you simply want a ready-made VM up and running, you should select an image marked &amp;quot;template&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
=== I cannot ping my IP address 172.20.8.187 ===&lt;br /&gt;
&lt;br /&gt;
The IP address starting with 172 is the private IP address for your VM. Go to your VM details page and look for the &amp;quot;external IP address&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== How to purchase the Special XYZ plan? ===&lt;br /&gt;
&lt;br /&gt;
First, check https://dynamic.lunanode.com/info to make sure it is still in stock. If so, you can [https://dynamic.lunanode.com/register register an account] and then go to the Create VM sidebar option to create the VM of your desired special plan. Note that special plans are only available for a limited time.&lt;br /&gt;
&lt;br /&gt;
=== Do you support IPv6? ===&lt;br /&gt;
&lt;br /&gt;
Yes! We support IPv6 in Toronto. Virtual machines are automatically assigned an IPv6 address via SLAAC. User-created virtual networks receive a /64 IPv6 allocation, and virtual machines created on such networks can use any address on the allocated subnet.&lt;br /&gt;
&lt;br /&gt;
=== My account request was denied ===&lt;br /&gt;
&lt;br /&gt;
We do not accept new account registrations from proxies, hosting services, or other non-residential/business IP addresses. Please contact support@lunanode.com if you do not know why your account request was denied.&lt;br /&gt;
&lt;br /&gt;
=== How to resize my VM? ===&lt;br /&gt;
&lt;br /&gt;
To resize your VM, select the VM and use the Resize utility.&lt;br /&gt;
&lt;br /&gt;
Note that the resize will fail if you attempt to resize a local-storage-backed instance to a plan with a smaller disk size. Follow these steps to resize a VM down:&lt;br /&gt;
&lt;br /&gt;
* Take a snapshot of the VM&lt;br /&gt;
* Once the snapshot is ready (you can monitor the progress from the Images tab), go to the Volumes tab and create a volume from the snapshot with the old snapshot size&lt;br /&gt;
* Boot a new VM with &amp;quot;Ubuntu 14.04 64-bit&amp;quot; template, and attach the volume to the VM&lt;br /&gt;
* Assuming that the volume is attached at /dev/vdc, run &amp;lt;tt&amp;gt;resize2fs /dev/vdc1 10G&amp;lt;/tt&amp;gt; (replacing 10G with desired size in gigabytes; aim for as small a size as possible, so that the partition and disk will fit)&lt;br /&gt;
* Then, run fdisk /dev/vdc and re-create the partition; make sure the start sector is the same, and also make sure to set the bootable flag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# fdisk /dev/vdc&lt;br /&gt;
&lt;br /&gt;
Command (m for help): p&lt;br /&gt;
&lt;br /&gt;
Disk /dev/vdc: 37.6 GB, 37580963840 bytes&lt;br /&gt;
4 heads, 32 sectors/track, 573440 cylinders, total 73400320 sectors&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000d8e94&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/vdc1   *        2048    73400319    36699136   83  Linux&lt;br /&gt;
&lt;br /&gt;
Command (m for help): d 1&lt;br /&gt;
Selected partition 1&lt;br /&gt;
&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Partition type:&lt;br /&gt;
   p   primary (0 primary, 0 extended, 4 free)&lt;br /&gt;
   e   extended&lt;br /&gt;
Select (default p): &lt;br /&gt;
Using default response p&lt;br /&gt;
Partition number (1-4, default 1): &lt;br /&gt;
Using default value 1&lt;br /&gt;
First sector (2048-73400319, default 2048): &lt;br /&gt;
Using default value 2048&lt;br /&gt;
Last sector, +sectors or +size{K,M,G} (2048-73400319, default 73400319): 33556479&lt;br /&gt;
&lt;br /&gt;
Command (m for help): a&lt;br /&gt;
Partition number (1-4): 1&lt;br /&gt;
&lt;br /&gt;
Command (m for help): w&lt;br /&gt;
The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
Calling ioctl() to re-read partition table.&lt;br /&gt;
Syncing disks.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Above, to calculate the last sector, you can try multiplying the default last sector by the fraction that you're resizing down; e.g. if resizing from 35 GB to 15 GB, multiply (73400319 / 35 * 14) (we use 14 instead of just 15 since the partition table and other elements take up some space; do make sure that the filesystem has been resized to less than this many GB in the &amp;lt;tt&amp;gt;resize2fs&amp;lt;/tt&amp;gt; command earlier).&lt;br /&gt;
&lt;br /&gt;
* Create a new volume with the desired size, and attach it to the same VM&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;fdisk /dev/vdd&amp;lt;/tt&amp;gt; to create identical partitions on the new volume&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;dd if=/dev/vdc1 of=/dev/vdd1 bs=64k&amp;lt;/tt&amp;gt; to copy data from the partition on the old volume to the partition on the new volume&lt;br /&gt;
* Detach both volumes from the VM, and delete the volume with old size&lt;br /&gt;
* Select the volume with new size from the Volumes tab, and convert it to an image&lt;br /&gt;
* Boot the new VM from the image&lt;br /&gt;
&lt;br /&gt;
=== Unable to attach volume to my Windows VM ===&lt;br /&gt;
&lt;br /&gt;
Volumes are best used with Linux virtual machines using the virtio driver. If you are using another operating system or ide driver, then you likely will need to shut down the VM before attaching or detaching volumes. You may also need to specify the attachment target as /dev/hdc or /dev/hdd or etc.&lt;br /&gt;
&lt;br /&gt;
=== What is the default username for virtual machines provisioned using the stock templates ===&lt;br /&gt;
The default username varies and depends on the distribution of Linux template you provisioned the instance from.&lt;br /&gt;
Ubuntu: ubuntu&lt;br /&gt;
Debian: debian&lt;br /&gt;
CentOS: cloud-user / centos&lt;br /&gt;
Fedora: fedora&lt;br /&gt;
&lt;br /&gt;
=== I cannot login as root! ===&lt;br /&gt;
&lt;br /&gt;
As stated in the &amp;quot;VM provisioned successfully&amp;quot; email, template-based virtual machines are configured to accept connections with the administrative user. The username and password are displayed on the virtual machine details page. For security reasons, the VM does not accept root login by default.&lt;br /&gt;
&lt;br /&gt;
Once authenticated as the administrative user, you can execute &amp;lt;tt&amp;gt;sudo su&amp;lt;/tt&amp;gt; to login as root.&lt;br /&gt;
&lt;br /&gt;
If you wish, you can of course set a root password. First, login as root by authenticating with the administrative user and running &amp;lt;tt&amp;gt;sudo su&amp;lt;/tt&amp;gt;. Then, run &amp;lt;tt&amp;gt;passwd&amp;lt;/tt&amp;gt; to set a root user password. Finally, edit the SSH configuration:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sed -i 's/PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config&lt;br /&gt;
service ssh restart; service sshd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then logout and you should be able to authenicate via SSH directly as the root user with your newly set password.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use a [[Startup scripts|startup script]] so that the root password is set when the VM boots.&lt;br /&gt;
&lt;br /&gt;
Note: use an SSH client like [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty] to authenticate.&lt;br /&gt;
&lt;br /&gt;
Please note that our services are unmanaged and you are responsible or the security of your VM; if your VM is taken over and used in denial of service attacks, spam, or other activities that violate our [https://dynamic.lunanode.com/terms terms of service], your account may be suspended depending on the circumstances.&lt;br /&gt;
&lt;br /&gt;
=== Is additional bandwidth usage billed hourly? What about CPU usage for flexible plans? ===&lt;br /&gt;
&lt;br /&gt;
Both bandwidth and CPU are billed as '''consumable resources''', i.e., you are charged for the amount that you use. For example, if you use 5 GB bandwidth, then you will be billed $0.003 for each GB, and it does not matter how long it takes you to use that 5 GB. Similarly, for CPU usage, if you use 10 CPU-core-hours (e.g. 5% of a CPU core for 200 hours, or 100% of a CPU core for 10 hours) then you will be billed $0.22, and again it doesn't matter what timespan you use it over.&lt;br /&gt;
&lt;br /&gt;
So, the question of whether we bill &amp;quot;hourly&amp;quot; versus &amp;quot;monthly&amp;quot; doesn't make sense for flexible resources (including additional bandwidth on all plans, as well as bandwidth / CPU for flexible plans). For fixed resources (memory, disk size, etc.), though, we do bill hourly.&lt;br /&gt;
&lt;br /&gt;
If you are still confused, this is probably because you are used to monthly providers that may charge for additional CPU core or additional 1 TB bandwidth for the next month. The reason that monthly providers do this is because they don't expect you to use the full allocation, and if you only use 500 GB additional bandwidth then they save 500 GB on their end. However, in our case, we charge for resources '''as they are being consumed''' instead of in advance, so hourly versus monthly no longer matters, and you only need to pay for what you use.&lt;br /&gt;
&lt;br /&gt;
=== My disk space is smaller than the plan disk ===&lt;br /&gt;
&lt;br /&gt;
Almost all of the templates will automatically resize the partition and filesystem the first time that the virtual machine boots. If you install from ISO, you can also choose the partitioning scheme.&lt;br /&gt;
&lt;br /&gt;
So, if you are having this problem where filesystem doesn't actually get resized, it likely means you are using the CentOS 6 template, which does not support automatic filesystem resizing. You can instead run the following commands to manually resize the partition/filesystem:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
fdisk /dev/vda&lt;br /&gt;
&amp;gt; u&lt;br /&gt;
(this will switch units to sector; it is important that you use sectors and not cylinders!)&lt;br /&gt;
&amp;gt; p&lt;br /&gt;
(this will print all of the partitions, we will refer to the data later)&lt;br /&gt;
&amp;gt; d 1&lt;br /&gt;
(this will display &amp;quot;Selected partition 1&amp;quot; and delete the first partition)&lt;br /&gt;
&amp;gt; n&lt;br /&gt;
(select &amp;quot;p&amp;quot; for primary partition)&lt;br /&gt;
(partition number should be 1, but make sure it matches the number displayed in print command)&lt;br /&gt;
(first sector should be 2048, but make sure it matches the &amp;quot;Start&amp;quot; column displayed in print command)&lt;br /&gt;
(and set last sector to the default value)&lt;br /&gt;
&amp;gt; a&lt;br /&gt;
(type &amp;quot;1&amp;quot; to make new first partition bootable)&lt;br /&gt;
&amp;gt; w&lt;br /&gt;
(this will write the new partitions and exit fdisk)&lt;br /&gt;
shutdown -r 0&lt;br /&gt;
(connect to VM after it reboots, if it has resized partition but not filesystem then run resize2fs)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Warning: when creating the new partition, make sure that the first sector matches the sector displayed in print command (typically 2048). The default option that fdisk will provide is incorrect.&lt;br /&gt;
&lt;br /&gt;
=== The VNC connection doesn't work for me ===&lt;br /&gt;
&lt;br /&gt;
This is usually caused by a firewall on your computer, router, or at your ISP; or because of outdated browser software. If you are using the noVNC client, first try switching to another browser and see if it works there.&lt;br /&gt;
&lt;br /&gt;
If it still doesn't connect (e.g. you get &amp;quot;Connection Timeout&amp;quot; error), then you can try to use the VNC tunnel connection method so that you can use your own desktop VNC client instead of noVNC. To do this, go to the Account tab in the top right, scroll down to VNC Connection Method, and change to tunnel. Then, when you click the VNC button, you will be given VNC login details that you can plug into your desktop VNC client to connect to your virtual machine instance.&lt;br /&gt;
&lt;br /&gt;
Note: you may have to subtract 5900 from the port provided by the tunnel in some cases. So for example, if the panel says to connect to 167.114.159.49:6105, and that doesn't work, then also try connecting to 167.114.159.49:205.&lt;br /&gt;
&lt;br /&gt;
=== Can I shutdown my VMs to avoid being billed? ===&lt;br /&gt;
&lt;br /&gt;
You can use the Shelve functionality to deactivate your virtual machine. Once a VM is shelved, you will only be billed for the storage space, at $0.03/GB/mo, and assigned IP addresses, at $1/mo (both fees are charged hourly); the pricing change will be reflected in the billing section of the panel dashboard. You can reactivate the VM at any time by pressing Unshelve from the VM details.&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Frequently_asked_questions</id>
		<title>Frequently asked questions</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Frequently_asked_questions"/>
				<updated>2016-09-14T06:54:35Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Cannot connect with SSH to newly booted VM ===&lt;br /&gt;
&lt;br /&gt;
The provisioning and booting process may take as long as five minutes in some cases, depending on the specific operating system you are selecting. You can monitor progress over VNC by hitting the VNC Connection button. Once booted, you will be able to authenticate via SSH using the username and password displayed on the virtual machine page (or SSH key if you specified one).&lt;br /&gt;
&lt;br /&gt;
Note that if you selected an image marked &amp;quot;ISO&amp;quot; when provisioning the VM, you will have to install the operating system via VNC. If you simply want a ready-made VM up and running, you should select an image marked &amp;quot;template&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
=== I cannot ping my IP address 172.20.8.187 ===&lt;br /&gt;
&lt;br /&gt;
The IP address starting with 172 is the private IP address for your VM. Go to your VM details page and look for the &amp;quot;external IP address&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== How to purchase the Special XYZ plan? ===&lt;br /&gt;
&lt;br /&gt;
First, check https://dynamic.lunanode.com/info to make sure it is still in stock. If so, you can [https://dynamic.lunanode.com/register register an account] and then go to the Create VM sidebar option to create the VM of your desired special plan. Note that special plans are only available for a limited time.&lt;br /&gt;
&lt;br /&gt;
=== Do you support IPv6? ===&lt;br /&gt;
&lt;br /&gt;
Yes! We support IPv6 in Toronto. Virtual machines are automatically assigned an IPv6 address via SLAAC. User-created virtual networks receive a /64 IPv6 allocation, and virtual machines created on such networks can use any address on the allocated subnet.&lt;br /&gt;
&lt;br /&gt;
=== My account request was denied ===&lt;br /&gt;
&lt;br /&gt;
We do not accept new account registrations from proxies, hosting services, or other non-residential/business IP addresses. Please contact support@lunanode.com if you do not know why your account request was denied.&lt;br /&gt;
&lt;br /&gt;
=== How to resize my VM? ===&lt;br /&gt;
&lt;br /&gt;
To resize your VM, select the VM and use the Resize utility.&lt;br /&gt;
&lt;br /&gt;
Note that the resize will fail if you attempt to resize a local-storage-backed instance to a plan with a smaller disk size. Follow these steps to resize a VM down:&lt;br /&gt;
&lt;br /&gt;
* Take a snapshot of the VM&lt;br /&gt;
* Once the snapshot is ready (you can monitor the progress from the Images tab), go to the Volumes tab and create a volume from the snapshot with the old snapshot size&lt;br /&gt;
* Boot a new VM with &amp;quot;Ubuntu 14.04 64-bit&amp;quot; template, and attach the volume to the VM&lt;br /&gt;
* Assuming that the volume is attached at /dev/vdc, run &amp;lt;tt&amp;gt;resize2fs /dev/vdc1 10G&amp;lt;/tt&amp;gt; (replacing 10G with desired size in gigabytes; aim for as small a size as possible, so that the partition and disk will fit)&lt;br /&gt;
* Then, run fdisk /dev/vdc and re-create the partition; make sure the start sector is the same, and also make sure to set the bootable flag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# fdisk /dev/vdc&lt;br /&gt;
&lt;br /&gt;
Command (m for help): p&lt;br /&gt;
&lt;br /&gt;
Disk /dev/vdc: 37.6 GB, 37580963840 bytes&lt;br /&gt;
4 heads, 32 sectors/track, 573440 cylinders, total 73400320 sectors&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000d8e94&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/vdc1   *        2048    73400319    36699136   83  Linux&lt;br /&gt;
&lt;br /&gt;
Command (m for help): d 1&lt;br /&gt;
Selected partition 1&lt;br /&gt;
&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Partition type:&lt;br /&gt;
   p   primary (0 primary, 0 extended, 4 free)&lt;br /&gt;
   e   extended&lt;br /&gt;
Select (default p): &lt;br /&gt;
Using default response p&lt;br /&gt;
Partition number (1-4, default 1): &lt;br /&gt;
Using default value 1&lt;br /&gt;
First sector (2048-73400319, default 2048): &lt;br /&gt;
Using default value 2048&lt;br /&gt;
Last sector, +sectors or +size{K,M,G} (2048-73400319, default 73400319): 33556479&lt;br /&gt;
&lt;br /&gt;
Command (m for help): a&lt;br /&gt;
Partition number (1-4): 1&lt;br /&gt;
&lt;br /&gt;
Command (m for help): w&lt;br /&gt;
The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
Calling ioctl() to re-read partition table.&lt;br /&gt;
Syncing disks.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Above, to calculate the last sector, you can try multiplying the default last sector by the fraction that you're resizing down; e.g. if resizing from 35 GB to 15 GB, multiply (73400319 / 35 * 14) (we use 14 instead of just 15 since the partition table and other elements take up some space; do make sure that the filesystem has been resized to less than this many GB in the &amp;lt;tt&amp;gt;resize2fs&amp;lt;/tt&amp;gt; command earlier).&lt;br /&gt;
&lt;br /&gt;
* Create a new volume with the desired size, and attach it to the same VM&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;fdisk /dev/vdd&amp;lt;/tt&amp;gt; to create identical partitions on the new volume&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;dd if=/dev/vdc1 of=/dev/vdd1 bs=64k&amp;lt;/tt&amp;gt; to copy data from the partition on the old volume to the partition on the new volume&lt;br /&gt;
* Detach both volumes from the VM, and delete the volume with old size&lt;br /&gt;
* Select the volume with new size from the Volumes tab, and convert it to an image&lt;br /&gt;
* Boot the new VM from the image&lt;br /&gt;
&lt;br /&gt;
=== Unable to attach volume to my Windows VM ===&lt;br /&gt;
&lt;br /&gt;
Volumes are best used with Linux virtual machines using the virtio driver. If you are using another operating system or ide driver, then you likely will need to shut down the VM before attaching or detaching volumes. You may also need to specify the attachment target as /dev/hdc or /dev/hdd or etc.&lt;br /&gt;
&lt;br /&gt;
=== What is the default username for virtual machines provisioned using the stock templates ===&lt;br /&gt;
The default username varies and depends on the distribution of Linux template you provisioned the instance from.&lt;br /&gt;
Ubuntu: ubuntu&lt;br /&gt;
Debian: debian&lt;br /&gt;
CentOS: cloud-user&lt;br /&gt;
Fedora: fedora&lt;br /&gt;
&lt;br /&gt;
=== I cannot login as root! ===&lt;br /&gt;
&lt;br /&gt;
As stated in the &amp;quot;VM provisioned successfully&amp;quot; email, template-based virtual machines are configured to accept connections with the administrative user. The username and password are displayed on the virtual machine details page. For security reasons, the VM does not accept root login by default.&lt;br /&gt;
&lt;br /&gt;
Once authenticated as the administrative user, you can execute &amp;lt;tt&amp;gt;sudo su&amp;lt;/tt&amp;gt; to login as root.&lt;br /&gt;
&lt;br /&gt;
If you wish, you can of course set a root password. First, login as root by authenticating with the administrative user and running &amp;lt;tt&amp;gt;sudo su&amp;lt;/tt&amp;gt;. Then, run &amp;lt;tt&amp;gt;passwd&amp;lt;/tt&amp;gt; to set a root user password. Finally, edit the SSH configuration:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sed -i 's/PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config&lt;br /&gt;
service ssh restart; service sshd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then logout and you should be able to authenicate via SSH directly as the root user with your newly set password.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use a [[Startup scripts|startup script]] so that the root password is set when the VM boots.&lt;br /&gt;
&lt;br /&gt;
Note: use an SSH client like [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty] to authenticate.&lt;br /&gt;
&lt;br /&gt;
Please note that our services are unmanaged and you are responsible or the security of your VM; if your VM is taken over and used in denial of service attacks, spam, or other activities that violate our [https://dynamic.lunanode.com/terms terms of service], your account may be suspended depending on the circumstances.&lt;br /&gt;
&lt;br /&gt;
=== Is additional bandwidth usage billed hourly? What about CPU usage for flexible plans? ===&lt;br /&gt;
&lt;br /&gt;
Both bandwidth and CPU are billed as '''consumable resources''', i.e., you are charged for the amount that you use. For example, if you use 5 GB bandwidth, then you will be billed $0.003 for each GB, and it does not matter how long it takes you to use that 5 GB. Similarly, for CPU usage, if you use 10 CPU-core-hours (e.g. 5% of a CPU core for 200 hours, or 100% of a CPU core for 10 hours) then you will be billed $0.22, and again it doesn't matter what timespan you use it over.&lt;br /&gt;
&lt;br /&gt;
So, the question of whether we bill &amp;quot;hourly&amp;quot; versus &amp;quot;monthly&amp;quot; doesn't make sense for flexible resources (including additional bandwidth on all plans, as well as bandwidth / CPU for flexible plans). For fixed resources (memory, disk size, etc.), though, we do bill hourly.&lt;br /&gt;
&lt;br /&gt;
If you are still confused, this is probably because you are used to monthly providers that may charge for additional CPU core or additional 1 TB bandwidth for the next month. The reason that monthly providers do this is because they don't expect you to use the full allocation, and if you only use 500 GB additional bandwidth then they save 500 GB on their end. However, in our case, we charge for resources '''as they are being consumed''' instead of in advance, so hourly versus monthly no longer matters, and you only need to pay for what you use.&lt;br /&gt;
&lt;br /&gt;
=== My disk space is smaller than the plan disk ===&lt;br /&gt;
&lt;br /&gt;
Almost all of the templates will automatically resize the partition and filesystem the first time that the virtual machine boots. If you install from ISO, you can also choose the partitioning scheme.&lt;br /&gt;
&lt;br /&gt;
So, if you are having this problem where filesystem doesn't actually get resized, it likely means you are using the CentOS 6 template, which does not support automatic filesystem resizing. You can instead run the following commands to manually resize the partition/filesystem:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
fdisk /dev/vda&lt;br /&gt;
&amp;gt; u&lt;br /&gt;
(this will switch units to sector; it is important that you use sectors and not cylinders!)&lt;br /&gt;
&amp;gt; p&lt;br /&gt;
(this will print all of the partitions, we will refer to the data later)&lt;br /&gt;
&amp;gt; d 1&lt;br /&gt;
(this will display &amp;quot;Selected partition 1&amp;quot; and delete the first partition)&lt;br /&gt;
&amp;gt; n&lt;br /&gt;
(select &amp;quot;p&amp;quot; for primary partition)&lt;br /&gt;
(partition number should be 1, but make sure it matches the number displayed in print command)&lt;br /&gt;
(first sector should be 2048, but make sure it matches the &amp;quot;Start&amp;quot; column displayed in print command)&lt;br /&gt;
(and set last sector to the default value)&lt;br /&gt;
&amp;gt; a&lt;br /&gt;
(type &amp;quot;1&amp;quot; to make new first partition bootable)&lt;br /&gt;
&amp;gt; w&lt;br /&gt;
(this will write the new partitions and exit fdisk)&lt;br /&gt;
shutdown -r 0&lt;br /&gt;
(connect to VM after it reboots, if it has resized partition but not filesystem then run resize2fs)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Warning: when creating the new partition, make sure that the first sector matches the sector displayed in print command (typically 2048). The default option that fdisk will provide is incorrect.&lt;br /&gt;
&lt;br /&gt;
=== The VNC connection doesn't work for me ===&lt;br /&gt;
&lt;br /&gt;
This is usually caused by a firewall on your computer, router, or at your ISP; or because of outdated browser software. If you are using the noVNC client, first try switching to another browser and see if it works there.&lt;br /&gt;
&lt;br /&gt;
If it still doesn't connect (e.g. you get &amp;quot;Connection Timeout&amp;quot; error), then you can try to use the VNC tunnel connection method so that you can use your own desktop VNC client instead of noVNC. To do this, go to the Account tab in the top right, scroll down to VNC Connection Method, and change to tunnel. Then, when you click the VNC button, you will be given VNC login details that you can plug into your desktop VNC client to connect to your virtual machine instance.&lt;br /&gt;
&lt;br /&gt;
Note: you may have to subtract 5900 from the port provided by the tunnel in some cases. So for example, if the panel says to connect to 167.114.159.49:6105, and that doesn't work, then also try connecting to 167.114.159.49:205.&lt;br /&gt;
&lt;br /&gt;
=== Can I shutdown my VMs to avoid being billed? ===&lt;br /&gt;
&lt;br /&gt;
You can use the Shelve functionality to deactivate your virtual machine. Once a VM is shelved, you will only be billed for the storage space, at $0.03/GB/mo, and assigned IP addresses, at $1/mo (both fees are charged hourly); the pricing change will be reflected in the billing section of the panel dashboard. You can reactivate the VM at any time by pressing Unshelve from the VM details.&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Frequently_asked_questions</id>
		<title>Frequently asked questions</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Frequently_asked_questions"/>
				<updated>2016-09-14T06:53:43Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Cannot connect with SSH to newly booted VM ===&lt;br /&gt;
&lt;br /&gt;
The provisioning and booting process may take as long as five minutes in some cases, depending on the specific operating system you are selecting. You can monitor progress over VNC by hitting the VNC Connection button. Once booted, you will be able to authenticate via SSH using the username and password displayed on the virtual machine page (or SSH key if you specified one).&lt;br /&gt;
&lt;br /&gt;
Note that if you selected an image marked &amp;quot;ISO&amp;quot; when provisioning the VM, you will have to install the operating system via VNC. If you simply want a ready-made VM up and running, you should select an image marked &amp;quot;template&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
=== I cannot ping my IP address 172.20.8.187 ===&lt;br /&gt;
&lt;br /&gt;
The IP address starting with 172 is the private IP address for your VM. Go to your VM details page and look for the &amp;quot;external IP address&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== How to purchase the Special XYZ plan? ===&lt;br /&gt;
&lt;br /&gt;
First, check https://dynamic.lunanode.com/info to make sure it is still in stock. If so, you can [https://dynamic.lunanode.com/register register an account] and then go to the Create VM sidebar option to create the VM of your desired special plan. Note that special plans are only available for a limited time.&lt;br /&gt;
&lt;br /&gt;
=== Do you support IPv6? ===&lt;br /&gt;
&lt;br /&gt;
Yes! We support IPv6 in Toronto. Virtual machines are automatically assigned an IPv6 address via SLAAC. User-created virtual networks receive a /64 IPv6 allocation, and virtual machines created on such networks can use any address on the allocated subnet.&lt;br /&gt;
&lt;br /&gt;
=== My account request was denied ===&lt;br /&gt;
&lt;br /&gt;
We do not accept new account registrations from proxies, hosting services, or other non-residential/business IP addresses. Please contact support@lunanode.com if you do not know why your account request was denied.&lt;br /&gt;
&lt;br /&gt;
=== How to resize my VM? ===&lt;br /&gt;
&lt;br /&gt;
To resize your VM, select the VM and use the Resize utility.&lt;br /&gt;
&lt;br /&gt;
Note that the resize will fail if you attempt to resize a local-storage-backed instance to a plan with a smaller disk size. Follow these steps to resize a VM down:&lt;br /&gt;
&lt;br /&gt;
* Take a snapshot of the VM&lt;br /&gt;
* Once the snapshot is ready (you can monitor the progress from the Images tab), go to the Volumes tab and create a volume from the snapshot with the old snapshot size&lt;br /&gt;
* Boot a new VM with &amp;quot;Ubuntu 14.04 64-bit&amp;quot; template, and attach the volume to the VM&lt;br /&gt;
* Assuming that the volume is attached at /dev/vdc, run &amp;lt;tt&amp;gt;resize2fs /dev/vdc1 10G&amp;lt;/tt&amp;gt; (replacing 10G with desired size in gigabytes; aim for as small a size as possible, so that the partition and disk will fit)&lt;br /&gt;
* Then, run fdisk /dev/vdc and re-create the partition; make sure the start sector is the same, and also make sure to set the bootable flag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# fdisk /dev/vdc&lt;br /&gt;
&lt;br /&gt;
Command (m for help): p&lt;br /&gt;
&lt;br /&gt;
Disk /dev/vdc: 37.6 GB, 37580963840 bytes&lt;br /&gt;
4 heads, 32 sectors/track, 573440 cylinders, total 73400320 sectors&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000d8e94&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/vdc1   *        2048    73400319    36699136   83  Linux&lt;br /&gt;
&lt;br /&gt;
Command (m for help): d 1&lt;br /&gt;
Selected partition 1&lt;br /&gt;
&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Partition type:&lt;br /&gt;
   p   primary (0 primary, 0 extended, 4 free)&lt;br /&gt;
   e   extended&lt;br /&gt;
Select (default p): &lt;br /&gt;
Using default response p&lt;br /&gt;
Partition number (1-4, default 1): &lt;br /&gt;
Using default value 1&lt;br /&gt;
First sector (2048-73400319, default 2048): &lt;br /&gt;
Using default value 2048&lt;br /&gt;
Last sector, +sectors or +size{K,M,G} (2048-73400319, default 73400319): 33556479&lt;br /&gt;
&lt;br /&gt;
Command (m for help): a&lt;br /&gt;
Partition number (1-4): 1&lt;br /&gt;
&lt;br /&gt;
Command (m for help): w&lt;br /&gt;
The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
Calling ioctl() to re-read partition table.&lt;br /&gt;
Syncing disks.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Above, to calculate the last sector, you can try multiplying the default last sector by the fraction that you're resizing down; e.g. if resizing from 35 GB to 15 GB, multiply (73400319 / 35 * 14) (we use 14 instead of just 15 since the partition table and other elements take up some space; do make sure that the filesystem has been resized to less than this many GB in the &amp;lt;tt&amp;gt;resize2fs&amp;lt;/tt&amp;gt; command earlier).&lt;br /&gt;
&lt;br /&gt;
* Create a new volume with the desired size, and attach it to the same VM&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;fdisk /dev/vdd&amp;lt;/tt&amp;gt; to create identical partitions on the new volume&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;dd if=/dev/vdc1 of=/dev/vdd1 bs=64k&amp;lt;/tt&amp;gt; to copy data from the partition on the old volume to the partition on the new volume&lt;br /&gt;
* Detach both volumes from the VM, and delete the volume with old size&lt;br /&gt;
* Select the volume with new size from the Volumes tab, and convert it to an image&lt;br /&gt;
* Boot the new VM from the image&lt;br /&gt;
&lt;br /&gt;
=== Unable to attach volume to my Windows VM ===&lt;br /&gt;
&lt;br /&gt;
Volumes are best used with Linux virtual machines using the virtio driver. If you are using another operating system or ide driver, then you likely will need to shut down the VM before attaching or detaching volumes. You may also need to specify the attachment target as /dev/hdc or /dev/hdd or etc.&lt;br /&gt;
&lt;br /&gt;
=== What is the default username for instances provisioned from templates ===&lt;br /&gt;
The default username varies and depends on the distribution of Linux template you provisioned the instance from.&lt;br /&gt;
Ubuntu: ubuntu&lt;br /&gt;
Debian: debian&lt;br /&gt;
CentOS: cloud-user&lt;br /&gt;
Fedora: fedora&lt;br /&gt;
&lt;br /&gt;
=== I cannot login as root! ===&lt;br /&gt;
&lt;br /&gt;
As stated in the &amp;quot;VM provisioned successfully&amp;quot; email, template-based virtual machines are configured to accept connections with the administrative user. The username and password are displayed on the virtual machine details page. For security reasons, the VM does not accept root login by default.&lt;br /&gt;
&lt;br /&gt;
Once authenticated as the administrative user, you can execute &amp;lt;tt&amp;gt;sudo su&amp;lt;/tt&amp;gt; to login as root.&lt;br /&gt;
&lt;br /&gt;
If you wish, you can of course set a root password. First, login as root by authenticating with the administrative user and running &amp;lt;tt&amp;gt;sudo su&amp;lt;/tt&amp;gt;. Then, run &amp;lt;tt&amp;gt;passwd&amp;lt;/tt&amp;gt; to set a root user password. Finally, edit the SSH configuration:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;sed -i 's/PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config&lt;br /&gt;
service ssh restart; service sshd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then logout and you should be able to authenicate via SSH directly as the root user with your newly set password.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use a [[Startup scripts|startup script]] so that the root password is set when the VM boots.&lt;br /&gt;
&lt;br /&gt;
Note: use an SSH client like [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty] to authenticate.&lt;br /&gt;
&lt;br /&gt;
Please note that our services are unmanaged and you are responsible or the security of your VM; if your VM is taken over and used in denial of service attacks, spam, or other activities that violate our [https://dynamic.lunanode.com/terms terms of service], your account may be suspended depending on the circumstances.&lt;br /&gt;
&lt;br /&gt;
=== Is additional bandwidth usage billed hourly? What about CPU usage for flexible plans? ===&lt;br /&gt;
&lt;br /&gt;
Both bandwidth and CPU are billed as '''consumable resources''', i.e., you are charged for the amount that you use. For example, if you use 5 GB bandwidth, then you will be billed $0.003 for each GB, and it does not matter how long it takes you to use that 5 GB. Similarly, for CPU usage, if you use 10 CPU-core-hours (e.g. 5% of a CPU core for 200 hours, or 100% of a CPU core for 10 hours) then you will be billed $0.22, and again it doesn't matter what timespan you use it over.&lt;br /&gt;
&lt;br /&gt;
So, the question of whether we bill &amp;quot;hourly&amp;quot; versus &amp;quot;monthly&amp;quot; doesn't make sense for flexible resources (including additional bandwidth on all plans, as well as bandwidth / CPU for flexible plans). For fixed resources (memory, disk size, etc.), though, we do bill hourly.&lt;br /&gt;
&lt;br /&gt;
If you are still confused, this is probably because you are used to monthly providers that may charge for additional CPU core or additional 1 TB bandwidth for the next month. The reason that monthly providers do this is because they don't expect you to use the full allocation, and if you only use 500 GB additional bandwidth then they save 500 GB on their end. However, in our case, we charge for resources '''as they are being consumed''' instead of in advance, so hourly versus monthly no longer matters, and you only need to pay for what you use.&lt;br /&gt;
&lt;br /&gt;
=== My disk space is smaller than the plan disk ===&lt;br /&gt;
&lt;br /&gt;
Almost all of the templates will automatically resize the partition and filesystem the first time that the virtual machine boots. If you install from ISO, you can also choose the partitioning scheme.&lt;br /&gt;
&lt;br /&gt;
So, if you are having this problem where filesystem doesn't actually get resized, it likely means you are using the CentOS 6 template, which does not support automatic filesystem resizing. You can instead run the following commands to manually resize the partition/filesystem:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
fdisk /dev/vda&lt;br /&gt;
&amp;gt; u&lt;br /&gt;
(this will switch units to sector; it is important that you use sectors and not cylinders!)&lt;br /&gt;
&amp;gt; p&lt;br /&gt;
(this will print all of the partitions, we will refer to the data later)&lt;br /&gt;
&amp;gt; d 1&lt;br /&gt;
(this will display &amp;quot;Selected partition 1&amp;quot; and delete the first partition)&lt;br /&gt;
&amp;gt; n&lt;br /&gt;
(select &amp;quot;p&amp;quot; for primary partition)&lt;br /&gt;
(partition number should be 1, but make sure it matches the number displayed in print command)&lt;br /&gt;
(first sector should be 2048, but make sure it matches the &amp;quot;Start&amp;quot; column displayed in print command)&lt;br /&gt;
(and set last sector to the default value)&lt;br /&gt;
&amp;gt; a&lt;br /&gt;
(type &amp;quot;1&amp;quot; to make new first partition bootable)&lt;br /&gt;
&amp;gt; w&lt;br /&gt;
(this will write the new partitions and exit fdisk)&lt;br /&gt;
shutdown -r 0&lt;br /&gt;
(connect to VM after it reboots, if it has resized partition but not filesystem then run resize2fs)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Warning: when creating the new partition, make sure that the first sector matches the sector displayed in print command (typically 2048). The default option that fdisk will provide is incorrect.&lt;br /&gt;
&lt;br /&gt;
=== The VNC connection doesn't work for me ===&lt;br /&gt;
&lt;br /&gt;
This is usually caused by a firewall on your computer, router, or at your ISP; or because of outdated browser software. If you are using the noVNC client, first try switching to another browser and see if it works there.&lt;br /&gt;
&lt;br /&gt;
If it still doesn't connect (e.g. you get &amp;quot;Connection Timeout&amp;quot; error), then you can try to use the VNC tunnel connection method so that you can use your own desktop VNC client instead of noVNC. To do this, go to the Account tab in the top right, scroll down to VNC Connection Method, and change to tunnel. Then, when you click the VNC button, you will be given VNC login details that you can plug into your desktop VNC client to connect to your virtual machine instance.&lt;br /&gt;
&lt;br /&gt;
Note: you may have to subtract 5900 from the port provided by the tunnel in some cases. So for example, if the panel says to connect to 167.114.159.49:6105, and that doesn't work, then also try connecting to 167.114.159.49:205.&lt;br /&gt;
&lt;br /&gt;
=== Can I shutdown my VMs to avoid being billed? ===&lt;br /&gt;
&lt;br /&gt;
You can use the Shelve functionality to deactivate your virtual machine. Once a VM is shelved, you will only be billed for the storage space, at $0.03/GB/mo, and assigned IP addresses, at $1/mo (both fees are charged hourly); the pricing change will be reflected in the billing section of the panel dashboard. You can reactivate the VM at any time by pressing Unshelve from the VM details.&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	<entry>
		<id>https://wiki.lunanode.com/index.php/Floating_IP_addresses</id>
		<title>Floating IP addresses</title>
		<link rel="alternate" type="text/html" href="https://wiki.lunanode.com/index.php/Floating_IP_addresses"/>
				<updated>2016-08-23T06:34:21Z</updated>
		
		<summary type="html">&lt;p&gt;Jason Lee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Floating IP addresses enables dynamic IP address association with virtual machine instances (they can be associated with a VM, transferred between VMs, or removed back to the pool while the VMs are still running). On Luna Node Dynamic, all external IP addresses are floating IP addresses, and a virtual machine instance is allocated one when it is created.&lt;br /&gt;
&lt;br /&gt;
== Use cases ==&lt;br /&gt;
&lt;br /&gt;
Here are some use cases for floating IP addresses.&lt;br /&gt;
&lt;br /&gt;
* '''Upgrading your website''': suppose you want to upgrade your web software with minimal downtime. You could first [[Snapshots|snapshot]] your virtual machine to create a clone, and then perform the upgrade on the clone. When you are satisfied that the site is operational, you can seamlessly switch the floating IP address from the original virtual machine to the clone.&lt;br /&gt;
* '''Reserving IP address''': if you want to take a break from working on a project and avoid paying for the virtual machine instance, you can snapshot your virtual machine, de-associate the floating IP and place it on your account, and then delete the VM. Then, when you want to resume work, you only have to create a new VM from the snapshot and assign it the floating IP.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
When your VM is provisioned, it already comes with an external IP address, which is also a floating IP (this is directly associated with a private IP address on your VM network interface). These IP addresses are included in the VM plan hourly price. You can also have a number of floating IP addresses reserved on your account, but not assigned to any VM; these are charged hourly at $1/month.&lt;br /&gt;
&lt;br /&gt;
To transfer the IP of a VM to your account, go to the [https://dynamic.lunanode.com/panel/vms Virtual Machines] sidebar entry, select your VM, switch to the IP tab, and then click De-associate floating IP. Then, to assign it to another VM, select the other VM, de-associate its current IP if it has one (you may want to also delete the IP from your account so it isn't charged), and then associate it with the desired floating IP.&lt;br /&gt;
&lt;br /&gt;
You can use the [https://dynamic.lunanode.com/panel/floatingip Manage Floating IPs] page (in the sidebar) to add and remove floating IP address to and from your account.&lt;br /&gt;
&lt;br /&gt;
== Multiple IPs ==&lt;br /&gt;
&lt;br /&gt;
You can assign up to three additional IP addresses (four total) to each virtual machine instance. This can be done by selecting a virtual machine instance, clicking on the IP tab, and adding additional IP addresses.&lt;br /&gt;
&lt;br /&gt;
Note that your VM will have multiple internal IPs, each of which map to one external floating IP. For example, your VM may have two IP addresses 192.168.0.5 &amp;amp;rarr; 1.2.3.4 and 192.168.0.6 &amp;amp;rarr; 4.3.2.1. To accept incoming connections on the different IP addresses, you should configure your applications to listen on one of the internal IP addresses. To connect via a specific floating IP, configure your application to bind the outgoing connection to the corresponding internal IP. The virtual router will handle translation between internal and external IPs automatically.&lt;br /&gt;
&lt;br /&gt;
== Configuring rDNS record for floating IP addresses ==&lt;br /&gt;
rDNS record can be updated by selecting the virtual machine instance and click on the rDNS tab; it can also be updated by clicking on &amp;quot;Floating IPs&amp;quot; from the left menu bar on the panel.&lt;br /&gt;
&lt;br /&gt;
== Configuring software for floating IP addresses ==&lt;br /&gt;
&lt;br /&gt;
If you have one IP address assigned to your VM, typically special configuration is not needed. The configuration below is generally intended to manage multiple IP addresses assigned to one container.&lt;br /&gt;
&lt;br /&gt;
=== cPanel ===&lt;br /&gt;
&lt;br /&gt;
cPanel provides 1:1 NAT support to make it easy to use the panel on cloud infrastructures such as Luna Node Dynamic. See http://releases.cpanel.net/releases/11-40/11-nat-support/ or details on how you should add the IP addresses to cPanel. Note that &amp;quot;public IP address&amp;quot; in the link refers to the floating IP address, while &amp;quot;private IP address&amp;quot; refers to the address configured on the network interface on your VM.&lt;br /&gt;
&lt;br /&gt;
=== Apache ===&lt;br /&gt;
&lt;br /&gt;
Suppose that you are assigned two floating IP addresses for two private interfaces:&lt;br /&gt;
&lt;br /&gt;
* 170.75.160.2 for 172.20.0.2&lt;br /&gt;
* 170.75.160.3 for 172.20.0.3&lt;br /&gt;
&lt;br /&gt;
If you want to run a website on 170.75.160.2, use 172.20.0.2 in the Apache configuration. If you want to run a website on 170.75.160.3, then use 172.20.0.3.&lt;/div&gt;</summary>
		<author><name>Jason Lee</name></author>	</entry>

	</feed>