Virtualization quickstart » History » Sprint/Milestone 6
elyezer, 07/26/2017 08:16 PM
1 | 1 | kdelee@redhat.com | # Virtualization quickstart |
---|---|---|---|
2 | |||
3 | 4 | kdelee@redhat.com | ## Option 1: Using libvirt and Virtual Machine Manager on a Fedora 25 machine: |
4 | 2 | kdelee@redhat.com | |
5 | 1 | kdelee@redhat.com | Install the following packages: |
6 | |||
7 | `$ sudo dnf install libvirt qemu-kvm kvm libguestfs-tools virt-install` |
||
8 | |||
9 | Then, download an image for the OS you want to run in your VM. |
||
10 | Here is a link to download an .iso for Fedora 26: |
||
11 | https://getfedora.org/en/workstation/download/ |
||
12 | |||
13 | To launch "Virtual Machine Manager" press Super key and search "Virtual Machine Manager" |
||
14 | |||
15 | 1\) File -\> New Virtual Machine |
||
16 | 2\) Local install media |
||
17 | \* use file browser to find your downloaded image |
||
18 | 3\) accept default settings |
||
19 | |||
20 | 2 | kdelee@redhat.com | ### SETTING UP THE VM: |
21 | 1 | kdelee@redhat.com | |
22 | 2 | kdelee@redhat.com | - Start the VM with the "play button" |
23 | - Choose to install fedora: |
||
24 | - set hostname: give it a name other than localhost. |
||
25 | - make it meaningful |
||
26 | - set root password (weak one is OK) |
||
27 | 1 | kdelee@redhat.com | - if you make a user, make sure to give them sudo access |
28 | |||
29 | 5 | kdelee@redhat.com | > NOTE: |
30 | > If you forgot to make "admin" have sudo access: |
||
31 | > Once VM is running, go to terminal and switch to root |
||
32 | 1 | kdelee@redhat.com | |
33 | `[root@VM0 admin]# gpasswd --add admin wheel` |
||
34 | 2 | kdelee@redhat.com | |
35 | 1 | kdelee@redhat.com | Then restart. |
36 | |||
37 | 5 | kdelee@redhat.com | > WARNING: |
38 | |||
39 | \`localhost\` is a BAD hostname. Each of your VMs should have a unique hostname. If \> you have cloned this VM from another, it will have the same hostname. This needs to change |
||
40 | 1 | kdelee@redhat.com | It is imperative that you change your hostname before installing any pulp components, as they use the hostname and can produce undefined behavior if the hostname is changed after the fact. |
41 | |||
42 | See your current hostname with: |
||
43 | <code> |
||
44 | $ echo $HOSTNAME |
||
45 | |||
46 | To change your hostname, run |
||
47 | |||
48 | $ sudo hostnamectl set-hostname DESIRED_NAME |
||
49 | 5 | kdelee@redhat.com | </code> |
50 | 1 | kdelee@redhat.com | |
51 | 5 | kdelee@redhat.com | ### SETTING UP ANSIBLE (on the VM): |
52 | 1 | kdelee@redhat.com | |
53 | Install the ansible package: |
||
54 | |||
55 | `$ sudo dnf install ansible git` |
||
56 | |||
57 | Ansible info: |
||
58 | 2 | kdelee@redhat.com | For documentation see http://docs.ansible.com/ |
59 | 1 | kdelee@redhat.com | |
60 | Download the pulp_packaging repo: |
||
61 | |||
62 | `$ git clone https://github.com/pulp/pulp_packaging.git` |
||
63 | |||
64 | 6 | elyezer | Now we need to make a `hosts` file for ansible. Use the results of the `hostname` command in the place of 'localhost': |
65 | |||
66 | ~~~ |
||
67 | $ cd pulp_packaging/ci/ansible |
||
68 | $ cat > hosts <<EOF |
||
69 | > $(hostname) |
||
70 | > EOF |
||
71 | ~~~ |
||
72 | 1 | kdelee@redhat.com | |
73 | 2 | kdelee@redhat.com | ### Choosing what version of pulp to install |
74 | |||
75 | 1 | kdelee@redhat.com | To choose the version of pulp that you will install, edit the file: |
76 | 2 | kdelee@redhat.com | `pulp_packaging/ci/ansible/roles/pulp/defaults/main.yaml` |
77 | |||
78 | OR pass `-e pulp_version=2.14 -e pulp_build=nightly` in the ansible-playbook invocation. |
||
79 | |||
80 | 1 | kdelee@redhat.com | OR in hosts file, specify pulp_version and pulp_build on the same line as hostname, i.e. |
81 | `Nameofhost pulp_version=2.14 pulp_build=nightly` |
||
82 | |||
83 | Now you are ready to run the ansible playbook: |
||
84 | `$ sudo ansible-playbook -i hosts -e ansible_connection=local pulp_server.yaml` |
||
85 | 4 | kdelee@redhat.com | |
86 | ## Option 2: Using Vagrant with either libvirt or docker |
||
87 | |||
88 | See [Pulp Developer Setup](http://docs.pulpproject.org/dev-guide/contributing/dev_setup.html) |