{"id":2896,"date":"2014-09-05T01:10:35","date_gmt":"2014-09-05T01:10:35","guid":{"rendered":"http:\/\/www.deuzebranaweb.com.br\/?p=2896"},"modified":"2014-09-05T01:10:35","modified_gmt":"2014-09-05T01:10:35","slug":"xen-dicas","status":"publish","type":"post","link":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/2014\/09\/05\/xen-dicas\/","title":{"rendered":"xen dicas (XenServer \u2013 Comandos \u00fateis)"},"content":{"rendered":"<p><span style=\"color: #1b1c0a; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.399999618530273px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0.10000000149011612px; display: inline !important; float: none; background-color: #ffffff;\">xe vm-import filename=test.xva<\/span><br style=\"color: #1b1c0a; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.399999618530273px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0.10000000149011612px; background-color: #ffffff;\" \/>#<span style=\"color: #1b1c0a; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.399999618530273px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0.10000000149011612px; display: inline !important; float: none; background-color: #ffffff;\"> xe vm-import filename=test.xva<\/span><br style=\"color: #1b1c0a; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.399999618530273px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0.10000000149011612px; background-color: #ffffff;\" \/><span style=\"color: #1b1c0a; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.399999618530273px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0.10000000149011612px; display: inline !important; float: none; background-color: #ffffff;\">Error: No SR specified and Pool default SR is null<\/span><br style=\"color: #1b1c0a; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.399999618530273px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0.10000000149011612px; background-color: #ffffff;\" \/><br style=\"color: #1b1c0a; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.399999618530273px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0.10000000149011612px; background-color: #ffffff;\" \/><span style=\"color: #1b1c0a; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.399999618530273px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0.10000000149011612px; display: inline !important; float: none; background-color: #ffffff;\">If i give the sr-uuid :<\/span><br style=\"color: #1b1c0a; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.399999618530273px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0.10000000149011612px; background-color: #ffffff;\" \/><br style=\"color: #1b1c0a; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.399999618530273px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0.10000000149011612px; background-color: #ffffff;\" \/><span style=\"color: #1b1c0a; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.399999618530273px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0.10000000149011612px; display: inline !important; float: none; background-color: #ffffff;\">xe vm-import filename=test.xva sr-uuid=local_storage_uuid<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>host-list<br \/>\nxe pbd-list\u00a0\u00a0\u00a0 &#8212;-&gt;&gt;&gt;&gt;sr-uuid host-uuid<br \/>\nvgscan ou pvdisplay ou pvs<br \/>\nlvdisplay \/dev\/XSLocalEXT-135a2b60-c6ea-fd38-3220-98ad12cf0d3d\/135a2b60-c6ea-fd38-3220-98ad12cf0d3d<br \/>\nVG Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 XSLocalEXT-135a2b60-c6ea-fd38-3220-98ad12cf0d3d<br \/>\nLV UUID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 FpySIi-n1lX-oolh-lAep-BxQQ-bwTs-Pq3LJg<br \/>\nmount \/dev\/\/XSLocalEXT-135a2b60-c6ea-fd38-3220-98ad12cf0d3d\/135a2b60-c6ea-fd38-3220-98ad12cf0d3d \/media\/1000gb<\/p>\n<p>host-list<br \/>\nxe pbd-list\u00a0\u00a0\u00a0 &#8212;-&gt;&gt;&gt;&gt;sr-uuid host-uuid<br \/>\nvgscan ou pvdisplay ou pvs<br \/>\nvm-list<br \/>\nxe pool-list<br \/>\nxe-toolstack-restart<br \/>\nls -alt \/dev\/disk\/by-id<br \/>\nxe sr-create name-label=&#8217;Local SSD 1&#8242; device-config:device=\/dev\/disk\/by-id\/scsi-SATA_ST1000VM002-1CT_S1G3ED02-part1 type=ext<br \/>\nxe sr-list<br \/>\nhttp:\/\/discussions.citrix.com\/topic\/240252-urgent-help-neededcommand-line-import-fails-internal-error-failure-tl\/<\/p>\n<p>&nbsp;<\/p>\n<div id=\"antes_wrap\">\n<div id=\"antes_b\">\n<div id=\"antes_b3\">\n<div class=\"moduletable\">\n<h3>Baixe o Debian Wheezy<\/h3>\n<p><a href=\"http:\/\/www.debian.org\/\" target=\"_blank\"> <img decoding=\"async\" src=\"http:\/\/coringao.files.wordpress.com\/2013\/04\/debian-wheezy.jpg\" alt=\"Debian Wheezy lan\u00e7ado\" width=\"300\" height=\"115\" border=\"0\" \/> <\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<table class=\"contentpaneopen\">\n<tbody>\n<tr>\n<td class=\"contentheading\" width=\"100%\">Dica: Como inicializar as suas VMs ap\u00f3s o boot do Xen Server<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table class=\"contentpaneopen\">\n<tbody>\n<tr>\n<td valign=\"top\"><span class=\"small\"> Escrito por Greyson <\/span><\/td>\n<\/tr>\n<tr>\n<td class=\"createdate\" valign=\"top\">Sex, 19 de Julho de 2013 18:15<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\n<div class=\"fssb\" style=\"padding: 5px; background: none repeat scroll 0 0 transparent; border: 1px none;\"><\/div>\n<p><span style=\"font-family: arial,helvetica,sans-serif; font-size: 10pt;\">Passei por v\u00e1rios problemas quando, por alguma falta de energia muito longa, o nobreak perdia a carga da bateria e o servidor Dom0 caia e ao subir novamente as VMs n\u00e3o subiam junto. Mostro nesta dica como fazer isso:<\/span><\/p>\n<p><span style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\">1. Localize o identificador do POOL com o comando <strong>&#8220;xe pool-list&#8221;<\/strong>\u00a0<br style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\" \/> <span style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\">2. Configure a inicializa\u00e7\u00e3o autom\u00e1tica do POOL com o comando <strong>&#8220;xe pool-<\/strong><span style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\"><strong>param-set uuid=POOL_UUID other-config:auto_poweron=<\/strong><span style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\"><strong>true<\/strong><wbr><\/wbr>&#8221;\u00a0<br style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\" \/> <span style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\">3. Localize o identificador da m\u00e1quina a ser inicializada <span style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\">automaticamente com o comando <strong>&#8220;xe vm-list&#8221;<\/strong>\u00a0<br style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\" \/> <span style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\">4. Configure a inicializa\u00e7\u00e3o autom\u00e1tica da VM com o comando <strong>&#8220;xe vm-<\/strong><span style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\"><strong>param-set uuid=VM_UUID other-config:auto_poweron=<\/strong><span style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\"><strong>true<\/strong><wbr><\/wbr><strong>&#8221;\u00a0<\/strong><br style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\" \/> <br style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\" \/><span style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\">Repita os passos 1 e 2 tanto sejam os POOLs e os passos 3 e 4 tanto <span style=\"color: #222222; font-size: 13px; font-family: Arial,Helvetica,sans-serif;\">sejam as VMs.<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>um script para automatizar o processo para quem precisa gerenciar muitas VM&#8217;s<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>#!\/bin\/bash<br \/>\necho auto-start ON em todas VMs<br \/>\nVMLIST=`xe vm-list | grep &#8220;uuid ( RO) &#8221; | awk &#8216;{print $5}&#8217;`<br \/>\nPOOLLIST=`xe pool-list | grep &#8220;uuid ( RO) &#8221; | awk &#8216;{print $5}&#8217;`<\/p>\n<p>for POOL in $POOLLIST<br \/>\ndo<br \/>\necho Setting auto_poweron=true on POOL $POOL<br \/>\nxe pool-param-set uuid=$POOL other-config:auto_poweron=true<br \/>\ndone<\/p>\n<p>for VM in $VMLIST<br \/>\ndo<br \/>\necho Setting auto_poweron=true on VM $VM<br \/>\nxe vm-param-set uuid=$VM other-config:auto_poweron=true<br \/>\ndone<\/p>\n<p>&nbsp;<\/p>\n<p>um script para automatizar o processo para quem precisa gerenciar muitas VM&#8217;s<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>#!\/bin\/bash<br \/>\necho auto-start ON em todas VMs<br \/>\nVMLIST=`xe vm-list | grep &#8220;uuid ( RO) &#8221; | awk &#8216;{print $5}&#8217;`<br \/>\nPOOLLIST=`xe pool-list | grep &#8220;uuid ( RO) &#8221; | awk &#8216;{print $5}&#8217;`<\/p>\n<p>for POOL in $POOLLIST<br \/>\ndo<br \/>\necho Setting auto_poweron=true on POOL $POOL<br \/>\nxe pool-param-set uuid=$POOL other-config:auto_poweron=true<br \/>\ndone<\/p>\n<p>for VM in $VMLIST<br \/>\ndo<br \/>\necho Setting auto_poweron=true on VM $VM<br \/>\nxe vm-param-set uuid=$VM other-config:auto_poweron=true<br \/>\ndone<\/p>\n<p>http:\/\/softwarelivre-ac.org\/areas\/geral\/65-servidores\/200-dica-como-inicializar-as-suas-vms-apos-o-boot-do-xen-server.html<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Comandos, console\u2026. pr\u00e1tico, r\u00e1pido, funcional\u2026. mas se voc\u00ea n\u00e3o usa todo dia acaba esquecendo, apesar de saber que eles existem. Vou listar alguns comandos do XenServer, muito \u00fateis, mas nem tanto utilizados.<\/p>\n<p>\u2013 listar discos das vms<\/p>\n<p># xe vm-disk-list \u2013multiple<\/p>\n<p>\u2013 configurar pool para iniciar automaticamente<\/p>\n<p># xe pool-param-set uuid=uuid_pool other-config:auto_poweron=true<\/p>\n<p>\u2013 configurar para vm iniciar automaticamente<\/p>\n<p># xe vm-param-set other-config:auto_poweron=true uuid=uuid_template<\/p>\n<p>\u2013 Remover configura\u00e7\u00e3o de VM (neste caso inicializa\u00e7\u00e3o autom\u00e1tica)<\/p>\n<p># xe vm-param-remove param-key=auto_poweron param-name=other-config uuid=uuid_vm<\/p>\n<p>\u2013 Exlcuir um template<\/p>\n<p># xe template-param-set other-config:default_template=false uuid=uuid_template<\/p>\n<p># xe template-param-set is-a-template=false uuid=uuid_template<\/p>\n<p># xe vm-destroy uuid=uuid_template<\/p>\n<p>\u2013 Shutdown \/ Start \/ Export VM<\/p>\n<p>xe vm-shutdown vm=nome_vm<\/p>\n<p>xe vm-start vm=nome_vm<\/p>\n<p>xe vm-export vm=nome_vm filename=\/<span class=\"skimlinks-unlinked\">Caminho_arquivo.xva<\/span><\/p>\n<p>\u2013 Resetar estado da vm<\/p>\n<p># xe vm-reset-powerstate uuid=&lt;vm&gt;<\/p>\n<p>\u2013 Listar tarefas pendentes<br \/>\n# xe task-list<\/p>\n<p>\u2013 Cancelar tarefa<br \/>\n# xe task-cancel uuid=&lt;tarefa&gt;<\/p>\n<p>\u2013 Eliminar tarefas pendentes<br \/>\n# xe-toolstack restart<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/linuxnatyworking.wordpress.com\/2013\/02\/04\/xenserver-comandos-uteis\/<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>xe vm-import filename=test.xva# xe vm-import filename=test.xvaError: No SR specified and Pool default SR is nullIf i give the sr-uuid :xe vm-import filename=test.xva sr-uuid=local_storage_uuid &nbsp; host-list xe pbd-list\u00a0\u00a0\u00a0 &#8212;-&gt;&gt;&gt;&gt;sr-uuid host-uuid vgscan ou pvdisplay ou pvs lvdisplay \/dev\/XSLocalEXT-135a2b60-c6ea-fd38-3220-98ad12cf0d3d\/135a2b60-c6ea-fd38-3220-98ad12cf0d3d VG Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 XSLocalEXT-135a2b60-c6ea-fd38-3220-98ad12cf0d3d LV UUID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 FpySIi-n1lX-oolh-lAep-BxQQ-bwTs-Pq3LJg mount \/dev\/\/XSLocalEXT-135a2b60-c6ea-fd38-3220-98ad12cf0d3d\/135a2b60-c6ea-fd38-3220-98ad12cf0d3d \/media\/1000gb&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_angie_page":false,"page_builder":"","footnotes":""},"categories":[17],"tags":[],"class_list":["post-2896","post","type-post","status-publish","format-standard","hentry","category-xen"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=2896"}],"version-history":[{"count":0,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2896\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=2896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=2896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.deuzebranaweb.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=2896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}