blob: fb23390b31be43a773c84132457c2a60ffe79652 [file] [log] [blame]
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
%BOOK_ENTITIES;
]>
<!-- Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<section id="add-remove-nic">
<title>Reconfiguring Networks in VMs</title>
<para>&PRODUCT; provides you the ability to move VMs between networks and reconfigure a VM's
network. You can remove a VM from a network and add to a new network. You can
also change the default network of a virtual machine. With this functionality, hybrid
or traditional server loads can be accommodated with ease. </para>
<para>This feature is supported on XenServer and KVM hypervisors.</para>
<para>The following APIs have been added to support this feature. These API calls can function
only while the VM is in running or stopped state.</para>
<section id="prereq-addnic">
<title>Prerequisites</title>
<para>Ensure that vm-tools are running on guest VMs for adding or removing networks to work on VMware hypervisor.</para>
</section>
<section id="addnic">
<title>addNicToVirtualMachine</title>
<para>The addNicToVirtualMachine API adds a new NIC to the specified VM on a selected
network.</para>
<informaltable>
<tgroup cols="3" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry><para>parameter</para></entry>
<entry><para>description</para></entry>
<entry><para>Value</para></entry>
</row>
</thead>
<tbody>
<row>
<entry><para>virtualmachineid</para></entry>
<entry><para>The unique ID of the VM to which the NIC is to be added. </para></entry>
<entry><para>true</para></entry>
</row>
<row>
<entry><para>networkid</para></entry>
<entry><para>The unique ID of the network the NIC that you add should apply
to.</para></entry>
<entry><para>true</para></entry>
</row>
<row>
<entry><para>ipaddress</para></entry>
<entry><para>The IP address of the VM on the network.</para></entry>
<entry><para>false</para></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>The network and VM must reside in the same zone. Two VMs with the same name cannot reside
in the same network. Therefore, adding a second VM that duplicates a name on a network will
fail.</para>
</section>
<section id="removenic">
<title>removeNicFromVirtualMachine</title>
<para>The removeNicFromVirtualMachine API removes a NIC from the specified VM on a selected
network.</para>
<informaltable>
<tgroup cols="3" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry><para>parameter</para></entry>
<entry><para>description</para></entry>
<entry><para>Value</para></entry>
</row>
</thead>
<tbody>
<row>
<entry><para>virtualmachineid</para></entry>
<entry><para>The unique ID of the VM from which the NIC is to be removed.
</para></entry>
<entry><para>true</para></entry>
</row>
<row>
<entry><para>nicid</para></entry>
<entry><para>The unique ID of the NIC that you want to remove.</para></entry>
<entry><para>true</para></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>Removing the default NIC is not allowed.</para>
</section>
<section id="defaultnic">
<title>updateDefaultNicForVirtualMachine</title>
<para>The updateDefaultNicForVirtualMachine API updates the specified NIC to be the default one
for a selected VM.</para>
<para>The NIC is only updated in the database. You must manually update the default NIC on the
VM. You get an alert to manually update the NIC. </para>
<informaltable>
<tgroup cols="3" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry><para>parameter</para></entry>
<entry><para>description</para></entry>
<entry><para>Value</para></entry>
</row>
</thead>
<tbody>
<row>
<entry><para>virtualmachineid</para></entry>
<entry><para>The unique ID of the VM for which you want to specify the default NIC.
</para></entry>
<entry><para>true</para></entry>
</row>
<row>
<entry><para>nicid</para></entry>
<entry><para>The unique ID of the NIC that you want to set as the default
one.</para></entry>
<entry><para>true</para></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>