May 16, 2007"> 8"> gnt-instance"> Debian"> GNU"> GPL"> ]> 2006 2007 Google Inc. &dhdate; &dhucpackage; &dhsection; ganeti 1.2 &dhpackage; ganeti instance administration &dhpackage; command arguments... DESCRIPTION The &dhpackage; is used for instance administration in the ganeti system. COMMANDS Creation/removal/querying ADD add -n node -s disksize -o os-type -m memsize -b bridge -t diskless plain local_raid1 remote_raid1 instance Creates a new instance on the specified host. instance must be in DNS and resolve to a IP in the same network as the nodes in the cluster. The option specifies the disk size for the instance, in gigibytes (defaults to 20 GiB). The options specifies the operating system to be installed. The available operating systems can be listed with gnt-os list. The option specifies the memory size for the instance, in megibytes (defaults to 128 MiB). The option specifies the bridge to which the instance will be connected. (defaults to the cluster-wide default bridge specified at cluster initialization time). The options specifies the disk layout type for the instance. The available choices are: diskless This creates an instance with no disks. Its useful for testing only (or other special cases). plain Disk devices will be logical volumes. local_raid1 Disk devices will be md raid1 arrays over two local logical volumes. remote_raid1 Disk devices will be md raid1 arrays with one component (so it's not actually raid1): a drbd device between the instance's primary node and the node given by the option . The option is used with the remote raid disk template type and specifies the remote node. If you do not want gnt-instance to wait for the disk mirror to be synced, use the option. Example: # gnt-instance add -t plain -s 30 -m 512 -n node1.example.com \ > instance1.example.com # gnt-instance add -t remote_raid1 --secondary-node node3.example.com \ > -s 30 -m 512 -n node1.example.com instance2.example.com REMOVE remove instance Remove an instance. This will remove all data from the instance and there is no way back. If you are not sure if you use an instance again, use shutdown first and leave it in the shutdown state for a while. Example: # gnt-instance remove instance1.example.com LIST list --no-headers --separator=SEPARATOR -o FIELD,... Shows the currently configured instances with memory usage, disk usage, the node they are running on, and the CPU time, counted in seconds, used by each instance since its latest restart. The option will skip the initial header line. The option takes an argument which denotes what will be used between the output fields. Both these options are to help scripting. The option takes a comma-separated list of output fields. The available fields and their meaning are: name the instance name os the OS of the instance pnode the primary node of the instance snodes comma-separated list of secondary-nodes for the instance; usually this will be just one node admin_state the desired state of the instance (either "yes" or "no" denoting the instance should run or not) admin_ram the desired memory for the instance disk_template the disk template of the instance oper_state the actual state of the instance; can take of the values "running", "stopped", "(node down)" oper_ram the actual memory usage of the instance as seen by the hypervisor ip the ip address ganeti recognizes as associated with the instance interface mac the instance interface MAC address bridge bridge the instance is connected to There is a subtle grouping about the available output fields: all fields except for and are configuration value and not run-time values. So if you don't select any of the fields, the query will be satisfied instantly from the cluster configuration, without having to ask the remote nodes for the data. This can be helpful for big clusters when you only want some data and it makes sense to specify a reduced set of output fields. The default output field list is: name os pnode admin_state oper_state oper_ram . INFO info instance Show detailed information about the (given) instances. This is different from list as it shows detailed data about the instance's disks (especially useful for remote raid templates). MODIFY modify -m memsize -p vcpus -i ip -b bridge instance Modify the memory size, number of vcpus, ip address and/or bridge for an instance. The memory size is given in MiB. Note that you need to give at least one of the arguments, otherwise the command complains. All the changes take effect at the next restart. If the instance is running, there is no effect on the instance. REINSTALL reinstall -o os-type -f force instance Reinstalls the operating system on the given instance. The instance must be stopped when running this command. If the is specified, the operating system is changed. Starting/stopping/connecting to console STARTUP startup --extra=PARAMS instance Starts an instance. The node where to start the instance is taken from the configuration. The option is used to pass additional argument to the instance's kernel for this start only. Currently there is no way to specify a persistent set of arguments (beside the one hardcoded). Note that this may not apply to all virtualization types. Example: # gnt-instance start instance1.example.com # gnt-instance start --extra single test1.example.com SHUTDOWN shutdown instance Stops the instance. If the instance cannot be cleanly stopped during a hardcoded interval (currently 2 minutes), it will forcibly stop the instance (equivalent to switching off the power on a physical machine). Example: # gnt-instance shutdown instance1.example.com CONSOLE console instance Connects to the console of the given instance. If the instance is not up, an error is returned. Example: # gnt-instance console instance1.example.com Disk management REPLACE-DISKS replace-disks --new-secondary NODE instance This command does a full add and replace for both disks of an instance. It basically does an addmirror and removemirror for both disks of the instance. If you also want to replace the secondary node during this process (for example to fix a broken secondary node), you can do so using the option. ADD-MIRROR add-mirror -b sdX -n node instance Adds a new mirror to the disk layout of the instance, if the instance has a remote raid disk layout. The new mirror member will be between the instance's primary node and the node given with the option. REMOVE-MIRROR removemirror -b sdX -p id instance Removes a mirror componenent from the disk layout of the instance, if the instance has a remote raid disk layout. You need to specifiy on which disk to act on using the option (either sda or sdb) and the mirror component, which is identified by the option. You can find the list of valid identifiers with the info command. ACTIVATE-DISKS activate-disks instance Activates the block devices of the given instance. If successful, the command will show the location and name of the block devices: node1.example.com:sda:/dev/md0 node1.example.com:sdb:/dev/md1 In this example, node1.example.com is the name of the node on which the devices have been activated. The sda and sdb are the names of the block devices inside the instance. /dev/md0 and /dev/md1 are the names of the block devices as visible on the node. Note that it is safe to run this command while the instance is already running. DEACTIVATE-DISKS deactivate-disks instance De-activates the block devices of the given instance. Note that if you run this command for a remote raid instance type, while it is running, it will not be able to shutdown the block devices on the primary node, but it will shutdown the block devices on the secondary nodes, thus breaking the replication. Recovery FAILOVER failover -f --ignore-consistency instance Failover will fail the instance over its secondary node. This works only for instances having a remote raid disk layout. Normally the failover will check the consistency of the disks before failing over the instance. If you are trying to migrate instances off a dead node, this will fail. Use the option for this purpose. Example: # gnt-instance failover instance1.example.com &footer;