{"id":1695,"date":"2020-03-02T10:01:18","date_gmt":"2020-03-02T10:01:18","guid":{"rendered":"http:\/\/vpxd.dc5.cz\/?p=1695"},"modified":"2022-01-21T16:55:42","modified_gmt":"2022-01-21T16:55:42","slug":"upgrade-vcloud-director-for-service-provider-to-9-7","status":"publish","type":"post","link":"https:\/\/vpxd.dc5.cz\/index.php\/2020\/03\/02\/upgrade-vcloud-director-for-service-provider-to-9-7\/","title":{"rendered":"Upgrade vCloud Director for Service Provider to 9.7"},"content":{"rendered":"<p><code><div class=\"post-views content-post post-1695 entry-meta load-static\">\r\n\t\t\t\t<span class=\"post-views-icon dashicons dashicons-chart-bar\"><\/span> <span class=\"post-views-label\">Post Views:<\/span> <span class=\"post-views-count\">1,714<\/span>\r\n\t\t\t<\/div><\/code><\/p>\n<p>Upgrade to 9.7 is little bit more complicated, because you need to upgrade (if you are using it) PostgreSQL.<\/p>\n<p>Step-by-step guide<\/p>\n<ol>\n<li><span style=\"font-family: Times New Roman; font-size: 12pt;\">Put vCloud Director + PostgreSQL DB vm&#8217;s into maintenance in monitoring system.<br \/>\n<\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">SSH to vCloud VM and shutdown services:<br \/>\n<\/span><span style=\"font-family: Courier New;\"><br \/>\n\/etc\/init.d\/vmware-vcd stop<br \/>\n<\/span><span style=\"font-family: Times New Roman;\"><br \/>\n<\/span><\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">Start nginx or apache to show temporary web page (this needs to be configured ahead). It&#8217;s just for cases, that users are trying to connect and you don&#8217;t want to have a lot of calls\/tickets why the vCloud is not running<\/span><\/span><\/span><\/span><span style=\"font-family: Courier New;\">\/etc\/init.d\/nginx start<br \/>\n<\/span><\/li>\n<li><span style=\"font-family: Times New Roman; font-size: 12pt;\">Check that the temporary page is visible.<br \/>\n<\/span><\/li>\n<li>\n<div><span style=\"font-family: Times New Roman; font-size: 12pt;\"><span style=\"font-family: Times New Roman; font-size: 12pt;\">Do + check a vCloud vm + vCloud DB vm backup<\/span><\/span><\/p>\n<p>do a PostgreDB backup<\/p>\n<\/div>\n<ol>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">check free space<span style=\"font-family: Courier New;\">df -h<\/span>su &#8211; postgrespg_dump vcloud &gt; \/var\/lib\/pgsql\/vcloud-backup_20200202.sql<br \/>\n<span style=\"font-family: Times New Roman;\"><br \/>\n<\/span><\/span><\/span><\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">check that backup is not zero<span style=\"font-family: Courier New;\">ls -la \/var\/lib\/pgsql\/vcloud-backup_20200202.sql<br \/>\n<\/span><span style=\"font-family: Times New Roman;\"><br \/>\n<\/span><\/span><\/span><\/span><\/li>\n<li><span style=\"font-family: Times New Roman; font-size: 12pt;\"><span style=\"font-family: Times New Roman; font-size: 12pt;\">output must look similar to this:<span style=\"font-family: Courier New; font-size: 10pt;\">-rw-r&#8211;r&#8211; 1 postgres postgres 4114824617 Feb 2 22:03 \/var\/lib\/pgsql\/vcloud-backup_20200202.sql<br \/>\n<\/span><span style=\"font-family: Times New Roman; font-size: 12pt;\"><br \/>\n<\/span><\/span><\/span><\/li>\n<\/ol>\n<\/li>\n<li><span style=\"font-family: Times New Roman; font-size: 12pt;\">Do snapshots on both\u00a0 VMs &#8220;vCloud Director&#8221; + &#8220;PostgreSQL DB&#8221;<br \/>\n<\/span><\/li>\n<li>\n<div><span style=\"font-family: Times New Roman; font-size: 12pt;\">Installation and upgrade PostgreSQL DB to v.10<br \/>\n<\/span><\/div>\n<p style=\"margin-left: 36pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Courier New;\">yum install postgresql10-server<\/span><\/span><\/p>\n<p>sudo systemctl stop postgresql-9.6.service &amp;&amp; sudo systemctl stop postgresql-10.service<\/p>\n<p>systemctl stop postgresql-9.6.service<\/p>\n<p>su postgres<\/p>\n<p>\/usr\/pgsql-10\/bin\/initdb -E UTF8 &#8211;locale=en_US.UTF-8 -D \/var\/lib\/pgsql\/10\/data\/<\/p>\n<p>\/usr\/pgsql-10\/bin\/pg_upgrade &#8211;old-datadir \/var\/lib\/pgsql\/9.6\/data\/ &#8211;new-datadir \/var\/lib\/pgsql\/10\/data\/ &#8211;old-bindir \/usr\/pgsql-9.6\/bin\/ &#8211;new-bindir \/usr\/pgsql-10\/bin\/<br \/>\n<span style=\"font-family: Times New Roman;\"><br \/>\nchange \/var\/lib\/pgsql\/10\/data\/pg_hba.conf same as \/var\/lib\/pgsql\/9.6\/data\/pg_hba.conf<\/span><\/p>\n<p><span style=\"font-family: Courier New;\"># TYPE DATABASE USER ADDRESS METHOD<br \/>\n# &#8220;local&#8221; is for Unix domain socket connections only<br \/>\nlocal all all trust<br \/>\n# IPv4 local connections:<br \/>\nhost all all 127.0.0.1\/32 trust<br \/>\n# IPv6 local connections:<br \/>\nhost all all ::1\/128 trust<br \/>\n# Allow replication connections from localhost, by a user with the<br \/>\n# replication privilege.<br \/>\n#local replication all trust<br \/>\n#host replication all 127.0.0.1\/32 trust<br \/>\n#host replication all ::1\/128 trust<br \/>\nhost all all 0.0.0.0\/0 md5<br \/>\n<\/span><\/p>\n<p style=\"margin-left: 36pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">vi \/var\/lib\/pgsql\/10\/data\/postgresql.conf<\/span><\/span><\/p>\n<p><span style=\"font-family: Courier New;\">listen_addresses = &#8216;*&#8217;<br \/>\n<\/span><\/p>\n<p style=\"margin-left: 36pt;\"><span style=\"font-family: Times New Roman; font-size: 12pt;\"><br \/>\nDisable PostgreSQL 9.6 and enable and start PostgreSQL 10<br \/>\n<\/span><\/p>\n<p style=\"margin-left: 36pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Courier New;\">systemctl disable postgresql-9.6.service<br \/>\nsystemctl enable postgresql-10.service<br \/>\nsystemctl start postgresql-10.service<br \/>\n<\/span><\/span><\/p>\n<p><span style=\"font-family: Courier New;\">su postgres<br \/>\n.\/analyze_new_cluster.sh<br \/>\n.\/delete_old_cluster.sh<br \/>\n<\/span><span style=\"font-family: Times New Roman;\"><br \/>\n<\/span><\/p>\n<p style=\"margin-left: 36pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">Remove old PostgreSQL service<\/span><\/span><\/p>\n<p><span style=\"font-family: Courier New;\">yum remove postgresql96-server<br \/>\n<\/span><\/li>\n<li>\n<div><span style=\"font-family: Times New Roman; font-size: 12pt;\">Check that vcloud DB user is owner of the DB in the postgress!!<br \/>\n<\/span><\/div>\n<p style=\"margin-left: 36pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Courier New;\">su postgres<br \/>\npsql<br \/>\n<\/span><span style=\"font-family: Times New Roman;\">#list DB&#8217;s<br \/>\n<\/span><span style=\"font-family: Courier New;\">\\l<\/span><span style=\"font-family: Times New Roman;\"><br \/>\n<\/span><\/span><\/p>\n<ol>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">if not change owner of DB &#8220;vcloud&#8221; to user &#8220;vcloud&#8221; :<span style=\"font-family: Courier New;\">ALTER DATABASE vcloud OWNER TO vcloud;<br \/>\n\\l<br \/>\n\\q<\/span><span style=\"font-family: Times New Roman;\"><br \/>\n<\/span><\/span><\/span><\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">optional you can do second DB backup on new PostgreSQL version<br \/>\n<span style=\"font-family: Courier New;\">pg_dump vcloud &gt; \/var\/lib\/pgsql\/vcloud-backup_pg10_20190505.sql<br \/>\n<\/span><br \/>\n<\/span><\/span><\/span><\/li>\n<\/ol>\n<\/li>\n<li><span style=\"font-family: Times New Roman; font-size: 12pt;\">upgrade vCloud to 9.7<br \/>\n<\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">Upload new version\/patch to vCloud VM ( .\/vmware-vcloud-director-distribution-9.7.0-14535248.bin )<br \/>\nensure that file is executable +x flag<br \/>\n<span style=\"font-family: Courier New;\">chmod a+x vmware-vcloud-director-distribution-9.7.0-14535248.bin<br \/>\n<\/span><\/span><\/span><\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">Run the installation bin file<br \/>\n<span style=\"font-family: Courier New;\">.\/vmware-vcloud-director-distribution-9.7.0-14535248.bin<br \/>\n<\/span><\/span><\/span><\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">run upgrade script<br \/>\n<span style=\"font-family: Courier New;\">\/opt\/vmware\/vcloud-director\/bin\/upgrade<br \/>\n<\/span><\/span><\/span><\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">Dont start vCloudDriector services after upgrade DB. Manually started Nginx is running!<br \/>\n<span style=\"font-family: Courier New;\">\/etc\/init.d\/nginx stop<br \/>\n\/etc\/init.d\/vmware-vcd start<\/span><span style=\"font-family: Times New Roman;\"><br \/>\n<\/span><\/span><\/span><\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">Reboot vCloud Director VM<br \/>\n<span style=\"font-family: Courier New;\">shutdown -r -t 1<\/span><span style=\"font-family: Times New Roman;\"><br \/>\n<\/span><\/span><\/span><\/span><\/li>\n<li><span style=\"font-family: Times New Roman; font-size: 12pt;\">Check vCloud Director: <a href=\"https:\/\/portal.lab\"><span style=\"color: blue; text-decoration: underline;\">https:\/\/_VCLOUD.DOMAIN\/<\/span><\/a><br \/>\n<\/span><\/li>\n<li><span style=\"font-size: 12pt;\"><span style=\"font-family: Times New Roman;\">Run script for checking edge VM<br \/>\n<span style=\"color: #1d1c1d;\"><br \/>\n<\/span><\/span><span style=\"font-family: Courier New;\">\/opt\/vmware\/vcloud-director\/bin\/cell-management-tool edge-ip-allocation-updates &#8211;host vcloud.<span style=\"color: #1d1c1d;\">domain.xyz &#8211;user administrator &#8211;status\/opt\/vmware\/vcloud-director\/bin\/cell-management-tool edge-ip-allocation-updates &#8211;host\u00a0vcloud<span style=\"color: #1d1c1d;\">.domain.xyz &#8211;user administrator &#8211;update-ip-allocations<\/span><br \/>\n<\/span><\/span><\/span><\/li>\n<li><span style=\"font-family: Times New Roman; font-size: 12pt;\">After 1-2 business days delete snapshots + DB backup file.<br \/>\n<\/span><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Upgrade to 9.7 is little bit more complicated, because you need to upgrade (if you are using it) PostgreSQL. Step-by-step guide Put vCloud Director + PostgreSQL DB vm&#8217;s into maintenance in monitoring system. SSH to vCloud VM and shutdown services: \/etc\/init.d\/vmware-vcd stop Start nginx or apache to show temporary web page (this needs to be &hellip; <a href=\"https:\/\/vpxd.dc5.cz\/index.php\/2020\/03\/02\/upgrade-vcloud-director-for-service-provider-to-9-7\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Upgrade vCloud Director for Service Provider to 9.7&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,24],"tags":[],"class_list":["post-1695","post","type-post","status-publish","format-standard","hentry","category-blog","category-vcloud"],"_links":{"self":[{"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/posts\/1695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/comments?post=1695"}],"version-history":[{"count":6,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/posts\/1695\/revisions"}],"predecessor-version":[{"id":2650,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/posts\/1695\/revisions\/2650"}],"wp:attachment":[{"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/media?parent=1695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/categories?post=1695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/tags?post=1695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}